SNMP Manager Programmer's Guide
Constructing and Interpreting Packets
SNMP Manager Programmer’s Guide–134249
5-15
SNMP_Create_Trap()
community-identifier
is a pointer to a character buffer containing the community identifier.
enterprise-count
is the number of components in the OID identifying the enterprise whose value you
supply in enterprise-components. For example, a Tandem enterprise
identifier of 1.1.3.6.1.4.1.169 has a component count of 8.
enterprise-components
is a pointer to a structure of type OIDC_T that contains the OID of the enterprise
you want to identify with the trap.
address
is a pointer to a buffer containing the IP address at which your manager resides.
generic-trap
is the generic trap code. Assign one of the following values, which correspond to
the values indicated:
0 (coldStart)
1 (warmStart)
2 (linkDown)
3 (linkUp)
4 (authenticationFailure)
5 (egpNeighborLoss)
6 (enterpriseSpecific)
specific-trap
is an integer describing a specific trap code, which is an enterprise-defined code
providing additional information about the nature of the trap.
timestamp
is an indication of the time the trap was issued, usually the number of timeticks
(1/100ths of a second) since your system was last started.
num-varbinds
is an integer indicating how many variable bindings the packet will contain. After
SNMP_Create_Trap() 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.
The following example, taken from SNMPTRAP, initializes a packet for a trap. After
the default value for the enterprise identifier is initialized, the structure for holding OIDs
is declared globally using the Manager Services define MAX_OID_COUNT to set the