VxWorks Reference Manual : Libraries

snmpAuxLib

NAME

snmpAuxLib - utility routines for object identifiers

ROUTINES

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

DESCRIPTION

This module defines the routines used to manipulate object identifiers.

INCLUDE FILES

snmpdefs.h

SEE ALSO

snmpAuxLib


Libraries : Routines

ip_to_rlist( )

NAME

ip_to_rlist( ) - convert an IP address to an array of OID components

SYNOPSIS

int ip_to_rlist
    (
    UINT_32_T ip_address, /* ip address */
    OIDC_T *  object_id   /* pointer to object identifier */
    )

DESCRIPTION

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.

RETURNS

4, always.

SEE ALSO

snmpAuxLib


Libraries : Routines

oidcmp( )

NAME

oidcmp( ) - compare two object identifiers

SYNOPSIS

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 */
    )

DESCRIPTION

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.

RETURNS

1 if the OIDs are equal, otherwise 0.

SEE ALSO

snmpAuxLib


Libraries : Routines

oidcmp2( )

NAME

oidcmp2( ) - compare two object identifiers

SYNOPSIS

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 */
    )

DESCRIPTION

This routine compares two object identifiers.

RETURNS

-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.

SEE ALSO

snmpAuxLib


Libraries : Routines

oid_to_ip( )

NAME

oid_to_ip( ) - convert an object identifier to an IP address

SYNOPSIS

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 */
    )

DESCRIPTION

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.

RETURNS

0 on success, otherwise 1.

SEE ALSO

snmpAuxLib