📄 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.html"><i>VxWorks Reference Manual : 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><i><a href="./ripLib.html#ripLibInit">ripLibInit</a></i>( )</b> - initialize the RIP routing library<br><b><i><a href="./ripLib.html#ripRouteShow">ripRouteShow</a></i>( )</b> - display the internal routing table maintained by RIP<br><b><i><a href="./ripLib.html#ripAuthHookAdd">ripAuthHookAdd</a></i>( )</b> - add an authentication hook to a RIP interface<br><b><i><a href="./ripLib.html#ripAuthHookDelete">ripAuthHookDelete</a></i>( )</b> - remove an authentication hook from a RIP interface<br><b><i><a href="./ripLib.html#ripAuthHook">ripAuthHook</a></i>( )</b> - sample authentication hook<br><b><i><a href="./ripLib.html#ripLeakHookAdd">ripLeakHookAdd</a></i>( )</b> - add a hook to bypass the RIP and kernel routing tables<br><b><i><a href="./ripLib.html#ripLeakHookDelete">ripLeakHookDelete</a></i>( )</b> - remove a table bypass hook from a RIP interface<br><b><i><a href="./ripLib.html#ripSendHookAdd">ripSendHookAdd</a></i>( )</b> - add an update filter to a RIP interface<br><b><i><a href="./ripLib.html#ripSendHookDelete">ripSendHookDelete</a></i>( )</b> - remove an update filter from a RIP interface<br><b><i><a href="./ripLib.html#ripIfSearch">ripIfSearch</a></i>( )</b> - add new interfaces to the internal list<br><b><i><a href="./ripLib.html#ripIfReset">ripIfReset</a></i>( )</b> - alter the RIP configuration after an interface changes<br><b><i><a href="./ripLib.html#ripFilterEnable">ripFilterEnable</a></i>( )</b> - activate strict border gateway filtering<br><b><i><a href="./ripLib.html#ripFilterDisable">ripFilterDisable</a></i>( )</b> - prevent strict border gateway filtering<br><b><i><a href="./ripLib.html#ripShutdown">ripShutdown</a></i>( )</b> - terminate all RIP processing<br><b><i><a href="./ripLib.html#ripDebugLevelSet">ripDebugLevelSet</a></i>( )</b> - specify amount of debugging output<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><i><a href="./ripLib.html#ripLibInit">ripLibInit</a></i>( )</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><i><a href="./ripLib.html#ripShutdown">ripShutdown</a></i>( )</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 which implement 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><i><a href="./ripLib.html#ripSendHookAdd">ripSendHookAdd</a></i>( )</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><i><a href="./ripLib.html#ripLibInit">ripLibInit</a></i>( )</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><i><a href="./ripLib.html#ripIfSearch">ripIfSearch</a></i>( )</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><i><a href="./ripLib.html#ripIfReset">ripIfReset</a></i>( )</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><i><a href="./ripLib.html#ripFilterDisable">ripFilterDisable</a></i>( )</b> routine will remove those limitations, and may producemore efficient routing for some topologies. That routine must not be usedif any version 1 routers are present. The <b><i><a href="./ripLib.html#ripFilterEnable">ripFilterEnable</a></i>( )</b> routine willrestore 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><i><a href="./ripLib.html#ripAuthHookAdd">ripAuthHookAdd</a></i>( )</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><i><a href="./ripLib.html#ripAuthHookDelete">ripAuthHookDelete</a></i>( )</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><i><a href="./ripLib.html#ripLeakHookAdd">ripLeakHookAdd</a></i>( )</b> routine allows the use of an alternative routingprotocol which uses RIP as a transport mechanism. The specified functioncan prevent the RIP session from creating any table entries from thereceived messages. The <b><i><a href="./ripLib.html#ripLeakHookDelete">ripLeakHookDelete</a></i>( )</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><i><a href="./ripLib.html#ripRouteShow">ripRouteShow</a></i>( )</b>routine will display the contents of the internal RIP routing table.Routines such as <b><i><a href="./netShow.html#mRouteShow">mRouteShow</a></i>( )</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><i><a href="./ripLib.html#ripDebugLevelSet">ripDebugLevelSet</a></i>( )</b> routine will enable predefined debugging messages which 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><b><a href="./ripLib.html#top">ripLib</a></b>, RFC 1058, RFC 1723<hr><a name="ripLibInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ripLibInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ripLibInit</i>( )</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 */ )</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. It must be called before using any other library routines, and is invoked automatically if <b>INCLUDE_RIP</b> is defined at the time the system is built.<p>The resulting RIP session will monitor all network interfaces which 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 defaults for all the parameter settings are given by the followingconstants. The default timer values match the settings indicated inthe RFC specification.<p><table><tr valign=top><th align=left>Parameter Name </th><th align=left> </th><th align=left> Default Value </th><th align=left> </th><th align=left> Symbolic Constant </tr><tr><td colspan="8"><hr></tr><tr valign=top><td align=left><i>supplier</i> </td><td align=left> </td><td align=left> </td><td align=left> 0 (FALSE) </td><td align=left> </td><td align=left> </td><td align=left> <b>RIP_SUPPLIER</b></tr><tr valign=top><td align=left><i>gateway</i> </td><td align=left> </td><td align=left> </td><td align=left> 0 (FALSE) </td><td align=left> </td><td align=left> </td><td align=left> <b>RIP_GATEWAY</b></tr><tr valign=top><td align=left><i>multicast</i> </td><td align=left> </td><td align=left> </td><td align=left> 0 (FALSE) </td><td align=left> </td><td align=left> </td><td align=left> <b>RIP_EXPIRE_TIME</b></tr><tr valign=top><td align=left><i>version</i> </td><td align=left> </td><td align=left> </td><td align=left> 1 </td><td align=left> </td><td align=left> </td><td align=left> </td><td align=left> <b>RIP_SUPPLY_INTERVAL</b></tr><tr valign=top><td align=left><i>timerRate</i> </td><td align=left> </td><td align=left> </td><td align=left> 1 </td><td align=left> </td><td align=left> </td><td align=left> </td><td align=left> <b>RIP_TIMER_RATE</b></tr><tr valign=top><td align=left><i>supplyInterval</i> </td><td align=left> </td><td align=left> 30 </td><td align=left> </td><td align=left> </td><td align=left> </td><td align=left> <b>RIP_SUPPLY_INTERVAL</b></tr><tr valign=top><td align=left><i>expire</i> </td><td align=left> </td><td align=left> </td><td align=left> 180 </td><td align=left> </td><td align=left> </td><td align=left> </td><td align=left> <b>RIP_EXPIRE_TIME</b></tr><tr valign=top><td align=left><i>garbage</i> </td><td align=left> </td><td align=left> </td><td align=left> 300 </td><td align=left> </td><td align=left> </td><td align=left> </td><td align=left> <b>RIP_GARBAGE_TIME</b></tr><tr valign=top><td align=left></tr></tr></table></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if configuration fails.<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><hr><a name="ripRouteShow"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ripRouteShow</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ripRouteShow</i>( )</strong> - display the internal routing table maintained by RIP</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void ripRouteShow()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine prints every entry in the local RIP routing table. Theflags displayed below the destination, gateway, and netmask addressesindicate the current route status. Entries with the <b>RTS_INTERFACE</b> flagindicate routes to directly connected networks which are generated locally. If <b>RTS_SUBNET</b> is set for an entry, it is subject to bordergateway filtering (if enabled). When <b>RTS_INTERNAL</b> is also present, the corresponding entry is an "artificial" route created to supply distantnetworks with legitimate destinations if border filtering excludes theactual entry. Those entries are not copied to the kernel routing table.The <b>RTS_CHANGED</b> flag marks entries added or modified in the last timer interval which will be included in a triggered update.<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><hr><a name="ripAuthHookAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ripAuthHookAdd</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ripAuthHookAdd</i>( )</strong> - add an authentication hook to a RIP interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ripAuthHookAdd ( char* pIpAddr, /* IP address in dotted decimal notation */ FUNCPTR pAuthHook /* routine to handle message authentication */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine installs a hook routine to validate incoming RIP messagesfor a registered interface given by <i>pIpAddr</i>. (Interfaces created orchanged after a RIP session has started may be installed/updated with the<b><i><a href="./ripLib.html#ripIfSearch">ripIfSearch</a></i>( )</b> and <b><i><a href="./ripLib.html#ripIfReset">ripIfReset</a></i>( )</b> routines). The hook is only called ifan SNMP agent enables authentication for the corresponding interface.It uses the following prototype:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -