AGENT++  4.0.3
Public Member Functions | Protected Member Functions | List of all members
Snmpx Class Reference

The Snmpx class is a sub class of Snmp that provides additional methods for sending and receiving SNMP messages. More...

#include <snmp_pp_ext.h>

Inheritance diagram for Snmpx:

Public Member Functions

 Snmpx (int &status, u_short port)
 Construct a new SNMP session using the given UDP port.
 
int receive (struct timeval *, Pdux &, NS_SNMP UdpAddress &, NS_SNMP snmp_version &, NS_SNMP OctetStr &)
 Receive a SNMP PDU.
 
int send (Pdux const &, NS_SNMP UdpAddress const &, NS_SNMP snmp_version, NS_SNMP OctetStr const &)
 Send o SNMP PDU.
 
u_short get_port ()
 Get the port the request list is listening on.
 
SnmpSocket get_session_fds ()
 Return the socket descriptor of the socket used for incoming SNMP request.
 

Protected Member Functions

unsigned long ProcessizedReqId (unsigned short)
 
unsigned long MyMakeReqId ()
 

Detailed Description

The Snmpx class is a sub class of Snmp that provides additional methods for sending and receiving SNMP messages.

AGENT++ uses Snmpx instead of Snmp, because Snmp does not allow to listen on an UDP port for incoming SNMP requests.

Version
3.4.4
Author
Frank Fock

Constructor & Destructor Documentation

Snmpx::Snmpx ( int &  status,
u_short  port 
)
inline

Construct a new SNMP session using the given UDP port.

Parameters
statusafter creation of the session this parameter will hold the creation status.
portan UDP port to be used for the session

Member Function Documentation

u_short Snmpx::get_port ( )

Get the port the request list is listening on.

Returns
a UDP port.
SnmpSocket Snmpx::get_session_fds ( )
inline

Return the socket descriptor of the socket used for incoming SNMP request.

This is the socket the select() of the receive method listens on. This socket descriptor may be used to be included in other select controlled polling loops.

Returns
a socket descriptor.
unsigned long Snmpx::MyMakeReqId ( )
protected
unsigned long Snmpx::ProcessizedReqId ( unsigned  short)
protected
int Snmpx::receive ( struct timeval *  ,
Pdux ,
NS_SNMP UdpAddress &  ,
NS_SNMP snmp_version &  ,
NS_SNMP OctetStr &   
)

Receive a SNMP PDU.

Parameters
timeoutwait for an incoming PDU until timeout is exceeded
pduwill contain the received SNMP PDU
form_addressthe UDP address of the sender of the received PDU
versionwill contain the SNMP version of the received PDU
communitywill conatin the community (in case of SNMPv3 the security information) of the received PDU
Returns
SNMP_CLASS_SUCCESS on success and SNMP_CLASS_ERROR, SNMP_CLASS_TL_FAILED on failure.
int Snmpx::send ( Pdux const &  ,
NS_SNMP UdpAddress const &  ,
NS_SNMP  snmp_version,
NS_SNMP OctetStr const &   
)

Send o SNMP PDU.

Parameters
pduthe SNMP PDU to send
addressthe receiver's UDP address
versionthe SNMP version to be used
communitythe community / security information to be used
Returns
SNMP_CLASS_SUCCESS on success and SNMP_CLASS_ERROR, SNMP_CLASS_TL_FAILED on failure.

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