SNMP Manager Programmer's Guide

Constructing and Interpreting Packets
SNMP Manager Programmer’s Guide–134249
5-2
Request and Response Packets
Request and Response Packets
Figure 5-2 illustrates the fields in a request and response packet. The PDU type
identifies the PDU as a Get, GetNext, Set, or Response PDU. The request-id uniquely
identifies the packet. The error-status and error-index describe the results of packet
processing.
Table 5-2 summarizes how the values of the first four fields are set. Setting variable
bindings is the topic of Variable Bindings on page 5-5.
Table 5-1. Assigning Version and Community Values
Packet
Field Assigned Value By Value Description
SNMP_PKT_T
Field
version SNMP_Create_Request()
SNMP_Create_Trap()
Agents, subagents, or
other managers
You use one of the
following defines to set
this value to 0:
VERSION_RFC1067
VERSION_RFC1098
VERSION_RFC1157
SNMP_VERSION_1
For trap packets
assembled elsewhere, this
value is assigned by the
originating entity.
snmp_version
community SNMP_Create_Request()
SNMP_Create_Trap()
Agents, subagents, or
other managers
You pass a pointer to a
character buffer that
contains the community
string.
For trap packets
assembled elsewhere, this
value is assigned by the
originating entity.
community
Figure 5-2. The Request and Response Packet
501
PDU type request-id error-status error-index variable bindings