⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 routelib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 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.htm"><i>VxWorks API Reference :  OS 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><a href="./routeLib.html#routeAdd">routeAdd</a>(&nbsp;)</b>  -  add a route<br><b><a href="./routeLib.html#routeNetAdd">routeNetAdd</a>(&nbsp;)</b>  -  add a route to a destination that is a network<br><b><a href="./routeLib.html#routeDelete">routeDelete</a>(&nbsp;)</b>  -  delete a route<br><b><a href="./routeLib.html#mRouteAdd">mRouteAdd</a>(&nbsp;)</b>  -  add multiple routes to the same destination  <br><b><a href="./routeLib.html#mRouteEntryAdd">mRouteEntryAdd</a>(&nbsp;)</b>  -  add a protocol-specific route to the routing table <br><b><a href="./routeLib.html#mRouteEntryDelete">mRouteEntryDelete</a>(&nbsp;)</b>  -  delete route from the routing table <br><b><a href="./routeLib.html#mRouteDelete">mRouteDelete</a>(&nbsp;)</b>  -  delete a route from the routing table <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>To use this feature, include the following component:<b>INCLUDE_NETWRS_ROUTELIB</b><p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>routeLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./hostLib.html#top">hostLib</a></b><hr><a name="routeAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>routeAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>routeAdd(&nbsp;)</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><a href="./hostLib.html#hostAdd">hostAdd</a>(&nbsp;)</b>.<p>This routine can be used to add multiple routes to the same destinationdiffering by the gateway.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>Consider the following example:<pre>    -&gt; 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><a href="./hostLib.html#hostAdd">hostAdd</a>(&nbsp;)</b>.<p>Consider the following example:<pre>    -&gt; 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>    -&gt; 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><a href="./hostLib.html#hostAdd">hostAdd</a>(&nbsp;)</b>.<p>Consider the following example:<pre>    -&gt; 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><a href="./hostLib.html#hostAdd">hostAdd</a>(&nbsp;)</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.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>routeNetAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>routeNetAdd(&nbsp;)</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><a href="./routeLib.html#routeAdd">routeAdd</a>(&nbsp;)</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>This routine can be used to add multiple routes to the same destinationdiffering by the gateway.<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.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>routeDelete(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>routeDelete(&nbsp;)</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><a href="./routeLib.html#routeAdd">routeAdd</a>(&nbsp;)</b><hr><a name="mRouteAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>mRouteAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>mRouteAdd(&nbsp;)</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><a href="./routeLib.html#routeAdd">routeAdd</a>(&nbsp;)</b>, except that you can use multiple<b><a href="./routeLib.html#mRouteAdd">mRouteAdd</a>(&nbsp;)</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>&nbsp;&nbsp;&nbsp;&nbsp;<b>IPTOS_LOWDELAY</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IPTOS_THROUGHPUT</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IPTOS_RELIABILITY</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<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>    -&gt; mRouteAdd ("90.0.0.0", "91.0.0.3", 0xffffff00, 0, 0);</pre>Using <b><a href="./routeLib.html#mRouteAdd">mRouteAdd</a>(&nbsp;)</b>, you could create multiple routes to the same destination.VxWorks would distinguish among these routes based on factors such as the netmask or the type of service.  Thus, it is perfectly legal to say:<pre>    -&gt; mRouteAdd ("90.0.0.0", "91.0.0.3", 0xffffff00, 0, 0);    -&gt; mRouteAdd ("90.0.0.0", "91.0.0.254", 0xffff0000, 0, 0);</pre>This adds two routes to the same network, "90.0.0.0", that go by twodifferent gateways.  The differentiating factor is the netmask.<p>This routine adds a route of type <b>M2_ipRouteProto_other</b>, which is astatic route.  This route will not be modified or deleted until acall to <b><a href="./routeLib.html#mRouteDelete">mRouteDelete</a>(&nbsp;)</b> removes it.<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><a href="./routeLib.html#mRouteEntryAdd">mRouteEntryAdd</a>(&nbsp;)</b>, <b><a href="./routeLib.html#mRouteDelete">mRouteDelete</a>(&nbsp;)</b>, <b><a href="./routeLib.html#routeAdd">routeAdd</a>(&nbsp;)</b><hr><a name="mRouteEntryAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>mRouteEntryAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>mRouteEntryAdd(&nbsp;)</strong> - add a protocol-specific route to the routing table </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS mRouteEntryAdd    (    long destIp,              /* destination address, network order */    long gateIp,              /* gateway address, network order */    long mask,                /* mask for destination, network order */    int  tos,                 /* type of service */    int  flags,               /* route flags */    int  proto                /* routing protocol */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>For a single destination <i>destIp</i>, this routine can add additional routes <i>gateIp</i> to the routing table.  The different routes are distinguished by the gateway, a destination mask <i>mask</i>, the type of service <i>tos</i> and associated flag values <i>flags</i>.  Valid values for <i>flags</i> are 0, <b>RTF_HOST</b>, <b>RTF_CLONING</b> (defined in <b>net/route.h</b>).The <i>proto</i> parameter identifies the protocol that generated this route.  Values for <i>proto</i> may be found in <b>m2Lib.h</b>.  The <i>tos</i> parameter takes one of following values (defined in <b>netinet/ip.h</b>): <p>&nbsp;&nbsp;&nbsp;&nbsp;<b>IPTOS_LOWDELAY</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IPTOS_THROUGHPUT</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IPTOS_RELIABILITY</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IPTOS_MINCOST</b><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>m2Lib.h</b>, <b><a href="./routeLib.html#mRouteAdd">mRouteAdd</a>(&nbsp;)</b>, <b><a href="./routeLib.html#mRouteDelete">mRouteDelete</a>(&nbsp;)</b><hr><a name="mRouteEntryDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>mRouteEntryDelete(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>mRouteEntryDelete(&nbsp;)</strong> - delete route from the routing table </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS mRouteEntryDelete    (    long destIp,              /* destination address, network order */    long gateIp,              /* gateway address, network order */    long mask,                /* mask for destination, network order */    int  tos,                 /* type of service */    int  flags,               /* route flags */    int  proto                /* routing protocol */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes a protocol-specific route from the routing table.  Specify the route using a destination <i>pDest</i>, a gateway <i>pGate</i>, a destination mask <i>mask</i>, the type of service <i>tos</i>, a <i>flags</i> value, and a <i>proto</i> value that identifies the routing protocol that added the route.  The valid values for <i>flags</i> are 0 and <b>RTF_HOST</b>  (defined in <b>net/route.h</b>).  Values for <i>proto</i> may be found in <b>m2Lib.h</b> and <i>tos</i> is one of the following values defined in <b>netinet/ip.h</b>:<p>&nbsp;&nbsp;&nbsp;&nbsp;<b>IPTOS_LOWDELA</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IPTOS_THROUGHPU</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IPTOS_RELIABILIT</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>IPTOS_MINCOST</b><p>An existing route is deleted only if it is owned by the protocol specified by <i>proto</i>.<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="mRouteDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>mRouteDelete(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>mRouteDelete(&nbsp;)</strong> - delete a route from the routing table </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS mRouteDelete    (    char * pDest,             /* destination address */    long   mask,              /* mask for destination */    int    tos,               /* type of service */    int    flags              /* either 0 or RTF_HOST */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes a routing table entry as specified by thedestination, <i>pDest</i>, the destination mask, <i>mask</i>, and type of service,<i>tos</i>.  The <i>tos</i> values are as defined in the reference entry for<b><a href="./routeLib.html#mRouteAdd">mRouteAdd</a>(&nbsp;)</b>.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>Consider the case of a route added in the following manner:<pre>    -&gt; mRouteAdd ("90.0.0.0", "91.0.0.3", 0xffffff00, 0, 0);</pre>To delete a route that was added in the above manner, call <b><a href="./routeLib.html#mRouteDelete">mRouteDelete</a>(&nbsp;)</b>as follows:<pre>    -&gt; mRouteDelete("90.0.0.0", 0xffffff00, 0);</pre>If the netmask and or type of service do not match, the routeis not deleted.<p>The value of <i>flags</i> should be <b>RTF_HOST</b> for host routes, <b>RTF_CLONING</b> forroutes which need to be cloned, and 0 in all other cases.<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><a href="./routeLib.html#mRouteAdd">mRouteAdd</a>(&nbsp;)</b></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -