SNMP Manager Programmer's Guide

Reference Summary
SNMP Manager Programmer’s Guide134249
9-26
Initializing Packets
SNMP_Create_Trap()
This function initializes a trap packet. It dynamically allocates memory for a packet
structure of type SNMP_PKT_T, assigns to it all trap packet variables except variable
bindings, and returns a pointer to the structure. To associate variable bindings with the
packet, use the functions defined later in this section under “Functions for Binding MIB
Variables.” To deallocate memory used by a trap packet you no longer need, use
packet
A pointer to a structure of type SNMP_PKT_T if the function
succeeds or 0 if it fails.
pdu-type
The kind of PDU to be placed in the packet. Use one of the
following defines:
For Get requests, use GET_REQUEST_PDU (0).
For GetNext requests, use GET_NEXT_REQUEST_PDU (1).
For Set requests, use SET_REQUEST_PDU (3).
version
One of the following defines, all of which equate to 0, indicating
Version 1 of SNMP:
VERSION_RFC1067
VERSION_RFC1098
VERSION_RFC1157
SNMP_VERSION_1
community-
length
The number of bytes in the community identifier to which
community-identifier points.
community-
identifier
A pointer to a character buffer containing the community
identifier.
request-id
An integer you use to correlate the request packet with a
subsequent response packet.
num-varbinds
An integer indicating how many variable bindings the packet will
contain. After SNMP_Create_Request() completes, call an
SNMP_Bind_ function as many times as the number of variable
bindings in order to associate the variable bindings with the
packet.