SNMP Manager Programmer's Guide
Reference Summary
SNMP Manager Programmer’s Guide–134249
9-5
Common Utility Functions
hexcheck()
The hexcheck() function accepts a pointer to an ASCII or hexadecimal string value and
returns the number of bytes in the string.
oid_to_namerec()
The oid_to_namerec() function accepts a pointer to a structure of type OBJ_ID_T
describing a MIB-II object OID and returns the name and type of the object to a
namerec structure, using an internal mapping table. If the OID is not for a MIB-II
object, this function returns 0.
string2oid() rtutils.h Converts the OID of a MIB object
described in the read_mib() input file
to its corresponding name.
SNMPWALK
str_to_trap() print.h Converts the string value of the
generic trap field in a trap PDU to the
corresponding integer value.
SNMPTRAP
str_to_type() print.h Converts a string depicting an SNMP
type into its corresponding Manager
Services representation.
SNMPSET
SNMPTRAP
#include "printh"
count = hexcheck(string-value);
int
hexcheck(char *string-value);
count
The number of bytes in the string. In the case of ASCII strings, for which
you use a double colon (::) to encode a colon, only one of the colons is
counted. In the case of hexadecimal strings, for which you use a single
colon to separate hexadecimal characters (for example, 65:69), each pair
is counted as one byte.
string-
value
A pointer to an all-ASCII or all-hexadecimal string value. For ASCII
strings, one of the colons in any double-colon pair is eliminated. For
hexadecimal strings, their ASCII equivalents are written at the start of the
character buffer.
#include "printh"
p = oid_to_namerec(oid);
struct namerec* oid_to_namerec (OBJ_ID_T *oid);
Function
Header
File Description of Function
Sample
Managers Using
Function