📄 riplib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/ripLib.html - generated by refgen from ripLib.c --> <title> ripLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>ripLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ripLib</strong> - Routing Information Protocol (RIP) v1 and v2 library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./ripLib.html#ripLibInit">ripLibInit</a>( )</b> - initialize the RIP routing library<br><b><a href="./ripLib.html#ripAddrsXtract">ripAddrsXtract</a>( )</b> - extract socket address pointers from the route message<br><b><a href="./ripLib.html#ripRouteShow">ripRouteShow</a>( )</b> - display the internal routing table maintained by RIP<br><b><a href="./ripLib.html#ripIfShow">ripIfShow</a>( )</b> - display the internal interface table maintained by RIP<br><b><a href="./ripLib.html#ripAuthHookAdd">ripAuthHookAdd</a>( )</b> - add an authentication hook to a RIP interface<br><b><a href="./ripLib.html#ripAuthHookDelete">ripAuthHookDelete</a>( )</b> - remove an authentication hook from a RIP interface<br><b><a href="./ripLib.html#ripAuthHook">ripAuthHook</a>( )</b> - sample authentication hook<br><b><a href="./ripLib.html#ripLeakHookAdd">ripLeakHookAdd</a>( )</b> - add a hook to bypass the RIP and kernel routing tables<br><b><a href="./ripLib.html#ripLeakHookDelete">ripLeakHookDelete</a>( )</b> - remove a table bypass hook from a RIP interface<br><b><a href="./ripLib.html#ripSendHookAdd">ripSendHookAdd</a>( )</b> - add an update filter to a RIP interface<br><b><a href="./ripLib.html#ripSendHookDelete">ripSendHookDelete</a>( )</b> - remove an update filter from a RIP interface<br><b><a href="./ripLib.html#ripRouteHookAdd">ripRouteHookAdd</a>( )</b> - add a hook to install static and non-RIP routes into RIP<br><b><a href="./ripLib.html#ripRouteHookDelete">ripRouteHookDelete</a>( )</b> - remove the route hook<br><b><a href="./ripLib.html#ripIfSearch">ripIfSearch</a>( )</b> - add new interfaces to the internal list<br><b><a href="./ripLib.html#ripIfReset">ripIfReset</a>( )</b> - alter the RIP configuration after an interface changes<br><b><a href="./ripLib.html#ripFilterEnable">ripFilterEnable</a>( )</b> - activate strict border gateway filtering<br><b><a href="./ripLib.html#ripFilterDisable">ripFilterDisable</a>( )</b> - prevent strict border gateway filtering<br><b><a href="./ripLib.html#ripShutdown">ripShutdown</a>( )</b> - terminate all RIP processing<br><b><a href="./ripLib.html#ripDebugLevelSet">ripDebugLevelSet</a>( )</b> - specify amount of debugging output<br><b><a href="./ripLib.html#ripAuthKeyShow">ripAuthKeyShow</a>( )</b> - show current authentication configuration<br><b><a href="./ripLib.html#ripAuthKeyAdd">ripAuthKeyAdd</a>( )</b> - add a new RIP authentication key<br><b><a href="./ripLib.html#ripAuthKeyDelete">ripAuthKeyDelete</a>( )</b> - delete an existing RIP authentication key<br><b><a href="./ripLib.html#ripAuthKeyFind">ripAuthKeyFind</a>( )</b> - find a RIP authentication key<br><b><a href="./ripLib.html#ripAuthKeyFindFirst">ripAuthKeyFindFirst</a>( )</b> - find a RIP authentication key<br><b><a href="./ripLib.html#ripAuthKeyInMD5">ripAuthKeyInMD5</a>( )</b> - authenticate an incoming RIP-2 message using MD5<br><b><a href="./ripLib.html#ripAuthKeyOut1MD5">ripAuthKeyOut1MD5</a>( )</b> - start MD5 authentication of an outgoing RIP-2 message<br><b><a href="./ripLib.html#ripAuthKeyOut2MD5">ripAuthKeyOut2MD5</a>( )</b> - authenticate an outgoing RIP-2 message using MD5<br><b><a href="./ripLib.html#ripIfExcludeListAdd">ripIfExcludeListAdd</a>( )</b> - Add an interface to the RIP exclusion list<br><b><a href="./ripLib.html#ripIfExcludeListDelete">ripIfExcludeListDelete</a>( )</b> - Delete an interface from RIP exclusion list<br><b><a href="./ripLib.html#ripIfExcludeListShow">ripIfExcludeListShow</a>( )</b> - Show the RIP interface exclusion list<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library implements versions 1 and 2 of the Routing Information Protocol (RIP). The protocol is intended to operate as an interior gateway protocolwithin a relatively small network with a longest path of 15 hops.<p></blockquote><h4>HIGH-LEVEL INTERFACE</h4><blockquote><p>The <b><a href="./ripLib.html#ripLibInit">ripLibInit</a>( )</b> routine links this library into the VxWorks image and beginsa RIP session. This happens automatically if <b>INCLUDE_RIP</b> is defined at thetime the image is built. Once started, RIP will maintain the network routing table until deactivated by a call to the <b><a href="./ripLib.html#ripShutdown">ripShutdown</a>( )</b> routine, which will remove all route entries and disable the RIP library routines. All RIPrequests and responses are handled as defined in the RFC specifications.RFC 1058 defines the basic protocol operation and RFC 1723 details theextensions that constitute version 2.<p>When acting as a supplier, outgoing route updates are filtered using simplesplit horizon. Split horizon with poisoned reverse is not currently available.Additional route entries may be excluded from the periodic update with the<b><a href="./ripLib.html#ripSendHookAdd">ripSendHookAdd</a>( )</b> routine. <p>If a RIP session is terminated, the networking subsystem may not function correctly until RIP is restarted with a new call to <b><a href="./ripLib.html#ripLibInit">ripLibInit</a>( )</b> unlessrouting information is provided by some other method.<p></blockquote><h4>CONFIGURATION INTERFACE</h4><blockquote><p>By default, a RIP session only uses the network interfaces created before itstarted. The <b><a href="./ripLib.html#ripIfSearch">ripIfSearch</a>( )</b> routine allows RIP to recognize any interfaces added to the system after that point. If the address or netmask of anexisting interface is changed during a RIP session, the <b><a href="./ripLib.html#ripIfReset">ripIfReset</a>( )</b> routine must be used to update the RIP configuration appropriately.The current RIP implementation also automatically performs the bordergateway filtering required by the RFC specification. Those restrictionsprovide correct operation in a mixed environment of RIP-1 and RIP-2 routers.The <b><a href="./ripLib.html#ripFilterDisable">ripFilterDisable</a>( )</b> routine will remove those limitations, and can producemore efficient routing for some topologies. However, you must not use that routine if any version 1 routers are present. The <b><a href="./ripLib.html#ripFilterEnable">ripFilterEnable</a>( )</b> routine will restore the default behavior. <p></blockquote><h4>AUTHENTICATION INTERFACE</h4><blockquote><p>By default, authentication is disabled, but may be activated by an SNMPagent on an interface-specific basis. While authentication is disabled,any RIP-2 messages containing authentication entries are discarded. Whenenabled, all RIP-2 messages without authentication entries are automaticallyrejected. To fully support authentication, an authentication routine shouldbe specified with the <b><a href="./ripLib.html#ripAuthHookAdd">ripAuthHookAdd</a>( )</b> routine. The specified functionwill be called to screen every RIP-1 message and all unverified RIP-2 messages containing authentication entries. It may be removed with the <b><a href="./ripLib.html#ripAuthHookDelete">ripAuthHookDelete</a>( )</b> routine. All RIP-1 and unverified RIP-2 messages will be discarded while authentication is enabled unless a hook is present.<p></blockquote><h4>OPTIONAL INTERFACE</h4><blockquote><p>The <b><a href="./ripLib.html#ripLeakHookAdd">ripLeakHookAdd</a>( )</b> routine allows the use of an alternative routingprotocol that uses RIP as a transport mechanism. The specified functioncan prevent the RIP session from creating any table entries from thereceived messages. The <b><a href="./ripLib.html#ripLeakHookDelete">ripLeakHookDelete</a>( )</b> routine will restore thedefault operation. <p></blockquote><h4>DEBUGGING INTERFACE</h4><blockquote><p>As required by the RFC specification, the obsolete traceon and traceoff messages are not supported by this implementation. The <b><a href="./ripLib.html#ripRouteShow">ripRouteShow</a>( )</b>routine will display the contents of the internal RIP routing table.Routines such as <b><a href="./netShow.html#mRouteShow">mRouteShow</a>( )</b> to display the corresponding kernel routing table will also be available if <b>INCLUDE_NET_SHOW</b> is defined when the image is built. If additional information is required, the <b><a href="./ripLib.html#ripDebugLevelSet">ripDebugLevelSet</a>( )</b> routine will enable predefined debugging messages that will be sent to the standard output.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>ripLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p>RFC 1058, RFC 1723<hr><a name="ripLibInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ripLibInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ripLibInit( )</strong> - initialize the RIP routing library</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>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 */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>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 <b><a href="./ripLib.html#ripLibInit">ripLibInit</a>( )</b> before you can use any other <b><a href="./ripLib.html#top">ripLib</a></b> routines. A VxWorks image automatically invokes <b><a href="./ripLib.html#ripLibInit">ripLibInit</a>( )</b> if <b>INCLUDE_RIP</b> was defined when the image was built.<p>The resulting RIP session will monitor all network interfaces that are currently available for messages from other RIP routers. If the <i>supplier</i>parameter is true, it will also respond to specific requests from otherrouters and transmit route updates over every known interface at the interval specified by <i>supplyInterval</i>.<p>Specifying a <i>gateway</i> setting of true establishes this router as agateway to the wider Internet, capable of routing packets anywhere within the local networks. The final <i>multicast</i> flag indicates whether theRIP messages are sent to the pre-defined multicast address of 224.0.0.9(which requires a <i>version</i> setting of 2) or to the broadcast address of the interfaces.<p>The <i>version</i> 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 <i>multicast</i> flag. A <i>version</i> of 1 will restrict all incoming traffic to that older message type. A <i>version</i> of 2 will set the receive switch to accept either type unless <i>multicast</i> 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.<p>The remaining parameters set various system timers used to maintain therouting table. All of the values are expressed in seconds, and must begreater than or equal to 1. The <i>timerRate</i> determines how oftenthe routing table is examined for changes and expired routes. The<i>supplyInterval</i> must be an exact multiple of that value. The<i>expire</i> parameter specifies the maximum time between updates beforea route is invalidated and removed from the kernel table. Expired routes are then deleted from the internal RIP routing table if no update hasbeen received within the time set by the <i>garbage</i> parameter.<p>The following configuration parameters determine the initial values forall these settings. The default timer values match the settings indicatedin the RFC specification.<p><table><tr valign=top><th align=left>Parameter Name </th><th align=left> Default Value </th><th align=left> Configuration Parameter</tr><tr><td colspan="3"><hr></tr><tr valign=top><td align=left><i>supplier</i> </td><td align=left> 0 (FALSE) </td><td align=left> <b>RIP_SUPPLIER</b></tr><tr valign=top><td align=left><i>gateway</i> </td><td align=left> 0 (FALSE) </td><td align=left> <b>RIP_GATEWAY</b></tr><tr valign=top><td align=left><i>multicast</i> </td><td align=left> 0 (FALSE) </td><td align=left> <b>RIP_MULTICAST</b></tr><tr valign=top><td align=left><i>version</i> </td><td align=left> 1 </td><td align=left> <b>RIP_VERSION</b></tr><tr valign=top><td align=left><i>timerRate</i> </td><td align=left> 1 </td><td align=left> <b>RIP_TIMER_RATE</b></tr><tr valign=top><td align=left><i>supplyInterval</i> </td><td align=left> 30 </td><td align=left> <b>RIP_SUPPLY_INTERVAL</b></tr><tr valign=top><td align=left><i>expire</i> </td><td align=left> 180 </td><td align=left> <b>RIP_EXPIRE_TIME</b></tr><tr valign=top><td align=left><i>garbage</i> </td><td align=left> 300 </td><td align=left> <b>RIP_GARBAGE_TIME</b></tr><tr valign=top><td align=left><i>authType</i> </td><td align=left> 1 </td><td align=left> <b>RIP_AUTH_TYPE</b></tr><tr valign=top><td align=left></tr></tr></table></blockquote><h4>RETURNS</h4><blockquote><p>OK; or ERROR, if configuration fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ripLib.html#top">ripLib</a></b><hr><a name="ripAddrsXtract"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ripAddrsXtract( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ripAddrsXtract( )</strong> - extract socket address pointers from the route message</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>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 */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine extracts the socket addresses from the route message in <i>pRtInfo</i> and uses the other parameters to return pointers to the extracted messages.<dl><dt><i>pRtInfo</i><dd>Passes in a pointer to a route information message. <dt><i>pDstAddr</i> <dd>Returns a pointer to the destination address.<dt><i>pNetmask</i> <dd>Returns a pointer to the netmask.<dt><i>pGateway</i> <dd>Returns a pointer to the gateway address.<dt><i>pOldGateway</i> <dd>Returns a pointer to the OLD gateway address if it exists.</dl> If the route message doesn't specify an address, the correspondingaddress pointer is set to NULL<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>ERRNO</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ripLib.html#top">ripLib</a></b>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -