Dangerous SNMP
|
A PDU represents an SNMP Protocol Data Unit (PDU). More...
#include <pdu.hpp>
Public Member Functions | |
PDU () | |
Default constructor. More... | |
PDU (const PDU &pdu) | |
Copy constructor. More... | |
~PDU () | |
Destructor. | |
void | addOid (const NumericOid &oid) |
This adds a new VarBind to the PDU (with a null value). More... | |
bool | containsOid (const NumericOid &oid) |
This checks to see if the PDU contains the given OID. More... | |
Static Public Member Functions | |
static const char * | errorName (int errorStatus) |
This returns a pointer to a statically allocated string that contains the standard name for the error status given. More... | |
Public Attributes | |
int | requestId |
This is the RequestID for the PDU. More... | |
int | errorStatus |
This is the ErrorStatus for the PDU. More... | |
int | errorIndex |
This is the ErrorIndex for the PDU. More... | |
VarBindList | varbinds |
This is the list of VarBinds in the PDU. | |
A PDU represents an SNMP Protocol Data Unit (PDU).
The SNMP PDU was introduced in RFC 1157 (see Section 4, Protocol Specification).
An SNMP PDU is intended to be the basic input and output data structure for SNMP.
void addOid | ( | const NumericOid & | oid | ) |
bool containsOid | ( | const NumericOid & | oid | ) |
This checks to see if the PDU contains the given OID.
oid | The OID to look for. |
|
static |
This returns a pointer to a statically allocated string that contains the standard name for the error status given.
errorStatus | The error status value. |
int errorIndex |
This is the ErrorIndex for the PDU.
This was originally intended to communicate the index of the VarBind that caused the error. However, when there are multiple VarBinds, there could be multiple VarBinds with errors. For SNMPv2c and higher Get requests, the errors are encoded at the VarBind level, so this is not used. However, this is still valid for Set requests.
int errorStatus |
int requestId |
This is the RequestID for the PDU.
According to RFC 1157,
RequestIDs are used to distinguish among outstanding requests. By use of the RequestID, an SNMP application entity can correlate incoming responses with outstanding requests. In cases where an unreliable datagram service is being used, the RequestID also provides a simple means of identifying messages duplicated by the network.