📄 routelib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/routeLib.html - generated by refgen from routeLib.c --> <title> routeLib </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>routeLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>routeLib</strong> - network route manipulation library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./routeLib.html#routeAdd">routeAdd</a></i>( )</b> - add a route<br><b><i><a href="./routeLib.html#routeNetAdd">routeNetAdd</a></i>( )</b> - add a route to a destination that is a network<br><b><i><a href="./routeLib.html#routeDelete">routeDelete</a></i>( )</b> - delete a route<br><b><i><a href="./routeLib.html#mRouteAdd">mRouteAdd</a></i>( )</b> - add multiple routes to the same destination <br><b><i><a href="./routeLib.html#mRouteEntryAdd">mRouteEntryAdd</a></i>( )</b> - add a protocol-specific route to the routing table <br><b><i><a href="./routeLib.html#mRouteEntryDelete">mRouteEntryDelete</a></i>( )</b> - delete route from the routing table <br><b><i><a href="./routeLib.html#mRouteDelete">mRouteDelete</a></i>( )</b> - delete a route from the routing table <br><b><i><a href="./routeLib.html#routeProtoPrioritySet">routeProtoPrioritySet</a></i>( )</b> - set the priority of routes added by the routing protocol <br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains the routines for inspecting the routing table,as well as routines for adding and deleting routes from that table. If you do not configure VxWorks to include a routing protocol, such as RIP or OSPF, you can use these routines to maintain the routing tables manually. <p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>routeLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./routeLib.html#top">routeLib</a></b>, <b><a href="./hostLib.html#top">hostLib</a></b>, <i>Network Programmer's Guide </i><hr><a name="routeAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>routeAdd</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>routeAdd</i>( )</strong> - add a route</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS routeAdd ( char * destination, /* inet addr or name of route destination */ char * gateway /* inet addr or name of gateway to destination */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds gateways to the network routing tables.It is called from a VxWorks machine that needsto establish a gateway to a destination network (or machine).<p>You can specify both <i>destination</i> and <i>gateway</i> in standard Internetaddress format (for example, 90.0.0.2), or you can specify them usingtheir host names, as specified with <b><i><a href="./hostLib.html#hostAdd">hostAdd</a></i>( )</b>.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>Consider the following example:<pre> -> routeAdd "90.0.0.0", "gate"</pre>This call tells VxWorks that the machine with the host name "gate" is the gateway to network 90.0.0.0. The host "gate" must already have been created by <b><i><a href="./hostLib.html#hostAdd">hostAdd</a></i>( )</b>.<p>Consider the following example:<pre> -> routeAdd "90.0.0.0", "91.0.0.3"</pre>This call tells VxWorks that the machine with the Internet address 91.0.0.3 is the gateway to network 90.0.0.0.<p>Consider the following example:<pre> -> routeAdd "destination", "gate"</pre>This call tells VxWorks that the machine with the host name "gate" is the gateway to the machine named "destination". The host names "gate" and "destination" must already have been created by <b><i><a href="./hostLib.html#hostAdd">hostAdd</a></i>( )</b>.<p>Consider the following example:<pre> -> routeAdd "0", "gate"</pre>This call tells VxWorks that the machine with the host name "gate" is the default gateway. The host "gate" must already have been created by <b><i><a href="./hostLib.html#hostAdd">hostAdd</a></i>( )</b>. A default gateway is where Internet Protocol (IP) datagrams are routed when there is no specific routing table entry available for the destination IP network or host.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./routeLib.html#top">routeLib</a></b><hr><a name="routeNetAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>routeNetAdd</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>routeNetAdd</i>( )</strong> - add a route to a destination that is a network</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS routeNetAdd ( char * destination, /* inet addr or name of network destination */ char * gateway /* inet addr or name of gateway to destination */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is equivalent to <b><i><a href="./routeLib.html#routeAdd">routeAdd</a></i>( )</b>, except that the destinationaddress is assumed to be a network. This is useful for adding a routeto a sub-network that is not on the same overall network as thelocal network.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./routeLib.html#top">routeLib</a></b><hr><a name="routeDelete"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>routeDelete</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>routeDelete</i>( )</strong> - delete a route</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS routeDelete ( char * destination, /* inet addr or name of route destination */ char * gateway /* inet addr or name of gateway to destination */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes a specified route from the network routing tables.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./routeLib.html#top">routeLib</a></b>, <b><i><a href="./routeLib.html#routeAdd">routeAdd</a></i>( )</b><hr><a name="mRouteAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>mRouteAdd</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>mRouteAdd</i>( )</strong> - add multiple routes to the same destination </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS mRouteAdd ( char * pDest, /* destination addr in internet dot notation */ char * pGate, /* gateway address in internet dot notation */ long mask, /* mask for destination */ int tos, /* type of service */ int flags /* route flags */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is similar to <b><i><a href="./routeLib.html#routeAdd">routeAdd</a></i>( )</b>, except that you can use multiple<b><i><a href="./routeLib.html#mRouteAdd">mRouteAdd</a></i>( )</b> calls to add multiple routes to the same location. Use <i>pDest</i> to specify the destination, <i>pGate</i> to specify the gateway tothat destination, <i>mask</i> to specify destination mask, and <i>tos</i> to specifythe type of service. For <i>tos</i>, <b>netinet/ip.h</b> defines the following constants as valid values: <p> <b>IPTOS_LOWDELAY</b><br> <b>IPTOS_THROUGHPUT</b><br> <b>IPTOS_RELIABILITY</b><br> <b>IPTOS_MINCOST</b><p>Use <i>flags</i> to specify any flags you want to associate with this entry. The valid non-zero values are <b>RTF_HOST</b> and <b>RTF_CLONING</b> defined in <b>net/route.h</b>.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>To add a route to the 90.0.0.0 network through 91.0.0.3: <pre> -> mRouteAdd ("90.0.0.0", "91.0.0.3", 0xffffff00, 0, 0);</pre>Using <b><i><a href="./routeLib.html#mRouteAdd">mRouteAdd</a></i>( )</b>, you could create multiple routes to the same destination.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -