PTLib Version 2.12.9

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
PSNMPServer Class Reference

Class which supplies SNMP data. More...

`#include <psnmp.h>`

Inheritance diagram for PSNMPServer:
[legend]
Collaboration diagram for PSNMPServer:
[legend]

## Public Member Functions
| PSNMPServer (PIPSocket::Address binding=PIPSocket::GetDefaultIpAny(), WORD localPort=161, PINDEX timeout=5000, PINDEX rxSize=10000, PINDEX txSize=10000)
| ~PSNMPServer ()
void | Main ()
void | SetVersion (PASNInt newVersion)
PBoolean | HandleChannel ()
PBoolean | ProcessPDU (const PBYTEArray &readBuffer, PBYTEArray &writeBuffer)
virtual PBoolean | Authorise (const PIPSocket::Address &received)
virtual PBoolean | ConfirmVersion (PASN_Integer vers)
virtual PBoolean | ConfirmCommunity (PASN_OctetString &community)
virtual PBoolean | MIB_LocalMatch (PSNMP_PDU &pdu)
virtual PBoolean | OnGetRequest (PINDEX reqID, PSNMP::BindingList &vars, PSNMP::ErrorType &errCode)
virtual PBoolean | OnGetNextRequest (PINDEX reqID, PSNMP::BindingList &vars, PSNMP::ErrorType &errCode)
virtual PBoolean | OnSetRequest (PINDEX reqID, PSNMP::BindingList &vars, PSNMP::ErrorType &errCode)
PSNMP::ErrorType | SendGetResponse (PSNMPVarBindingList &vars)

## Protected Attributes
PThreadObj< PSNMPServer > | m_thread
PString | community
PASN_Integer | version
PINDEX | lastErrorIndex
ErrorType | lastErrorCode
PBYTEArray | readBuffer
PINDEX | maxRxSize
PINDEX | maxTxSize
PUDPSocket * | baseSocket
PDictionary < PRFC1155_ObjectName, PRFC1155_ObjectSyntax > | objList

## Additional Inherited Members
Public Types inherited from PSNMP
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 inherited from PSNMP
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)
Protected Member Functions inherited from PIndirectChannel
virtual PBoolean | OnOpen ()
| This callback is executed when the Open() function is called with open channels. More...
Friends inherited from PObject

## Detailed Description

Class which supplies SNMP data.

## Constructor & Destructor Documentation

PSNMPServer::PSNMPServer | ( | PIPSocket::Address | binding = `PIPSocket::GetDefaultIpAny()`,
|  | WORD | localPort = `161`,
|  | PINDEX | timeout = `5000`,
|  | PINDEX | rxSize = `10000`,
|  | PINDEX | txSize = `10000`
| ) |  |

PSNMPServer::~PSNMPServer | ( |  | ) |

## Member Function Documentation

virtual PBoolean PSNMPServer::Authorise | ( | const PIPSocket::Address & | received | ) |
| virtual

virtual PBoolean PSNMPServer::ConfirmCommunity | ( | PASN_OctetString & | community | ) |
| virtual

virtual PBoolean PSNMPServer::ConfirmVersion | ( | PASN_Integer | vers | ) |
| virtual

PBoolean PSNMPServer::HandleChannel | ( |  | ) |

void PSNMPServer::Main | ( |  | ) |

virtual PBoolean PSNMPServer::MIB_LocalMatch | ( | PSNMP_PDU & | pdu | ) |
| virtual

virtual PBoolean PSNMPServer::OnGetNextRequest | ( | PINDEX | reqID,
|  | PSNMP::BindingList & | vars,
|  | PSNMP::ErrorType & | errCode
| ) |  |
| virtual

virtual PBoolean PSNMPServer::OnGetRequest | ( | PINDEX | reqID,
|  | PSNMP::BindingList & | vars,
|  | PSNMP::ErrorType & | errCode
| ) |  |
| virtual

virtual PBoolean PSNMPServer::OnSetRequest | ( | PINDEX | reqID,
|  | PSNMP::BindingList & | vars,
|  | PSNMP::ErrorType & | errCode
| ) |  |
| virtual

PBoolean PSNMPServer::ProcessPDU | ( | const PBYTEArray & | readBuffer,
|  | PBYTEArray & | writeBuffer
| ) |  |

PSNMP::ErrorType PSNMPServer::SendGetResponse | ( | PSNMPVarBindingList & | vars | ) |

void PSNMPServer::SetVersion | ( | PASNInt | newVersion | ) |

## Member Data Documentation

PUDPSocket* PSNMPServer::baseSocket
| protected

PString PSNMPServer::community
| protected

ErrorType PSNMPServer::lastErrorCode
| protected

PINDEX PSNMPServer::lastErrorIndex
| protected

PThreadObj<PSNMPServer> PSNMPServer::m_thread
| protected

PINDEX PSNMPServer::maxRxSize
| protected

PINDEX PSNMPServer::maxTxSize
| protected

PDictionary<PRFC1155_ObjectName, PRFC1155_ObjectSyntax> PSNMPServer::objList
| protected

PBYTEArray PSNMPServer::readBuffer
| protected

PASN_Integer PSNMPServer::version
| protected

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

- psnmp.h