VxWorks API Reference : OS Libraries

ripLib

NAME

ripLib - Routing Information Protocol (RIP) v1 and v2 library

ROUTINES

ripLibInit( ) - initialize the RIP routing library
ripAddrsXtract( ) - extract socket address pointers from the route message
ripRouteShow( ) - display the internal routing table maintained by RIP
ripIfShow( ) - display the internal interface table maintained by RIP
ripAuthHookAdd( ) - add an authentication hook to a RIP interface
ripAuthHookDelete( ) - remove an authentication hook from a RIP interface
ripAuthHook( ) - sample authentication hook
ripLeakHookAdd( ) - add a hook to bypass the RIP and kernel routing tables
ripLeakHookDelete( ) - remove a table bypass hook from a RIP interface
ripSendHookAdd( ) - add an update filter to a RIP interface
ripSendHookDelete( ) - remove an update filter from a RIP interface
ripRouteHookAdd( ) - add a hook to install static and non-RIP routes into RIP
ripRouteHookDelete( ) - remove the route hook
ripIfSearch( ) - add new interfaces to the internal list
ripIfReset( ) - alter the RIP configuration after an interface changes
ripFilterEnable( ) - activate strict border gateway filtering
ripFilterDisable( ) - prevent strict border gateway filtering
ripShutdown( ) - terminate all RIP processing
ripDebugLevelSet( ) - specify amount of debugging output
ripAuthKeyShow( ) - show current authentication configuration
ripAuthKeyAdd( ) - add a new RIP authentication key
ripAuthKeyDelete( ) - delete an existing RIP authentication key
ripAuthKeyFind( ) - find a RIP authentication key
ripAuthKeyFindFirst( ) - find a RIP authentication key
ripAuthKeyInMD5( ) - authenticate an incoming RIP-2 message using MD5
ripAuthKeyOut1MD5( ) - start MD5 authentication of an outgoing RIP-2 message
ripAuthKeyOut2MD5( ) - authenticate an outgoing RIP-2 message using MD5
ripIfExcludeListAdd( ) - Add an interface to the RIP exclusion list
ripIfExcludeListDelete( ) - Delete an interface from RIP exclusion list
ripIfExcludeListShow( ) - Show the RIP interface exclusion list
ripIfAddrReset( ) - alter the RIP configuration after an interface changes
ripIfAddrExcludeListAdd( ) - add an interface to the RIP exclusion list
ripIfAddrExcludeListDelete( ) - delete an interface from RIP exclusion list

DESCRIPTION

This library implements versions 1 and 2 of the Routing Information Protocol (RIP). The protocol is intended to operate as an interior gateway protocol within a relatively small network with a longest path of 15 hops.

HIGH-LEVEL INTERFACE

The ripLibInit( ) routine links this library into the VxWorks image and begins a RIP session. This happens automatically if INCLUDE_RIP is defined at the time the image is built. Once started, RIP will maintain the network routing table until deactivated by a call to the ripShutdown( ) routine, which will remove all route entries and disable the RIP library routines. All RIP requests and responses are handled as defined in the RFC specifications. RFC 1058 defines the basic protocol operation and RFC 1723 details the extensions that constitute version 2.

When acting as a supplier, outgoing route updates are filtered using simple split horizon. Split horizon with poisoned reverse is not currently available. Additional route entries may be excluded from the periodic update with the ripSendHookAdd( ) routine.

If a RIP session is terminated, the networking subsystem may not function correctly until RIP is restarted with a new call to ripLibInit( ) unless routing information is provided by some other method.

CONFIGURATION INTERFACE

By default, a RIP session only uses the network interfaces created before it started. The ripIfSearch( ) routine allows RIP to recognize any interfaces added to the system after that point. If the address or netmask of an existing interface is changed during a RIP session, the ripIfReset( ) routine must be used to update the RIP configuration appropriately. The current RIP implementation also automatically performs the border gateway filtering required by the RFC specification. Those restrictions provide correct operation in a mixed environment of RIP-1 and RIP-2 routers. The ripFilterDisable( ) routine will remove those limitations, and can produce more efficient routing for some topologies. However, you must not use that routine if any version 1 routers are present. The ripFilterEnable( ) routine will restore the default behavior.

AUTHENTICATION INTERFACE

By default, authentication is disabled, but may be activated by an SNMP agent on an interface-specific basis. While authentication is disabled, any RIP-2 messages containing authentication entries are discarded. When enabled, all RIP-2 messages without authentication entries are automatically rejected. To fully support authentication, an authentication routine should be specified with the ripAuthHookAdd( ) routine. The specified function will be called to screen every RIP-1 message and all unverified RIP-2 messages containing authentication entries. It may be removed with the ripAuthHookDelete( ) routine. All RIP-1 and unverified RIP-2 messages will be discarded while authentication is enabled unless a hook is present.

OPTIONAL INTERFACE

The ripLeakHookAdd( ) routine allows the use of an alternative routing protocol that uses RIP as a transport mechanism. The specified function can prevent the RIP session from creating any table entries from the received messages. The ripLeakHookDelete( ) routine will restore the default operation.

DEBUGGING INTERFACE

As required by the RFC specification, the obsolete traceon and traceoff messages are not supported by this implementation. The ripRouteShow( ) routine will display the contents of the internal RIP routing table. Routines such as mRouteShow( ) to display the corresponding kernel routing table will also be available if INCLUDE_NET_SHOW is defined when the image is built. If additional information is required, the ripDebugLevelSet( ) routine will enable predefined debugging messages that will be sent to the standard output.

INCLUDE FILES

ripLib.h

SEE ALSO

RFC 1058, RFC 1723


OS Libraries : Routines

ripLibInit( )

NAME

ripLibInit( ) - initialize the RIP routing library

SYNOPSIS

STATUS ripLibInit
    (
    BOOL supplier,            /* operate in silent mode? */
    BOOL gateway,             /* act as gateway to the Internet? */
    BOOL multicast,           /* use multicast or broadcast addresses? */
    int  version,             /* 1 or 2: selects format of outgoing messages */
    int  timerRate,           /* update frequency for internal routing table */
    int  supplyInterval,      /* update frequency for neighboring routers */
    int  expire,              /* maximum interval for renewing learned routes */
    int  garbage,             /* elapsed time before deleting stale route */
    int  authType             /* default authentication type to use */
    )

DESCRIPTION

This routine creates and initializes the global data structures used by the RIP routing library and starts a RIP session to maintain routing tables for a host. You must call ripLibInit( ) before you can use any other ripLib routines. A VxWorks image automatically invokes ripLibInit( ) if INCLUDE_RIP was defined when the image was built.

The resulting RIP session will monitor all network interfaces that are currently available for messages from other RIP routers. If the supplier parameter is true, it will also respond to specific requests from other routers and transmit route updates over every known interface at the interval specified by supplyInterval.

Specifying a gateway setting of true establishes this router as a gateway to the wider Internet, capable of routing packets anywhere within the local networks. The final multicast flag indicates whether the RIP messages are sent to the pre-defined multicast address of 224.0.0.9 (which requires a version setting of 2) or to the broadcast address of the interfaces.

The version parameter determines the format used for outgoing RIP messages, and also sets the initial settings of the MIB-II compatibility switches in combination with the multicast flag. A version of 1 will restrict all incoming traffic to that older message type. A version of 2 will set the receive switch to accept either type unless multicast is true, which limits reception to version 2 messages only. SNMP agents may alter those settings on a per-interface basis once startup is complete.

The remaining parameters set various system timers used to maintain the routing table. All of the values are expressed in seconds, and must be greater than or equal to 1. The timerRate determines how often the routing table is examined for changes and expired routes. The supplyInterval must be an exact multiple of that value. The expire parameter specifies the maximum time between updates before a route is invalidated and removed from the kernel table. Expired routes are then deleted from the internal RIP routing table if no update has been received within the time set by the garbage parameter.

The following configuration parameters determine the initial values for all these settings. The default timer values match the settings indicated in the RFC specification.

Parameter Name Default Value Configuration Parameter

supplier 0 (FALSE) RIP_SUPPLIER
gateway 0 (FALSE) RIP_GATEWAY
multicast 0 (FALSE) RIP_MULTICAST
version 1 RIP_VERSION
timerRate 1 RIP_TIMER_RATE
supplyInterval 30 RIP_SUPPLY_INTERVAL
expire 180 RIP_EXPIRE_TIME
garbage 300 RIP_GARBAGE_TIME
authType 1 RIP_AUTH_TYPE

RETURNS

OK; or ERROR, if configuration fails.

SEE ALSO

ripLib


OS Libraries : Routines

ripAddrsXtract( )

NAME

ripAddrsXtract( ) - extract socket address pointers from the route message

SYNOPSIS

void ripAddrsXtract
    (
    ROUTE_INFO *        pRtInfo,    /* Route information message */
    struct sockaddr * * pDstAddr,   /* Where to store the Destination */
                                    /* addr pointer */ 
    struct sockaddr * * pNetmask,   /* Where to store the netmask pointer*/
    struct sockaddr * * pGateway,   /* Where to store the Gateway addr */
                                    /* pointer */ 
    struct sockaddr * * pOldGateway /* Where to store the Old gateway */
                                    /* addr (if any) pointer */ 
    )

DESCRIPTION

This routine extracts the socket addresses from the route message in pRtInfo and uses the other parameters to return pointers to the extracted messages.

pRtInfo
Passes in a pointer to a route information message.
pDstAddr
Returns a pointer to the destination address.
pNetmask
Returns a pointer to the netmask.
pGateway
Returns a pointer to the gateway address.
pOldGateway
Returns a pointer to the OLD gateway address if it exists.
If the route message doesn't specify an address, the corresponding address pointer is set to NULL

RETURNS

N/A

ERRNO

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripRouteShow( )

NAME

ripRouteShow( ) - display the internal routing table maintained by RIP

SYNOPSIS

void ripRouteShow ()

DESCRIPTION

This routine prints every entry in the local RIP routing table. The flags displayed below the destination, gateway, and netmask addresses indicate the current route status. Entries with the RTS_INTERFACE flag indicate locally generated routes to directly connected networks. If RTS_SUBNET is set for an entry, it is subject to border gateway filtering (if enabled). When RTS_INTERNAL is also present, the corresponding entry is an "artificial" route created to supply distant networks with legitimate destinations if border filtering excludes the actual entry. Those entries are not copied to the kernel routing table. The RTS_CHANGED flag marks entries added or modified in the last timer interval that will be included in a triggered update. The RTS_OTHER flag is set for routes learnt from other sources. The RTS_PRIMARY flag (set only if the RTS_OTHER flag is also set) indicates that the route is a primary route, visible to the IP forwarding process. The DOWN flag indicates that the interface through which the gateway is reachable is down.

SEE ALSO

ripLib


OS Libraries : Routines

ripIfShow( )

NAME

ripIfShow( ) - display the internal interface table maintained by RIP

SYNOPSIS

void ripIfShow (void)

DESCRIPTION

This routine prints every entry in the local RIP interface table. The interface name, interface index, the UP/DOWN status and the interface address and netmask are displayed.

RETURNS

N/A

ERRNO

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripAuthHookAdd( )

NAME

ripAuthHookAdd( ) - add an authentication hook to a RIP interface

SYNOPSIS

STATUS ripAuthHookAdd
    (
    char*   pIpAddr,          /* IP address in dotted decimal notation */
    FUNCPTR pAuthHook         /* routine to handle message authentication */
    )

DESCRIPTION

This routine installs a hook routine to validate incoming RIP messages for a registered interface given by pIpAddr. (Interfaces created or changed after a RIP session has started may be installed/updated with the ripIfSearch( ) and ripIfReset( ) routines). The hook is only called if an SNMP agent enables authentication for the corresponding interface. It uses the following prototype:

    STATUS ripAuthHookRtn (char *pKey, RIP_PKT *pRip);
The first argument contains the authentication key for the message stored in the rip2IfConfAuthKey MIB variable and the second argument uses the RIP_PKT structure (defined in rip/ripLib.h) to access the message body. The routine must return OK if the message is acceptable, or ERROR otherwise. All RIP-2 messages sent to that routine already contain an authentication entry, but have not been verified. (Any unauthenticated RIP-2 messages have already been discarded as required by the RFC specification). RIP-1 messages may be accepted or rejected. RIP-2 messages requesting simple password authentication that match the key are accepted automatically before the hook is called. The remaining RIP-2 messages either did not match that key or are using an unknown authentication type. If any messages are rejected, the MIB-II counters are updated appropriately outside of the hook routine.

The current RIP implementation contains a sample authentication hook that you may add as follows:

    if (ripAuthHookAdd ("90.0.0.1", ripAuthHook) == ERROR)
        logMsg ("Unable to add authorization hook.\n", 0, 0, 0, 0, 0, 0);
The sample routine supports only simple password authentication against the key included in the MIB variable. Since all such messages have already been accepted, all RIP-2 messages received by the routine are discarded. All RIP-1 messages are also discarded, so the hook actually has no effect. The body of that routine is:

STATUS ripAuthHook
   (
   char *     pKey,   /* rip2IfConfAuthKey entry from MIB-II family */
   RIP_PKT *  pRip    /* received RIP message */
   )
   {
   if (pRip->rip_vers == 1)
       {
       /* 
        * The RFC specification recommends, but does not require, rejecting
        @ version 1 packets when authentication is enabled.
        */

       return (ERROR);
       }

   /*
    @ The authentication type field in the RIP message corresponds to
    @ the first two bytes of the sa_data field overlayed on that
    @ message by the sockaddr structure contained within the RIP_PKT 
    @ structure (see rip/ripLib.h).
    */

   if ( (pRip->rip_nets[0].rip_dst.sa_data[0] != 0) ||
       (pRip->rip_nets[0].rip_dst.sa_data[1] !=
       M2_rip2IfConfAuthType_simplePassword))
       {
       /* Unrecognized authentication type. */

       return (ERROR);
       }

   /* 
    * Discard version 2 packets requesting simple password authentication
    @ which did not match the MIB variable. 
    */

   return (ERROR);
   }
A comparison against a different key could be performed as follows:

 bzero ( (char *)&key, AUTHKEYLEN);    /* AUTHKEYLEN from rip/m2RipLib.h */

  /*
   @ The start of the authorization key corresponds to the third byte
   @ of the sa_data field in the sockaddr structure overlayed on the
   @ body of the RIP message by the RIP_PKT structure. It continues
   @ for the final 14 bytes of that structure and the first two bytes
   @ of the following rip_metric field.
   */

 bcopy ( (char *)(pRip->rip_nets[0].rip_dst.sa_data + 2),
        (char *)&key, AUTHKEYLEN);

 if (bcmp ( (char *)key, privateKey, AUTHKEYLEN) != 0)
     {
     /* Key does not match: reject message. */

     return (ERROR);
     }
 return (OK);
The ripAuthHookDelete( ) routine will remove the installed function. If authentication is still enabled for the interface, all incoming messages that do not use simple password authentication will be rejected until a routine is provided.

RETURNS

OK, if hook added; or ERROR otherwise.

ERRNO

 S_m2Lib_INVALID_PARAMETER
 S_m2Lib_ENTRY_NOT_FOUND

SEE ALSO

ripLib


OS Libraries : Routines

ripAuthHookDelete( )

NAME

ripAuthHookDelete( ) - remove an authentication hook from a RIP interface

SYNOPSIS

STATUS ripAuthHookDelete
    (
    char* pIpAddr             /* IP address in dotted decimal notation */
    )

DESCRIPTION

This routine removes an assigned authentication hook from a registered interface indicated by pIpAddr. (Interfaces created or changed after a RIP session has started may be installed/updated with the ripIfSearch( ) and ripIfReset( ) routines). If authentication is still enabled for the interface, RIP-2 messages using simple password authentication will be accepted if they match the key in the MIB variable, but all other incoming messages will be rejected until a routine is provided.

RETURNS

OK; or ERROR, if the interface could not be found.

ERRNO

 S_m2Lib_INVALID_PARAMETER
 S_m2Lib_ENTRY_NOT_FOUND

SEE ALSO

ripLib


OS Libraries : Routines

ripAuthHook( )

NAME

ripAuthHook( ) - sample authentication hook

SYNOPSIS

STATUS ripAuthHook
    (
    char *    pKey,           /* rip2IfConfAuthKey entry from MIB-II family */
    RIP_PKT * pRip            /* received RIP message */
    )

DESCRIPTION

This hook demonstrates one possible authentication mechanism. It rejects all RIP-2 messages that used simple password authentication since they did not match the key contained in the MIB variable. All other RIP-2 messages are also rejected since no other authentication type is supported and all RIP-1 messages are also rejected, as recommended by the RFC specification. This behavior is the same as if no hook were installed.

RETURNS

OK, if message is acceptable; or ERROR otherwise.

SEE ALSO

ripLib


OS Libraries : Routines

ripLeakHookAdd( )

NAME

ripLeakHookAdd( ) - add a hook to bypass the RIP and kernel routing tables

SYNOPSIS

STATUS ripLeakHookAdd
    (
    char *  pIpAddr,          /* IP address in dotted decimal notation */
    FUNCPTR pLeakHook         /* function pointer to hook */
    )

DESCRIPTION

This routine installs a hook routine to support alternative routing protocols for the registered interface given by pIpAddr. (Interfaces created or changed after a RIP session has started may be installed/updated with the ripIfSearch( ) and ripIfReset( ) routines).

The hook uses the following interface:

    STATUS ripLeakHookRtn (long dest, long gateway, long netmask)
The RIP session will not add the given route to any tables if the hook routine returns OK, but will create a route entry otherwise.

The ripLeakHookDelete( ) will allow the RIP session to add new routes unconditionally.

RETURNS

OK; or ERROR, if the interface could not be found.

ERRNO

 S_m2Lib_INVALID_PARAMETER
 S_m2Lib_ENTRY_NOT_FOUND

SEE ALSO

ripLib


OS Libraries : Routines

ripLeakHookDelete( )

NAME

ripLeakHookDelete( ) - remove a table bypass hook from a RIP interface

SYNOPSIS

STATUS ripLeakHookDelete
    (
    char* pIpAddr             /* IP address in dotted decimal notation */
    )

DESCRIPTION

This routine removes the assigned bypass hook from a registered interface indicated by pIpAddr. (Interfaces created or changed after a RIP session has started may be installed/updated with the ripIfSearch( ) and ripIfReset( ) routines). The RIP session will return to the default behavior and add entries to the internal RIP table and kernel routing table unconditionally.

RETURNS

OK; or ERROR, if the interface could not be found.

ERRNO

 S_m2Lib_INVALID_PARAMETER
 S_m2Lib_ENTRY_NOT_FOUND

SEE ALSO

ripLib


OS Libraries : Routines

ripSendHookAdd( )

NAME

ripSendHookAdd( ) - add an update filter to a RIP interface

SYNOPSIS

STATUS ripSendHookAdd
    (
    char* pIpAddr,            /* IP address in dotted decimal notation */
    BOOL (* ripSendHook) (struct rt_entry* pRt)
                              /* Routine to use. */
    )

DESCRIPTION

This routine installs a hook routine to screen individual route entries for inclusion in a periodic update. The routine is installed for the registered interface given by pIpAddr. (Interfaces created or changed after a RIP session has started may be installed/updated with the ripIfSearch( ) and ripIfReset( ) routines).

The hook uses the following prototype:

    BOOL ripSendHookRtn (struct rt_entry* pRt);
If the hook returns FALSE, the route is not included in the update. Otherwise, it is included if it meets the other restrictions, such as simple split horizon and border gateway filtering. The ripSendHookDelete( ) routine removes this additional filter from the output processing.

RETURNS

OK; or ERROR, if the interface could not be found.

ERRNO

 S_m2Lib_INVALID_PARAMETER
 S_m2Lib_ENTRY_NOT_FOUND

SEE ALSO

ripLib


OS Libraries : Routines

ripSendHookDelete( )

NAME

ripSendHookDelete( ) - remove an update filter from a RIP interface

SYNOPSIS

STATUS ripSendHookDelete
    (
    char* pIpAddr             /* IP address in dotted decimal notation */
    )

DESCRIPTION

This routine removes the hook routine that allowed additional screening of route entries in periodic updates from the registered interface indicated by pIpAddr. (Interfaces created or changed after a RIP session has started may be installed/updated with the ripIfSearch( ) and ripIfReset( ) routines). The RIP session will return to the default behavior and include any entries that meet the other restrictions (such as simple split horizon).

RETURNS

OK; or ERROR, if the interface could not be found.

ERRNO

 S_m2Lib_INVALID_PARAMETER
 S_m2Lib_ENTRY_NOT_FOUND

SEE ALSO

ripLib


OS Libraries : Routines

ripRouteHookAdd( )

NAME

ripRouteHookAdd( ) - add a hook to install static and non-RIP routes into RIP

SYNOPSIS

STATUS ripRouteHookAdd
    (
    FUNCPTR pRouteHook        /* function pointer to hook */
    )

DESCRIPTION

This routine installs a hook routine that you can use to give RIP the ability to respond to route-add events generated by non-RIP agents. By design, RIP is not interested in the routes generated by non-RIP agents. If you do not install a route hook function, RIP continues this default behavior. However, if you want RIP to add these non-RIP routes to its internal routing database and even propagate routes added by other agents, you must use ripRouteHookAdd( ) to register a function of the form:

STATUS YourRipRouteHookRtn 
    ( 
    struct ROUTE_INFO * pRouteInfo, 
    int  protoId, 
    BOOL primaryRoute,
    int  flags 
    ) 
RIP invokes this function in response to the following events:

      1.  A non-RIP non-system route was added to the routing table. 
      2.  A route change message arrived. 
      3.  An ICMP redirect message arrived. 

The returned function value of the route hook routine tells rip how to respond to the event. In the first case, the returned function value tells RIP whether to add or ignore the new route. In the second case, the returned function tells RIP whether to delete the specified route or change its metric. In the third case, the event is of no direct importance for RIP, so RIP ignores the returned value of the route hook function.

pRouteInfo
This parameter passes in a pointer to a route information structure that stores the routing message. You should not access the contents of this structure directly. Instead, use ripAddrsXtract( ) to extract the following information:

      - destination address
      - netmask
      - gateway address
      - old gateway address (if available)

protoId
This parameter passes in the ID of the protocol that generated the event. Valid protocol IDs are defined in m2Lib.h as follows:

      M2_ipRouteProto_other (static routes) 
      M2_ipRouteProto_local 
      M2_ipRouteProto_netmgmt
      M2_ipRouteProto_icmp
      M2_ipRouteProto_egp
      M2_ipRouteProto_ggp
      M2_ipRouteProto_hello
      M2_ipRouteProto_rip
      M2_ipRouteProto_is_is
      M2_ipRouteProto_es_is
      M2_ipRouteProto_ciscoIgrp
      M2_ipRouteProto_bbnSpfIgp
      M2_ipRouteProto_ospf
      M2_ipRouteProto_bgp

primaryRoute
This parameter passes in a boolean value that indicates whether the route is a primary route. TRUE indicates a primary route. FALSE indicates a duplicate route.
flags
This parameter passes in a value that indicates which event occurred:

 0 (zero)
      This indicates a route added to the routing table by a non-RIP agent. 

 RIP_ROUTE_CHANGE_RECD 
      This indicates a route change message. 

 RIP_REDIRECT_RECD 
      This indicates and ICMP redirect message. 

A New Non-RIP Non-System Route was Added to the Routing Table

In response to this event, RIP needs to be told whether to ignore or add the route. RIP does this on the basis of the returned function value of the route hook routine. In the case of route-add event, RIP interprets the returned function value of the route hook routine as the metric for the route.

If the metric is HOPCNT_INFINITY, RIP ignores the route. If the metric is greater than zero but less than HOPCNT_INFINITY, RIP considers the route for inclusion. If the route is new to RIP, RIP adds the new route to its internal database, and then propagates the route in its subsequent update messages. If RIP already stores a route for that destination, RIP compares the metric of the new route and the stored route. If the new route has a better (lower) metric, RIP adds the new route. Otherwise, RIP ignores the new route.

When generating its returned function value, your route hook routine can use the creator of the event (protoID) as a factor in the decision on whether to include the route. For example, if you wanted the route hook to tell RIP to ignore all non-RIP routes except static routes, your route hook would return HOPCNT_INFINITY if the protoID were anything other than M2_ipRouteProto_other. Thus, your route hook routine is a vehicle through which you can implement a policy for including non-RIP routes in the RIP internal route data base.

When designing your policy, you should keep in mind how RIP prioritizes these non-RIP routes and when it deletes these non-RIP routes. For example, non-RIP routes never time out. They remain in the RIP database until one of the following events occurs:

      1.  An agent deletes the route from the system routing table.
      2.  An agent deletes the interface through which the route passes. 
      3.  A route change message for the route arrives. 

Also, these non-RIP routes take precedence over RIP routes to the same destination. RIP ignores routes learned from RIP peers if a route to the same destination was recommended by the hook routine. This non-RIP route takes precedence over the RIP route without regard of the route metric. However, if the route hook routine adds multiple same-destination routes, the route with the lowest metric takes precedence. If the route hook route approves multiple same-metric same-destination routes, the most recently added route is installed.

A Route Change Notification Arrived

In response to this event, RIP needs to be told whether to delete the route or change its metric. If the hook returns a value greater than or equal to HOPCNT_INFINITY, RIP deletes the route from its internal routing data base. If the hook routine returns a valid metric (a value greater than zero but less than HOPCNT_INFINITY), RIP reassigns the routes metric to equal the returned value of the route hook routine. If the returned value of the route hook route is invalid (less than zero) RIP ignores the event. RIP also ignores the event if the route specified in pRouteInfo is not one stored in its internal data base.

An ICMP Redirect Message Arrived

In response to this event, RIP never needs to make any changes to its internal routing database. Thus, RIP ignores the returned function value of the route hook routine called in response to an ICMP redirect message. However, if the event is of interest to your particular environment, and it makes sense to catch the event in the context of the RIP task, you can use the route hook routine to do so.

Within your route hook routine, your can recognize an ICMP event by checking whether the flags parameter value sets the RIP_REDIRECT_RECD bit. The primaryRoute parameter passes in a boolean value that indicates whether the route is primary route. If the primaryRoute passes in FALSE, the route hook routine need will most likely need to do nothing more. If this parameter passes in TRUE, take whatever action (if any) that you know to be appropriate to your particular environment.

RETURNS

OK; or ERROR, if RIP is not initialized.

SEE ALSO

ripLib


OS Libraries : Routines

ripRouteHookDelete( )

NAME

ripRouteHookDelete( ) - remove the route hook

SYNOPSIS

STATUS ripRouteHookDelete (void)

DESCRIPTION

This routine removes the route hook installed earlier by the ripRouteHookAdd( ) routine. This will cause RIP to ignore any routes added to the system Routing database.

RETURNS

OK; or ERROR, if RIP is not initialized.

SEE ALSO

ripLib


OS Libraries : Routines

ripIfSearch( )

NAME

ripIfSearch( ) - add new interfaces to the internal list

SYNOPSIS

void ripIfSearch (void)

DESCRIPTION

By default, a RIP session will not recognize any interfaces initialized after it has started. This routine schedules a search for additional interfaces that will occur during the next update of the internal routing table. Once completed, the session will accept and send RIP messages over the new interfaces.

RETURNS

N/A

ERRNO

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripIfReset( )

NAME

ripIfReset( ) - alter the RIP configuration after an interface changes

SYNOPSIS

STATUS ripIfReset
    (
    char * pIfName            /* name of changed interface */
    )

DESCRIPTION

This routine updates the interface list and routing tables to reflect address and/or netmask changes for the device indicated by pIfName. To accommodate possible changes in the network number, all routes using the named interface are removed from the routing tables, but will be added in the next route update if appropriate. None of the removed routes are poisoned, so it may take some time for the routing tables of all the RIP participants to stabilize if the network number has changed. This routine replaces the existing interface structure with a new one. Thus, any interface specific MIB2 changes that were made to the interface being reset will be lost

RETURNS

OK, or ERROR if named interface not found or not added to list.

ERRNO

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripFilterEnable( )

NAME

ripFilterEnable( ) - activate strict border gateway filtering

SYNOPSIS

void ripFilterEnable (void)

DESCRIPTION

This routine configures an active RIP session to enforce the restrictions necessary for RIP-1 and RIP-2 routers to operate correctly in the same network as described in section 3.2 of RFC 1058 and section 3.3 of RFC 1723. When enabled, routes to portions of a logical network (including host routes) will be limited to routers within that network. Updates sent outside that network will only include a single entry representing the entire network. That entry will subsume all subnets and host-specific routes. If supernets are used, the entry will advertise the largest class-based portion of the supernet reachable through the connected interface.

RETURNS

N/A

ERRNO

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripFilterDisable( )

NAME

ripFilterDisable( ) - prevent strict border gateway filtering

SYNOPSIS

void ripFilterDisable (void)

DESCRIPTION

This routine configures an active RIP session to ignore the restrictions necessary for RIP-1 and RIP-2 routers to operate correctly in the same network. All border gateway filtering is ignored and all routes to subnets, supernets, and specific hosts will be sent over any available interface. This operation is only correct if no RIP-1 routers are present anywhere on the network. Results are unpredictable if that condition is not met, but high rates of packet loss and widespread routing failures are likely.

The border gateway filtering rules are in force by default.

RETURNS

N/A

ERRNO

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripShutdown( )

NAME

ripShutdown( ) - terminate all RIP processing

SYNOPSIS

STATUS ripShutdown (void)

DESCRIPTION

This routine "poisons" all routes in the current table by transmitting updates with an infinite metric for each entry over all available interfaces. It then halts all RIP processing and removes the associated tasks and data structures. When completed successfully, the RIP services are unavailable until restarted with the ripLibInit( ) routine.

RETURNS

OK if shutdown completed, or ERROR otherwise.

ERRNO

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripDebugLevelSet( )

NAME

ripDebugLevelSet( ) - specify amount of debugging output

SYNOPSIS

void ripDebugLevelSet
    (
    int level                 /* verbosity level (0 - 3) */
    )

DESCRIPTION

This routine determines the amount of debugging information sent to standard output during the RIP session. Higher values of the level parameter result in increasingly verbose output. A level of zero restores the default behavior by disabling all debugging output.

RETURNS

N/A

ERRNO

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripAuthKeyShow( )

NAME

ripAuthKeyShow( ) - show current authentication configuration

SYNOPSIS

void ripAuthKeyShow
    (
    UINT showKey              /* if non-zero then key values are shown */
    )

DESCRIPTION

This routines shows the current configuration of the authentication keys for each interface.

RETURNS

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripAuthKeyAdd( )

NAME

ripAuthKeyAdd( ) - add a new RIP authentication key

SYNOPSIS

STATUS ripAuthKeyAdd
    (
    char * pInterfaceName,    /* interface to add a key */
    UINT16 keyId,             /* the keyId for this new key */
    char * pKey,              /* the secret key */
    UINT   keyLen,            /* length of the secret key */
    UINT   authProto,         /* auth protocol to use (1 = MD5) */
    ULONG  timeValid          /* number of seconds until key expires */
    )

DESCRIPTION

This routine is used to add a new RIP authentication key for a specific interface.

RETURNS

ERROR, if the interface does not exist, or the keyId already exists, or if the protocol is not supported; OK, if key was entered.

SEE ALSO

ripLib


OS Libraries : Routines

ripAuthKeyDelete( )

NAME

ripAuthKeyDelete( ) - delete an existing RIP authentication key

SYNOPSIS

STATUS ripAuthKeyDelete
    (
    char * pInterfaceName,    /* interface to delete a key from */
    UINT16 keyId              /* the keyId of the key to delete */
    )

DESCRIPTION

This routine is used to delete a RIP authentication key for a specific interface.

RETURNS

ERROR, if the interface does not exist, or the keyId does not exist; OK, if key was deleted.

SEE ALSO

ripLib


OS Libraries : Routines

ripAuthKeyFind( )

NAME

ripAuthKeyFind( ) - find a RIP authentication key

SYNOPSIS

STATUS ripAuthKeyFind
    (
    struct interface * ifp,   /* interface to search for key */
    UINT16             keyId, /* the keyId of the key to search for */
    RIP_AUTH_KEY * *   pKey   /* storage for the key data */
    )

DESCRIPTION

This routine is used to find a RIP authentication key based on a specified interface and keyId. When a key is found, a pointer to the RIP_AUTH_KEY struct for the key is stored in pKey.

RETURNS

ERROR, if the key is not found; OK if the key was found.

SEE ALSO

ripLib


OS Libraries : Routines

ripAuthKeyFindFirst( )

NAME

ripAuthKeyFindFirst( ) - find a RIP authentication key

SYNOPSIS

STATUS ripAuthKeyFindFirst
    (
    struct interface * ifp,   /* interface to search for key */
    RIP_AUTH_KEY * *   pKey   /* storage for the key data */
    )

DESCRIPTION

This routine is used to find a RIP authentication key based on a specified interface. Because a keyId is not specified, this routine returns the first non-expired key found for the interface. When a key is found, a pointer to the RIP_AUTH_KEY structure for the key is returned in pKey.

RETURNS

ERROR, if a key is not found; OK, if a key was found.

SEE ALSO

ripLib


OS Libraries : Routines

ripAuthKeyInMD5( )

NAME

ripAuthKeyInMD5( ) - authenticate an incoming RIP-2 message using MD5

SYNOPSIS

STATUS ripAuthKeyInMD5
    (
    struct interface * ifp,   /* interface message received on */
    RIP_PKT *          pRip,  /* received RIP message */
    UINT               size   /* length of the RIP message */
    )

DESCRIPTION

This routine is used to authenticate an incoming RIP-2 message using the MD5 digest protocol. This authentication scheme is described in RFC 2082.

RETURNS

ERROR, if could not authenticate; OK, if authenticated.

SEE ALSO

ripLib


OS Libraries : Routines

ripAuthKeyOut1MD5( )

NAME

ripAuthKeyOut1MD5( ) - start MD5 authentication of an outgoing RIP-2 message

SYNOPSIS

STATUS ripAuthKeyOut1MD5
    (
    struct interface *    pIfp,      /* interface message being sent on */
    struct netinfo *      pNetinfo,  /* pointer to next RIP entry to fill in */
    RIP2_AUTH_PKT_HDR * * ppAuthHdr, /* stores the authentication header */
    RIP_AUTH_KEY * *      ppAuthKey  /* stores the authentication key to use */
    )

DESCRIPTION

This routine is used to start the authentication of an outgoing RIP-2 message by adding the authentication header used for MD5 authentication. This authentication scheme is described in RFC 2082. This function returns a pointer the authentication header and a pointer to the looked up authentication key.

RETURNS

ERROR, if a key could not be found; OK, if the header was added.

SEE ALSO

ripLib


OS Libraries : Routines

ripAuthKeyOut2MD5( )

NAME

ripAuthKeyOut2MD5( ) - authenticate an outgoing RIP-2 message using MD5

SYNOPSIS

void ripAuthKeyOut2MD5
    (
    RIP_PKT *           pRip,     /* RIP message to authenticate */
    UINT *              pSize,    /* length of the RIP message */
    struct netinfo *    pNetinfo, /* pointer to next RIP entry to fill in */
    RIP2_AUTH_PKT_HDR * pAuthHdr, /* pointer to auth header in the message */
    RIP_AUTH_KEY *      pAuthKey  /* the auth key data to use */
    )

DESCRIPTION

This routine is used to authenticate an outgoing RIP-2 message using the MD5 digest protocol. This authentication scheme is described in RFC 2082. This function modifies the size given in pSize to account for the extra auth trailer data. The auth trailer is appended to the given RIP_PKT and the authentication digest is filled in.

RETURNS

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripIfExcludeListAdd( )

NAME

ripIfExcludeListAdd( ) - Add an interface to the RIP exclusion list

SYNOPSIS

STATUS ripIfExcludeListAdd
    (
    char * pIfName            /* name of interface to be excluded */
    )

DESCRIPTION

This function adds the interface specified by ifName to a list of interfaces on which RIP will not be started. This can be used to prevent RIP from starting on an interface.

RETURNS

OK if the interface was successfully added to the list;
         ERROR otherwise.

NOTE

This command must be issued prior to the interface being added
      to the system, as RIP starts on an interface, unless it has been
      excluded, as soon as an interface comes up.
      If RIP was already running on the interface which is now desired
      to be excluded from RIP, the ripIfReset command should be used 
      after the ripIfExcludeListAdd command.

SEE ALSO

ripLib


OS Libraries : Routines

ripIfExcludeListDelete( )

NAME

ripIfExcludeListDelete( ) - Delete an interface from RIP exclusion list

SYNOPSIS

STATUS ripIfExcludeListDelete
    (
    char * pIfName            /* name of un-excluded interface */
    )

DESCRIPTION

This function deletes the interface specified by pIfName from the list of interfaces on which RIP will not be started. That is, RIP will start on the interface when it is added or comes up.

RETURNS

OK if the interface was successfully removed from the list;
         ERROR otherwise.

NOTE

RIP will not automatically start on the interface. The ripIfSearch( )
      call will need to be made after this call to cause RIP to start on
      this interface.

SEE ALSO

ripLib


OS Libraries : Routines

ripIfExcludeListShow( )

NAME

ripIfExcludeListShow( ) - Show the RIP interface exclusion list

SYNOPSIS

void ripIfExcludeListShow (void)

DESCRIPTION

This function prints out the interfaces on which RIP will not be started.

RETURNS

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripIfAddrReset( )

NAME

ripIfAddrReset( ) - alter the RIP configuration after an interface changes

SYNOPSIS

STATUS ripIfAddrReset
    (
    char * pIfName,           /* name of changed interface */
    char * pIfAddr,           /* interface address */
    u_long mask               /* subnet mask */
    )

DESCRIPTION

This routine updates the interface list and routing tables to reflect address and/or netmask changes for the device indicated by pIfAddr, pIfMask and pIfName. To accommodate possible changes in the network number, all routes using the indicated interface are removed from the routing tables, but will be added in the next route update if appropriate. None of the removed routes are poisoned, so it may take some time for the routing tables of all the RIP participants to stabilize if the network number has changed. This routine replaces the existing interface structure with a new one. Thus, any interface-specific MIB2 changes that were made to the interface being reset will be lost.

RETURNS

OK, or ERROR if named interface not found or not added to list.

ERRNO

N/A

SEE ALSO

ripLib


OS Libraries : Routines

ripIfAddrExcludeListAdd( )

NAME

ripIfAddrExcludeListAdd( ) - add an interface to the RIP exclusion list

SYNOPSIS

STATUS ripIfAddrExcludeListAdd
    (
    char * pIfName,           /* name of interface to be excluded */
    char * pIfAddr,           /* interface address */
    u_long mask               /* subnet mask */
    )

DESCRIPTION

This function adds the interface specified by pIfAddr, pIfMask and pIfName to a list of interfaces on which RIP will not be started. This can be used to prevent RIP from starting on an interface.

RETURNS

OK, or ERROR if the addition fails

NOTE

This command must be issued prior to the interface being added to the system, as RIP starts on an interface, unless it has been excluded, as soon as an interface comes up. If RIP was already running on the interface which is now desired to be excluded from RIP, the ripIfAddrReset command should be used after the ripIfAddrExcludeListAdd command.

SEE ALSO

ripLib


OS Libraries : Routines

ripIfAddrExcludeListDelete( )

NAME

ripIfAddrExcludeListDelete( ) - delete an interface from RIP exclusion list

SYNOPSIS

STATUS ripIfAddrExcludeListDelete
    (
    char * pIfAddr,
    u_long mask
    )

DESCRIPTION

This function deletes the interface specified by pIfAddr and pIfMask from the list of interfaces on which RIP will not be started. Therefore RIP will start on the interface when it is added or comes up.

RETURNS

OK, or ERROR if removal was unsuccessful

NOTE

RIP will not automatically start on the interface. The ripIfSearch( ) call will need to be made after this call to cause RIP to start on this interface.

SEE ALSO

ripLib