#include <snmp_pp_ext.h>
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) |
AGENT++ uses Snmpx instead of Snmp, because Snmp does not allow to listen on an UDP port for incoming SNMP requests.
Snmpx::Snmpx | ( | int & | status, | |
u_short | port | |||
) | [inline] |
Construct a new SNMP session using the given UDP port.
status | after creation of the session this parameter will hold the creation status. | |
port | an UDP port to be used for the session |
int Snmpx::receive | ( | struct timeval * | , | |
Pdux & | , | |||
NS_SNMP UdpAddress & | , | |||
NS_SNMP snmp_version & | , | |||
NS_SNMP OctetStr & | ||||
) |
Receive a SNMP PDU.
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 |
int Snmpx::send | ( | Pdux | , | |
NS_SNMP | UdpAddress, | |||
NS_SNMP | snmp_version, | |||
NS_SNMP | OctetStr | |||
) |
Send o SNMP PDU.
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 |
u_short Snmpx::get_port | ( | ) |
Get the port the request list is listening on.
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.
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] |