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>

List of all members.

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, NS_SNMP UdpAddress, NS_SNMP snmp_version, NS_SNMP OctetStr)
 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 ()
int snmp_engine (NS_SNMP Pdu &, long int, long int, NS_SNMP SnmpTarget &, const NS_SNMP snmp_callback cb, const void *cbd)


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:
status after creation of the session this parameter will hold the creation status.
port an UDP port to be used for the session


Member Function Documentation

int Snmpx::receive ( struct timeval *  ,
Pdux ,
NS_SNMP UdpAddress &  ,
NS_SNMP snmp_version &  ,
NS_SNMP OctetStr &   
)

Receive a SNMP PDU.

Parameters:
timeout wait for an incoming PDU until timeout is exceeded
pdu will contain the received SNMP PDU
form_address the UDP address of the sender of the received PDU
version will contain the SNMP version of the received PDU
community will 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  ,
NS_SNMP  UdpAddress,
NS_SNMP  snmp_version,
NS_SNMP  OctetStr 
)

Send o SNMP PDU.

Parameters:
pdu the SNMP PDU to send
address the receiver's UDP address
version the SNMP version to be used
community the community / security information to be used
Returns:
SNMP_CLASS_SUCCESS on success and SNMP_CLASS_ERROR, SNMP_CLASS_TL_FAILED on failure.

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::ProcessizedReqId ( unsigned  short  )  [protected]

unsigned long Snmpx::MyMakeReqId (  )  [protected]

int Snmpx::snmp_engine ( NS_SNMP Pdu &  ,
long  int,
long  int,
NS_SNMP SnmpTarget &  ,
const NS_SNMP snmp_callback  cb,
const void *  cbd 
) [protected]


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

Generated on Fri May 29 22:36:55 2009 for AGENT++ by  doxygen 1.5.6