VxWorks Reference Manual : Libraries
snmpAuxLib - utility routines for object identifiers
ip_to_rlist( ) - convert an IP address to an array of OID components
oidcmp( ) - compare two object identifiers
oidcmp2( ) - compare two object identifiers
oid_to_ip( ) - convert an object identifier to an IP address
This module defines the routines used to manipulate object identifiers.
snmpdefs.h
ip_to_rlist( ) - convert an IP address to an array of OID components
int ip_to_rlist ( UINT_32_T ip_address, /* ip address */ OIDC_T * object_id /* pointer to object identifier */ )
This routine uses an IP address to fill an array of values (of type long) with the byte components of the IP address. The return value is the number of components filled, always 4.
4, always.
oidcmp( ) - compare two object identifiers
int oidcmp ( int length_1, /* length of first object identifier */ OIDC_T * oid_1, /* pointer to first object identifier */ int length_2, /* length of second object identifier */ OIDC_T * oid_2 /* pointer to second object identifier */ )
This routine compares two object-identifiers. It returns 1 if the OIDs are the same and 0 if not. The two object idenifiers may be of different lengths.
1 if the OIDs are equal, otherwise 0.
oidcmp2( ) - compare two object identifiers
int oidcmp2 ( int length_1, /* length of first object identifier */ OIDC_T * oid_1, /* pointer to first object identifier */ int length_2, /* length of second object identifier */ OIDC_T * oid_2 /* pointer to second object identifier */ )
This routine compares two object identifiers.
-1 if oid_1 is less than oid_2, 0 if oid_1 is equal to oid_2, and 1 if oid_1 is greater than oid_2.
oid_to_ip( ) - convert an object identifier to an IP address
int oid_to_ip ( int count, /* length of ip address components */ OIDC_T * object_id, /* pointer to ip address components */ UINT_32_T * addr /* pointer to ip address */ )
This routine converts an IP address encoded in the instance section of an object identifier to an IP address. The parameter count contains the number of octets that corresponds to the IP address in the object identifier. This is usually 4, but may be less, in which case this routine fills the rest of the IP-address portion with zeroes.
The routine puts the IP address in addr and returns 0 if successful. If the instance contains a component that is larger than is legal for an IP address (greater than 255), the routine returns 1.
0 on success, otherwise 1.