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

📄 routeentrylib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/routeEntryLib.html - generated by refgen from routeEntryLib.c --> <title> routeEntryLib </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>routeEntryLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>routeEntryLib</strong> - route interface library for multiple matching entries </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./routeEntryLib.html#routeModify">routeModify</a>(&nbsp;)</b>  -  change an entry in the routing table<br><b><a href="./routeEntryLib.html#routeEntryAdd">routeEntryAdd</a>(&nbsp;)</b>  -  insert a route in the routing table<br><b><a href="./routeEntryLib.html#routeEntryDel">routeEntryDel</a>(&nbsp;)</b>  -  remove a route from the routing table<br><b><a href="./routeEntryLib.html#routeTableWalk">routeTableWalk</a>(&nbsp;)</b>  -  traverse the IP routing table<br><b><a href="./routeEntryLib.html#routeEntryLookup">routeEntryLookup</a>(&nbsp;)</b>  -  find a matching route for a destination<br><hr><a name="routeModify"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>routeModify(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>routeModify(&nbsp;)</strong> - change an entry in the routing table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS routeModify    (    ROUTE_DESC *      pRouteDesc, /* information for matching route */    struct sockaddr * pNewGateway /* new gateway, NULL if unchanged */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine searches the routing table for an entry which matches thedestination address and netmask in the <i>pRouteDesc</i> structure. If theroute descriptor structure does not include a netmask, it selects thelongest netmask for the matching destination. A netmask value of zerosearches for a host-specific route to the destination. A protocol IDof zero selects the first entry which matches the destination addressand any netmask value. Otherwise, the search finds the route with thespecified protocol. The retrieved route also matches any specified gatewayvalue.<p>The <i>pNewGateway</i> argument supplies an optional replacement gateway address.The new address must be reachable through one of the local interfaces orthe modification fails. The modification also fails if the destinationaddress is not specified or if no route which matches the search criteriais found.<p>Once a route is chosen, this routine replaces the current metric values,route weight, and route tag with the corresponding entries in the<i>pRouteDesc</i> structure. The pointers for the interface and additionaldata in the <i>pRouteDesc</i> argument are not used. The route flags are alsonot changed.<p></blockquote><h4>NOTE</h4><blockquote><p>Changing the weight of a route will reorganize any duplicate routes<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;may&nbsp;alter&nbsp;which&nbsp;entry&nbsp;is&nbsp;visible&nbsp;to&nbsp;the&nbsp;IP&nbsp;forwarding&nbsp;process.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if a route is found and changed, or ERROR otherwise.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./routeEntryLib.html#top">routeEntryLib</a></b><hr><a name="routeEntryAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>routeEntryAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>routeEntryAdd(&nbsp;)</strong> - insert a route in the routing table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS routeEntryAdd    (    ROUTE_DESC * pRouteDesc   /* information for new route entry */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a route to the routing table. The <i>pRouteDesc</i> argumentmust include a destination address, gateway, and protocol identifier. Ifthat argument does not include a netmask or specifies a netmask value of 0,the system creates a host-specific route entry. The <i>value1</i> through<i>value5</i>, and <i>routeTag</i> fields store arbitrary values for the new entry.The required <i>weight</i> field indicates the relative priority of the route(from 1 to 255) in case other entries to the same destination exist. Theroute with the lowest weight is visible to the IP forwarding process. Avalue of 0 will create an entry with the default weight value.<p>This routine ignores any values in the <i>flags</i>, <i>pIf</i>, and <i>pData</i> fieldsin the provided structure. If the add attempt is successful, the systemsends callback messages and routing socket messages announcing theexistence of the new route.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK on success and ERROR on failure.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./routeEntryLib.html#top">routeEntryLib</a></b><hr><a name="routeEntryDel"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>routeEntryDel(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>routeEntryDel(&nbsp;)</strong> - remove a route from the routing table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS routeEntryDel    (    ROUTE_DESC * pRouteDesc   /* information for deleted route */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes a route in the routing table. The <i>pRouteDesc</i> argumentmust include a destination address. If that argument does not include a netmask or specifies a netmask value of 0, the system attempts to deletea host-specific route to the destination. If a route which matches thedestination and netmask exists, a protocol ID of zero attempts to deletethat entry (which is visible to the IP forwarding process) if the gatewayvalue is not equal to zero. Otherwise, the system attempts to remove thefirst (lowest weight) entry which matches the provided protocol, or aspecific entry within the first protocol group which also matches thesupplied gateway address.<p></blockquote><h4>NOTE</h4><blockquote><p>This routine stores the actual gateway value in the <i>pRouteDesc</i>structure, so the corresponding buffer must be supplied even if nospecific value is assigned. This routine does not use any fields inthe <i>pRouteDesc</i> structure except the destination, gateway, netmask andprotocol ID.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK on success, ERROR on failure</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./routeEntryLib.html#top">routeEntryLib</a></b><hr><a name="routeTableWalk"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>routeTableWalk(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>routeTableWalk(&nbsp;)</strong> - traverse the IP routing table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS routeTableWalk    (    struct sockaddr * pDest,   /* destination address, or NULL if none. */    int               protoId, /* route source, or 0 for any. */    VOIDFUNCPTR       pFunc,   /* callback function */    void *            pArg     /* optional callback function argument */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine applies the provided function to every entry in theIP routing table which meets the criteria indicated by the <i>pDest</i>and <i>protoId</i> arguments. If a destination address is specified,the given function executes for each route table entry which matchesthe destination. If a protocol identifer is supplied, the functionexecutes for each entry created by the protocol instead. If no valueis specified, the routine displays every entry in the table.The supplied argument <i>pArg</i> is passed back to callback function.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if traversal completes, or ERROR otherwise.<p></blockquote><h4>NOTE</h4><blockquote><p>Only one of the two values <i>pDest</i> and <i>protoId</i> should be specified.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifying&nbsp;both&nbsp;results&nbsp;in&nbsp;ERROR&nbsp;being&nbsp;returned.<p></blockquote><h4>NOTE</h4><blockquote><p>The provided routine executes while the system holds internal locks<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;restrict&nbsp;all&nbsp;network&nbsp;stack&nbsp;activity&nbsp;and&nbsp;any&nbsp;routing&nbsp;operations<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;the&nbsp;calling&nbsp;task.&nbsp;That&nbsp;routine&nbsp;MUST&nbsp;NOT&nbsp;perform&nbsp;any&nbsp;operations<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;alter&nbsp;the&nbsp;existing&nbsp;routing&nbsp;table.&nbsp;This&nbsp;walk&nbsp;routine&nbsp;relies&nbsp;on<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;fixed&nbsp;order&nbsp;of&nbsp;all&nbsp;route&nbsp;entries&nbsp;to&nbsp;complete.&nbsp;Creating&nbsp;or&nbsp;removing<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;route&nbsp;entries&nbsp;could&nbsp;corrupt&nbsp;the&nbsp;table,&nbsp;causing&nbsp;the&nbsp;calling&nbsp;task&nbsp;to<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enter&nbsp;an&nbsp;endless&nbsp;loop&nbsp;or&nbsp;halt&nbsp;completely.&nbsp;That&nbsp;behavior&nbsp;would<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deadlock&nbsp;the&nbsp;entire&nbsp;network&nbsp;system,&nbsp;since&nbsp;other&nbsp;tasks&nbsp;would&nbsp;wait<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;indefinitely&nbsp;for&nbsp;the&nbsp;unavailable&nbsp;locks.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./routeEntryLib.html#top">routeEntryLib</a></b><hr><a name="routeEntryLookup"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>routeEntryLookup(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>routeEntryLookup(&nbsp;)</strong> - find a matching route for a destination</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS routeEntryLookup    (    struct sockaddr * pDest,     /* IP address reachable with matching route */    ULONG *           pMask,     /* netmask value, in network byte order */    int               protoId,   /* route source from m2Lib.h, or 0 for any. */    ROUTE_DESC *      pRouteDesc /* information for matching route */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine searches the routing table for an entry which covers thespecified destination address. It provides four types of searches basedon the values of the <i>protoId</i> and <i>pMask</i> arguments.<p>If no mask is present (<i>pMask</i> is NULL) the search finds the matchingentry with the longest netmask. Otherwise, the search ignores entries whosenetmasks permit a match against the destination but do not equal the givenvalue. Likewise, if <i>protoId</i> is not zero, the search restricts the possiblematches to the specified route source.<p>Mask values of zero and 0xffffffff both indicate a host-specific route.<p>If neither value is specified, the search duplicates the results of theIP forwarding process for the destination (assuming no type-of-servicematch is required). It retrieves the matching entry with the longestnetmask, regardless of the source which created it.<p>In all cases, if multiple entries match the search criteria, this routineselects the oldest one.<p>The chosen entry is copied into the supplied <i>pRouteDesc</i> structure, whichis not modified if the search fails.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if a route is found, or ERROR otherwise.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./routeEntryLib.html#top">routeEntryLib</a></b></body></html>

⌨️ 快捷键说明

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