📄 riplib.html
字号:
The RIP session will not add the given route to any tables if the hookroutine returns OK, but will create a route entry otherwise.<p>The <b><a href="./ripLib.html#ripLeakHookDelete">ripLeakHookDelete</a>( )</b> will allow the RIP session to add new routesunconditionally.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK; or ERROR, if the interface could not be found.<p></blockquote><h4>ERRNO</h4><blockquote><p><p> <b>S_m2Lib_INVALID_PARAMETER</b><br> <b>S_m2Lib_ENTRY_NOT_FOUND</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ripLib.html#top">ripLib</a></b><hr><a name="ripLeakHookDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ripLeakHookDelete( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ripLeakHookDelete( )</strong> - remove a table bypass hook from a RIP interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ripLeakHookDelete ( char* pIpAddr /* IP address in dotted decimal notation */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes the assigned bypass hook from a registered interfaceindicated by <i>pIpAddr</i>. (Interfaces created or changed after a RIPsession has started may be installed/updated with the <b><a href="./ripLib.html#ripIfSearch">ripIfSearch</a>( )</b> and <b><a href="./ripLib.html#ripIfReset">ripIfReset</a>( )</b> routines). The RIP session will return to the default behavior and add entries to the internal RIP table and kernel routing table unconditionally.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK; or ERROR, if the interface could not be found.<p></blockquote><h4>ERRNO</h4><blockquote><p><p> <b>S_m2Lib_INVALID_PARAMETER</b><br> <b>S_m2Lib_ENTRY_NOT_FOUND</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ripLib.html#top">ripLib</a></b><hr><a name="ripSendHookAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ripSendHookAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ripSendHookAdd( )</strong> - add an update filter to a RIP interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ripSendHookAdd ( char* pIpAddr, /* IP address in dotted decimal notation */ BOOL (* ripSendHook) (struct rt_entry* pRt) /* Routine to use. */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine installs a hook routine to screen individual route entriesfor inclusion in a periodic update. The routine is installed for theregistered interface given by <i>pIpAddr</i>. (Interfaces created orchanged after a RIP session has started may be installed/updated with the <b><a href="./ripLib.html#ripIfSearch">ripIfSearch</a>( )</b> and <b><a href="./ripLib.html#ripIfReset">ripIfReset</a>( )</b> routines).<p>The hook uses the following prototype:<pre> BOOL ripSendHookRtn (struct rt_entry* pRt);</pre>If the hook returns FALSE, the route is not included in the update.Otherwise, it is included if it meets the other restrictions, suchas simple split horizon and border gateway filtering. The <b><a href="./ripLib.html#ripSendHookDelete">ripSendHookDelete</a>( )</b> routine removes this additional filter from theoutput processing.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK; or ERROR, if the interface could not be found.<p></blockquote><h4>ERRNO</h4><blockquote><p><p> <b>S_m2Lib_INVALID_PARAMETER</b><br> <b>S_m2Lib_ENTRY_NOT_FOUND</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ripLib.html#top">ripLib</a></b><hr><a name="ripSendHookDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ripSendHookDelete( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ripSendHookDelete( )</strong> - remove an update filter from a RIP interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ripSendHookDelete ( char* pIpAddr /* IP address in dotted decimal notation */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes the hook routine that allowed additional screeningof route entries in periodic updates from the registered interfaceindicated by <i>pIpAddr</i>. (Interfaces created or changed after a RIP session has started may be installed/updated with the <b><a href="./ripLib.html#ripIfSearch">ripIfSearch</a>( )</b> and <b><a href="./ripLib.html#ripIfReset">ripIfReset</a>( )</b> routines). The RIP session will return to the default behavior and include any entries that meet the other restrictions (such as simple split horizon).<p></blockquote><h4>RETURNS</h4><blockquote><p>OK; or ERROR, if the interface could not be found.<p></blockquote><h4>ERRNO</h4><blockquote><p><p> <b>S_m2Lib_INVALID_PARAMETER</b><br> <b>S_m2Lib_ENTRY_NOT_FOUND</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ripLib.html#top">ripLib</a></b><hr><a name="ripRouteHookAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ripRouteHookAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ripRouteHookAdd( )</strong> - add a hook to install static and non-RIP routes into RIP</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ripRouteHookAdd ( FUNCPTR pRouteHook /* function pointer to hook */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>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 <b><a href="./ripLib.html#ripRouteHookAdd">ripRouteHookAdd</a>( )</b> to register a function of the form:<p><pre>STATUS <i>Your</i>RipRouteHookRtn ( struct ROUTE_INFO * pRouteInfo, int protoId, BOOL primaryRoute, int flags ) </pre>RIP invokes this function in response to the following events:<p> <b>1.</b> A non-RIP non-system route was added to the routing table. <br> <b>2.</b> A route change message arrived. <br> <b>3.</b> An ICMP redirect message arrived. <p>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. <dl><dt><i>pRouteInfo</i><dd>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 <b><a href="./ripLib.html#ripAddrsXtract">ripAddrsXtract</a>( )</b> to extract the following information: <p> <b>-</b> destination address<br> <b>-</b> netmask<br> <b>-</b> gateway address<br> <b>-</b> old gateway address (if available)<p><dt><i>protoId</i> <dd>This parameter passes in the ID of the protocol that generated the event. Valid protocol IDs are defined in <b>m2Lib.h</b> as follows:<p> <b>M2_ipRouteProto_other</b> (static routes) <br> <b>M2_ipRouteProto_local</b> <br> <b>M2_ipRouteProto_netmgmt</b><br> <b>M2_ipRouteProto_icmp</b><br> <b>M2_ipRouteProto_egp</b><br> <b>M2_ipRouteProto_ggp</b><br> <b>M2_ipRouteProto_hello</b><br> <b>M2_ipRouteProto_rip</b><br> <b>M2_ipRouteProto_is_is</b><br> <b>M2_ipRouteProto_es_is</b><br> <b>M2_ipRouteProto_ciscoIgrp</b><br> <b>M2_ipRouteProto_bbnSpfIgp</b><br> <b>M2_ipRouteProto_ospf</b><br> <b>M2_ipRouteProto_bgp</b><p><dt><i>primaryRoute</i> <dd>This parameter passes in a boolean value that indicates whether the route is a primary route. <b>TRUE</b> indicates a primary route. <b>FALSE</b> indicates a duplicate route. <dt><i>flags</i> <dd>This parameter passes in a value that indicates which event occurred: <p> <b>0</b> (zero)<br> This indicates a route added to the routing table by a non-RIP agent. <p> <b>RIP_ROUTE_CHANGE_RECD</b> <br> This indicates a route change message. <p> <b>RIP_REDIRECT_RECD</b> <br> This indicates and ICMP redirect message. </dl></blockQuote><h4>A New Non-RIP Non-System Route was Added to the Routing Table </h4><blockQuote><p>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.<p>If the metric is <b>HOPCNT_INFINITY</b>, RIP ignores the route. If the metric is greater than zero but less than <b>HOPCNT_INFINITY</b>, 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. <p>When generating its returned function value, your route hook routine can use the creator of the event (<i>protoID</i>) 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 <b>HOPCNT_INFINITY</b> if the <i>protoID</i> were anything other than <b>M2_ipRouteProto_other</b>. 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. <p>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:<p> <b>1.</b> An agent deletes the route from the system routing table.<br> <b>2.</b> An agent deletes the interface through which the route passes. <br> <b>3.</b> A route change message for the route arrives. <p>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.<p></blockQuote><h4>A Route Change Notification Arrived</h4><blockQuote><p>In response to this event, RIP needs to be told whether to
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -