PTLib  Version 2.14.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PSNMP Class Reference

A descendant of PUDPSocket which can perform SNMP calls. More...

#include <psnmp.h>

Inheritance diagram for PSNMP:
Collaboration diagram for PSNMP:

Public Types

enum  ErrorType {
  NoError = 0, TooBig = 1, NoSuchName = 2, BadValue = 3,
  ReadOnly = 4, GenErr = 5, NoResponse, MalformedResponse,
  SendFailed, RxBufferTooSmall, TxDataTooBig, NumErrors
}
 
enum  RequestType {
  GetRequest = 0, GetNextRequest = 1, GetResponse = 2, SetRequest = 3,
  Trap = 4
}
 
enum  { TrapPort = 162 }
 
enum  TrapType {
  ColdStart = 0, WarmStart = 1, LinkDown = 2, LinkUp = 3,
  AuthenticationFailure = 4, EGPNeighbourLoss = 5, EnterpriseSpecific = 6, NumTrapTypes
}
 
typedef list< pair< PString,
PRFC1155_ObjectSyntax > > 
BindingList
 

Static Public Member Functions

static PString GetErrorText (ErrorType err)
 
static PString GetTrapTypeText (PINDEX code)
 
static void SendEnterpriseTrap (const PIPSocket::Address &addr, const PString &community, const PString &enterprise, PINDEX specificTrap, PASNUnsigned timeTicks, WORD sendPort=TrapPort)
 
static void SendEnterpriseTrap (const PIPSocket::Address &addr, const PString &community, const PString &enterprise, PINDEX specificTrap, PASNUnsigned timeTicks, const PSNMPVarBindingList &vars, WORD sendPort=TrapPort)
 
static void SendTrap (const PIPSocket::Address &addr, PSNMP::TrapType trapType, const PString &community, const PString &enterprise, PINDEX specificTrap, PASNUnsigned timeTicks, const PSNMPVarBindingList &vars, WORD sendPort=TrapPort)
 
static void SendTrap (const PIPSocket::Address &addr, PSNMP::TrapType trapType, const PString &community, const PString &enterprise, PINDEX specificTrap, PASNUnsigned timeTicks, const PSNMPVarBindingList &vars, const PIPSocket::Address &agentAddress, WORD sendPort=TrapPort)
 
static void WriteTrap (PChannel &channel, PSNMP::TrapType trapType, const PString &community, const PString &enterprise, PINDEX specificTrap, PASNUnsigned timeTicks, const PSNMPVarBindingList &vars, const PIPSocket::Address &agentAddress)
 

Additional Inherited Members

- Public Member Functions inherited from PIndirectChannel
 PIndirectChannel ()
 Create a new indirect channel without any channels to redirect to. More...
 
 ~PIndirectChannel ()
 Close the indirect channel, deleting read/write channels if desired. More...
 
Comparison Compare (const PObject &obj) const
 Determine if the two objects refer to the same indirect channel. More...
 
virtual PString GetName () const
 Get the name of the channel. More...
 
virtual P_INT_PTR GetHandle () const
 Get the OS specific handle for the PSoundChannel. More...
 
virtual PBoolean Close ()
 Close the channel. More...
 
virtual PBoolean IsOpen () const
 Determine if the channel is currently open and read and write operations can be executed on it. More...
 
virtual PBoolean Read (void *buf, PINDEX len)
 Low level read from the channel. More...
 
virtual int ReadChar ()
 Read a single character from the channel. More...
 
virtual PBoolean Write (const void *buf, PINDEX len)
 Low level write to the channel. More...
 
virtual PBoolean Shutdown (ShutdownValue option)
 Close one or both of the data streams associated with a channel. More...
 
virtual bool SetLocalEcho (bool localEcho)
 Set local echo mode. More...
 
virtual PChannelGetBaseReadChannel () const
 This function returns the eventual base channel for reading of a series of indirect channels provided by descendents of PIndirectChannel. More...
 
virtual PChannelGetBaseWriteChannel () const
 This function returns the eventual base channel for writing of a series of indirect channels provided by descendents of PIndirectChannel. More...
 
virtual PString GetErrorText (ErrorGroup group=NumErrorGroups) const
 Get error message description. More...
 
PBoolean Open (PChannel &channel)
 Set the channel for both read and write operations. More...
 
PBoolean Open (PChannel *channel, PBoolean autoDelete=true)
 Set the channel for both read and write operations. More...
 
PBoolean Open (PChannel *readChannel, PChannel *writeChannel, PBoolean autoDeleteRead=true, PBoolean autoDeleteWrite=true)
 Set the channel for both read and write operations. More...
 
PChannelDetach (ShutdownValue option=ShutdownReadAndWrite)
 Detach without closing the read/write channel. More...
 
PChannelGetReadChannel () const
 Get the channel used for read operations. More...
 
bool SetReadChannel (PChannel *channel, bool autoDelete=true, bool closeExisting=false)
 Set the channel for read operations. More...
 
PChannelGetWriteChannel () const
 Get the channel used for write operations. More...
 
PBoolean SetWriteChannel (PChannel *channel, bool autoDelete=true, bool closeExisting=false)
 Set the channel for read operations. More...
 
- Protected Member Functions inherited from PIndirectChannel
virtual PBoolean OnOpen ()
 This callback is executed when the Open() function is called with open channels. More...
 
- Protected Attributes inherited from PIndirectChannel
PChannelreadChannel
 Channel for read operations. More...
 
PBoolean readAutoDelete
 Automatically delete read channel on destruction. More...
 
PChannelwriteChannel
 Channel for write operations. More...
 
PBoolean writeAutoDelete
 Automatically delete write channel on destruction. More...
 
PReadWriteMutex channelPointerMutex
 Race condition prevention on closing channel. More...
 
- Friends inherited from PObject

Detailed Description

A descendant of PUDPSocket which can perform SNMP calls.

Member Typedef Documentation

Member Enumeration Documentation

anonymous enum
Enumerator
TrapPort 
Enumerator
NoError 
TooBig 
NoSuchName 
BadValue 
ReadOnly 
GenErr 
NoResponse 
MalformedResponse 
SendFailed 
RxBufferTooSmall 
TxDataTooBig 
NumErrors 
Enumerator
GetRequest 
GetNextRequest 
GetResponse 
SetRequest 
Trap 
Enumerator
ColdStart 
WarmStart 
LinkDown 
LinkUp 
AuthenticationFailure 
EGPNeighbourLoss 
EnterpriseSpecific 
NumTrapTypes 

Member Function Documentation

static PString PSNMP::GetErrorText ( ErrorType  err)
static
static PString PSNMP::GetTrapTypeText ( PINDEX  code)
static
static void PSNMP::SendEnterpriseTrap ( const PIPSocket::Address addr,
const PString community,
const PString enterprise,
PINDEX  specificTrap,
PASNUnsigned  timeTicks,
WORD  sendPort = TrapPort 
)
static
static void PSNMP::SendEnterpriseTrap ( const PIPSocket::Address addr,
const PString community,
const PString enterprise,
PINDEX  specificTrap,
PASNUnsigned  timeTicks,
const PSNMPVarBindingList vars,
WORD  sendPort = TrapPort 
)
static
static void PSNMP::SendTrap ( const PIPSocket::Address addr,
PSNMP::TrapType  trapType,
const PString community,
const PString enterprise,
PINDEX  specificTrap,
PASNUnsigned  timeTicks,
const PSNMPVarBindingList vars,
WORD  sendPort = TrapPort 
)
static
static void PSNMP::SendTrap ( const PIPSocket::Address addr,
PSNMP::TrapType  trapType,
const PString community,
const PString enterprise,
PINDEX  specificTrap,
PASNUnsigned  timeTicks,
const PSNMPVarBindingList vars,
const PIPSocket::Address agentAddress,
WORD  sendPort = TrapPort 
)
static
static void PSNMP::WriteTrap ( PChannel channel,
PSNMP::TrapType  trapType,
const PString community,
const PString enterprise,
PINDEX  specificTrap,
PASNUnsigned  timeTicks,
const PSNMPVarBindingList vars,
const PIPSocket::Address agentAddress 
)
static

The documentation for this class was generated from the following file: