SNMP Manager Programmer's Guide

Using Header Files, Data Structures, and Defines
SNMP Manager Programmer’s Guide–134249
4-2
Packet-Handling Structures
Packet-Handling Structures
Several Manager Services typedefs are structures used in conjunction with library
functions that construct, encode, and decode packets. These structures, defined in this
subsection, are used for OIDs, encoded packets, unencoded packets, and decoding
statistics.
OID Structure (OBJ_ID_T)
This structure is used to describe an ASN.1 OID. It consists of two elements, the values
of which are limited in range from 0 to 64K-1:
Table 4-2. Manager Services Typedefs
Typedef Description
ALENGTH_T The fully decoded value of an ASN.1 length field
ATVALUE_T The fully decoded value of an ASN.1 tag, excluding the context and
constructor bits
EBUFFER_T A structure containing descriptors that characterize a variable-length
string buffer
INT_16_T A signed 16-bit integer
INT_32_T A signed 32-bit integer, which should be used for MIB objects of type
INTEGER
OBJ_ID_T A structure for describing an OID
OCTET_T An unsigned 8-bit character
OIDC_T An unsigned 32-bit integer, an array of which is used to hold the
integers in OIDs
PTR_T A generic pointer (void*)
SNMP_PKT_T A structure for holding an unencoded request, response, or trap packet
SNMP_STATS_T A structure for holding decoding statistics
UINT_8_T An unsigned 8-bit integer
UINT_16_T An unsigned 16-bit integer
UINT_32_T An unsigned 32-bit integer
VB_T A structure describing a variable binding
VBL_T A structure describing a list of variable bindings
typedef struct OBJ_ID_S
{
int num_components;
OIDC_T *component_list;
} OBJ_ID_T;