SNMP Manager Programmer's Guide
Reference Summary
SNMP Manager Programmer’s Guide–134249
9-6
Common Utility Functions
oidstr_to_oid()
The oidstr_to_oid() function accepts an OID string and describes it using the OBJ_ID_T
type. If the OID string is a MIB-II object name, an internal mapping table is used to
find its OID.
print_pkt()
The print_pkt() function prints the contents of an unencoded-packet buffer of type
SNMP_PKT_T.
p
A pointer to the namerec structure, defined in print.h:
struc namerec {
OBJ_ID_T oid;
char *nmstr;
int type;
Type contains one of the values described under str_to_type().
oid
A pointer to a structure of type OBJ_ID_T.
#include "printh"
rcode = oidstr_to_oid(oidstr, oid);
int
oidstr_to_oid(char *oidstr, OBJ_ID_T *oid);
rcode
An integer describing the outcome of the call. A value of 0 indicates
success. A value of -1 indicates failure.
oidstr
A pointer to an array containing the OID string in the form of a MIB-II
object name and instance (for example, sysContact.0) or in dotted notation
(for example, 1.2.3.0).
oid
A pointer to a structure of type OBJ_ID_T.
#include "printh"
print_pkt(packet);
void
print_pkt(SNMP_PKT_T *);
packet
A pointer to an unencoded-packet buffer of type SNMP_PKT_T.