SNMP Manager Programmer's Guide
Using Header Files, Data Structures, and Defines
SNMP Manager Programmer’s Guide–134249
4-5
Unencoded-Packet Structure (SNMP_PKT_T)
pdu_type
characterizes the kind of PDU in the packet. The following Manager Services
defines describe values for pdu_type:
#define GET_REQUEST_PDU 0
#define GET_NEXT_REQUEST_PDU 1
#define GET_RESPONSE_PDU 2
#define SET_REQUEST_PDU 3
#define TRAP_PDU 4
#define NO_PDU 0xFF
pdu_length
is the number of bytes in the PDU.
pdu
is a tagged union with two principal variations, std_pdu and trap_pdu, the former for
request and response PDUs and the latter for trap PDUs.
std_pdu
is a structure for holding a request or response PDU. This structure contains four
fields:
request_id
is the request identifier.
error_status
is an indication in a response packet of whether an error occurred. The
following Manager Services defines describe values for error_status:
#define NO_ERROR 0
#define TOO_BIG 1
#define NO_SUCH_NAME 2
#define BAD_VALUE 3
#define READ_ONLY 4
#define GEN_ERR 5
#define NO_ACCESS 6
#define WRONG_TYPE 7
#define WRONG_LENGTH 8
#define WRONG_ENCODING 9
#define WRONG_VALUE 10
#define NO_CREATION 11
#define INCONSISTENT_VALUE 12
#define RESOURCE_UNAVAILABLE 13
#define COMMIT_FAILED 14
#define UNDO_FAILED 15
#define AUTHORIZATION_ERROR 16
#define NOT_WRITABLE 17
#define INCONSISTENT_NAME 18
#define LAST_ERROR 19
error_index
indicates which variable (an instance of a managed object) in a list caused the
error.