VxWorks Reference Manual : Libraries

m2RipLib

NAME

m2RipLib - VxWorks interface routines to RIP for SNMP Agent

ROUTINES

m2RipInit( ) - initialize the RIP MIB support
m2RipDelete( ) - delete the RIP MIB support
m2RipGlobalCountersGet( ) - get MIB-II RIP-group global counters
m2RipIfStatEntryGet( ) - get MIB-II RIP-group interface entry
m2RipIfConfEntryGet( ) - get MIB-II RIP-group interface entry
m2RipIfConfEntrySet( ) - set MIB-II RIP-group interface entry

DESCRIPTION

This library provides routines to initialize the group, access the group global variables, read the table of network interfaces that RIP knows about, and change the state of such an interface. For a broader description of MIB-II services, see the manual entry for m2Lib.

USING THIS LIBRARY

This library can be initialized and deleted by calling m2RipInit( ) and m2RipDelete( ) respectively, if only the RIP group's services are needed. If full MIB-II support is used, this group and all other groups can be initialized and deleted by calling m2Init( ) and m2Delete( ).

The group global variables are accessed by calling m2RipGlobalCountersGet( ) as follows:

    M2_RIP2_GLOBAL_GROUP   ripGlobal;

    if (m2RipGlobalCountersGet (&ripGlobal) == OK)
        /* values in ripGlobal are valid */
To retrieve the RIP group statistics for a particular interface you call the m2RipIfStatEntryGet( ) routine a pointer to an M2_RIP2_IFSTAT_ENTRY structure that contains the address of the interface you are searching for. For example:
    M2_RIP2_IFSTAT_ENTRY ripIfStat;
    
        ripIfStat.rip2IfStatAddress = inet_addr("90.0.0.3");
        if (m2RipIfStatEntryGet(M2_EXACT_VALUE, &ripIfStat) == OK)
        /* values in ripIfState are valid */

To retrieve the configuration statistics for a particular interface the m2RipIfConfEntryGet( ) routine must be called with an IP address encoded in an M2_RIP2_IFSTAT_ENTRY structure which is passed as the second argument. For example:
    M2_RIP2_IFCONF_ENTRY ripIfConf;
    
        ripIfConf.rip2IfConfAddress = inet_addr("90.0.0.3");
        if (m2RipIfConfEntryGet(M2_EXACT_VALUE, &ripIfConf) == OK)
        /* values in ripIfConf are valid */
To set the values of for an interface the m2RipIfConfEntrySet( ) routine must be called with an IP address in dot notation encoded into an M2_RIP2_IFSTAT_ENTRY structure, which is passed as the second argument. For example:
    M2_RIP2_IFCONF_ENTRY ripIfConf;

        ripIfConf.rip2IfConfAddress = inet_addr("90.0.0.3");

        /* Set the authorization type. */
        ripIfConf.rip2IfConfAuthType = M2_rip2IfConfAuthType_simplePassword;
        bzero(ripIfConf.rip2IfConfAuthKey, 16);
        bcopy("Simple Password ", ripIfConf.rip2IfConfAuthKey, 16);

        /* We only accept version 1 packets. */
        ripIfConf.rip2IfConfSend = M2_rip2IfConfSend_ripVersion1;

        /* We only send version 1 packets. */
        ripIfConf.rip2IfConfReceive = M2_rip2IfConfReceive_rip1;

        /* Default routes have a metric of 2 */
        ripIfConf.rip2IfConfDefaultMetric = 2;

        /* If the interface is invalid it is turned off, we make it valid. */
        ripIfConf.rip2IfConfStatus = M2_rip2IfConfStatus_valid;
        
        if (m2RipIfConfEntrySet(varsToSet, &ripIfConf) == OK)
        /* Call succeded. */

INCLUDE FILES

rip/m2RipLib.h rip/defs.h

SEE ALSO

m2RipLib, ripLib


Libraries : Routines

m2RipInit( )

NAME

m2RipInit( ) - initialize the RIP MIB support

SYNOPSIS


STATUS m2RipInit (void)

DESCRIPTION

This routine sets up the RIP MIB and should be called before any other m2RipLib routine.

RETURNS

OK, always.

SEE ALSO

m2RipLib


Libraries : Routines

m2RipDelete( )

NAME

m2RipDelete( ) - delete the RIP MIB support

SYNOPSIS


STATUS m2RipDelete (void)

DESCRIPTION

This routine should be called after all m2RipLib calls are completed.

RETURNS

OK, always.

SEE ALSO

m2RipLib


Libraries : Routines

m2RipGlobalCountersGet( )

NAME

m2RipGlobalCountersGet( ) - get MIB-II RIP-group global counters

SYNOPSIS

STATUS m2RipGlobalCountersGet
    (
    M2_RIP2_GLOBAL_GROUP* pRipGlobal
    )

DESCRIPTION

This routine fills in an M2_RIP2_GLOBAL_GROUP structure pointed to by pRipGlobal with the values of the MIB-II RIP-group global counters.

RETURNS

OK or ERROR.

ERRNO

 S_m2Lib_INVALID_PARAMETER

SEE ALSO

m2RipLib, m2RipInit( )


Libraries : Routines

m2RipIfStatEntryGet( )

NAME

m2RipIfStatEntryGet( ) - get MIB-II RIP-group interface entry

SYNOPSIS

STATUS m2RipIfStatEntryGet
    (
    int                   search,
    M2_RIP2_IFSTAT_ENTRY* pRipIfStat
    )

DESCRIPTION

This routine retrieves the interface statistics for the interface serving the subnet of the IP address contained in the M2_RIP2_IFSTAT_ENTRY structure. pRipIfStat is a pointer to an M2_RIP2_IFSTAT_ENTRY structure which the routine will fill in upon successful completion.

This routine either returns an exact match if search is M2_EXACT_VALUE, or the next value greater than or equal to the value supplied if the search is M2_NEXT_VALUE.

RETURNS

OK, or ERROR if either pRipIfStat is invalid or an exact match failed.

ERRNO

 S_m2Lib_INVALID_PARAMETER
 S_m2Lib_ENTRY_NOT_FOUND

SEE ALSO

m2RipLib, m2RipInit( )


Libraries : Routines

m2RipIfConfEntryGet( )

NAME

m2RipIfConfEntryGet( ) - get MIB-II RIP-group interface entry

SYNOPSIS

STATUS m2RipIfConfEntryGet
    (
    int                   search,
    M2_RIP2_IFCONF_ENTRY* pRipIfConf
    )

DESCRIPTION

This routine retrieves the interface configuration for the interface serving the subnet of the IP address contained in the M2_RIP2_IFCONF_ENTRY structure passed to it. pRipIfConf is a pointer to an M2_RIP2_IFCONF_ENTRY structure which the routine will fill in upon successful completion.

This routine either returns an exact match if search is M2_EXACT_VALUE, or the next value greater than or equal to the value supplied if the search is M2_NEXT_VALUE.

RETURNS

OK, or ERROR if pRipIfConf was invalid or the interface was not found.

ERRNO

 S_m2Lib_INVALID_PARAMETER
 S_m2Lib_ENTRY_NOT_FOUND

SEE ALSO

m2RipLib, m2RipInit( )


Libraries : Routines

m2RipIfConfEntrySet( )

NAME

m2RipIfConfEntrySet( ) - set MIB-II RIP-group interface entry

SYNOPSIS

STATUS m2RipIfConfEntrySet
    (
    unsigned int          varToSet,
    M2_RIP2_IFCONF_ENTRY* pRipIfConf
    )

DESCRIPTION

This routine sets the interface configuration for the interface serving the subnet of the IP address contained in the M2_RIP2_IFCONF_ENTRY structure.

pRipIfConf is a pointer to an M2_RIP2_IFCONF_ENTRY structure which the routine places into the system based on the varToSet value.

RETURNS

OK, or ERROR if pRipIfConf is invalid or the interface cannot be found.

ERRNO

 S_m2Lib_INVALID_PARAMETER
 S_m2Lib_ENTRY_NOT_FOUND

SEE ALSO

m2RipLib, m2RipInit( )