VxWorks Reference Manual : Libraries
m2RipLib - VxWorks interface routines to RIP for SNMP Agent
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
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.
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. */
rip/m2RipLib.h rip/defs.h
m2RipInit( ) - initialize the RIP MIB support
STATUS m2RipInit (void)
This routine sets up the RIP MIB and should be called before any other m2RipLib routine.
OK, always.
m2RipDelete( ) - delete the RIP MIB support
STATUS m2RipDelete (void)
This routine should be called after all m2RipLib calls are completed.
OK, always.
m2RipGlobalCountersGet( ) - get MIB-II RIP-group global counters
STATUS m2RipGlobalCountersGet ( M2_RIP2_GLOBAL_GROUP* pRipGlobal )
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.
OK or ERROR.
S_m2Lib_INVALID_PARAMETER
m2RipIfStatEntryGet( ) - get MIB-II RIP-group interface entry
STATUS m2RipIfStatEntryGet ( int search, M2_RIP2_IFSTAT_ENTRY* pRipIfStat )
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.
OK, or ERROR if either pRipIfStat is invalid or an exact match failed.
S_m2Lib_INVALID_PARAMETER
S_m2Lib_ENTRY_NOT_FOUND
m2RipIfConfEntryGet( ) - get MIB-II RIP-group interface entry
STATUS m2RipIfConfEntryGet ( int search, M2_RIP2_IFCONF_ENTRY* pRipIfConf )
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.
OK, or ERROR if pRipIfConf was invalid or the interface was not found.
S_m2Lib_INVALID_PARAMETER
S_m2Lib_ENTRY_NOT_FOUND
m2RipIfConfEntrySet( ) - set MIB-II RIP-group interface entry
STATUS m2RipIfConfEntrySet ( unsigned int varToSet, M2_RIP2_IFCONF_ENTRY* pRipIfConf )
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.
OK, or ERROR if pRipIfConf is invalid or the interface cannot be found.
S_m2Lib_INVALID_PARAMETER
S_m2Lib_ENTRY_NOT_FOUND