📄 iflib.html
字号:
OK or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b>, <b><a href="./ifLib.html#ifFlagChange">ifFlagChange</a>( )</b>, <b><a href="./ifLib.html#ifFlagGet">ifFlagGet</a>( )</b><hr><a name="ifFlagGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ifFlagGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ifFlagGet( )</strong> - get the network interface flags</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifFlagGet ( char * interfaceName, /* name of the network interface, i.e. ei0 */ int * flags /* network flags returned here */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the flags for a specified network interface.The flags are copied to the buffer <i>flags</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b>, <b><a href="./ifLib.html#ifFlagSet">ifFlagSet</a>( )</b><hr><a name="ifMetricSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ifMetricSet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ifMetricSet( )</strong> - specify a network interface hop count</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifMetricSet ( char * interfaceName, /* name of the network interface, i.e. ei0 */ int metric /* metric for this interface */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine configures <i>metric</i> for a network interface from the hostmachine to the destination network. This information is used primarily bythe IP routing algorithm to compute the relative distance for a collectionof hosts connected to each interface. For example, a higher <i>metric</i> forSLIP interfaces can be specified to discourage routing a packet to slowerserial line connections. Note that when <i>metric</i> is zero, the IP routingalgorithm allows for the direct sending of a packet having an IP networkaddress that is not necessarily the same as the local network address.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b>, <b><a href="./ifLib.html#ifMetricGet">ifMetricGet</a>( )</b><hr><a name="ifMetricGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ifMetricGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ifMetricGet( )</strong> - get the metric for a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifMetricGet ( char * interfaceName, /* name of the network interface, i.e. ei0 */ int * pMetric /* returned interface's metric */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine retrieves the metric for a specified network interface.The metric is copied to the buffer <i>pMetric</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b>, <b><a href="./ifLib.html#ifMetricSet">ifMetricSet</a>( )</b><hr><a name="ifRouteDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ifRouteDelete( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ifRouteDelete( )</strong> - delete routes associated with a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int ifRouteDelete ( char * ifName, /* name of the interface */ int unit /* unit number for this interface */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes all routes that have been associated with thespecified interface. A route is associated with an interface if its destination equals to the assigned address, or network number. This routinedoes not remove routes to arbitrary destinations that through thegiven interface.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The number of routes deleted, or ERROR if an interface is not specified.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b><hr><a name="ifAllRoutesDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ifAllRoutesDelete( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ifAllRoutesDelete( )</strong> - delete all routes associated with a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int ifAllRoutesDelete ( char * ifName, /* name of the interface */ int unit /* unit number for this interface */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes all routes that have been associated with thespecified interface. The routes deleted are:<table></tr><tr valign=top><td>- <td>the network route added when the interface address is initialized</tr><tr valign=top><td>- <td>the static routes added by the administrator</tr><tr valign=top><td>- <td>ARP routes passing through the interface</table>Routes added by routing protocols are not deleted.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The number of routes deleted, or ERROR if an interface is not specified.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b><hr><a name="ifunit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ifunit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ifunit( )</strong> - map an interface name to an interface structure pointer</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>struct ifnet *ifunit ( char * ifname /* name of the interface */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns a pointer to a network interface structure for <i>name</i> orNULL if no such interface exists. For example:<pre> struct ifnet *pIf; ... pIf = ifunit ("ln0");</pre><b>pIf</b> points to the data structure that describes the first network interfacedevice if ln0 is mapped successfully.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>A pointer to the interface structure, or NULL if an interface is notfound.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b><hr><a name="ifNameToIfIndex"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ifNameToIfIndex( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ifNameToIfIndex( )</strong> - returns the interface index given the interface name</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>unsigned short ifNameToIfIndex ( char * ifName /* a string describing the full interface */ /* name. e.g., "fei0" */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the interface index for the interface named by the <i>ifName</i> parameter, which proviedes a string describing the full interface name. For example, "fei0".<p></blockquote><h4>RETURNS</h4><blockquote><p>The interface index, if the interface could be located, 0, otherwise. 0 is not a valid value for interface index.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b><hr><a name="ifIndexToIfName"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ifIndexToIfName( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ifIndexToIfName( )</strong> - returns the interface name given the interface index</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifIndexToIfName ( unsigned short ifIndex, /* Interface index */ char * ifName /* Where the name is to be stored */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the interface name for the interface referencedby the <i>ifIndex</i> parameter. <p><dl><dt><i>ifIndex</i><dd> The index for the interface.<dt><i>ifName</i><dd> The location where the interface name is copied</dl></blockquote><h4>RETURNS</h4><blockquote><p>OK on success, ERROR otherwise.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -