iflib.html
来自「vxworks相关论文」· HTML 代码 · 共 593 行 · 第 1/2 页
HTML
593 行
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/ifLib.html - generated by refgen from ifLib.c --> <title> ifLib </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>ifLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ifLib</strong> - network interface library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./ifLib.html#ifAddrAdd">ifAddrAdd</a></i>( )</b> - Add an interface address for a network interface<br><b><i><a href="./ifLib.html#ifAddrSet">ifAddrSet</a></i>( )</b> - set an interface address for a network interface<br><b><i><a href="./ifLib.html#ifAddrGet">ifAddrGet</a></i>( )</b> - get the Internet address of a network interface<br><b><i><a href="./ifLib.html#ifBroadcastSet">ifBroadcastSet</a></i>( )</b> - set the broadcast address for a network interface<br><b><i><a href="./ifLib.html#ifBroadcastGet">ifBroadcastGet</a></i>( )</b> - get the broadcast address for a network interface<br><b><i><a href="./ifLib.html#ifDstAddrSet">ifDstAddrSet</a></i>( )</b> - define an address for the other end of a point-to-point link<br><b><i><a href="./ifLib.html#ifDstAddrGet">ifDstAddrGet</a></i>( )</b> - get the Internet address of a point-to-point peer<br><b><i><a href="./ifLib.html#ifMaskSet">ifMaskSet</a></i>( )</b> - define a subnet for a network interface<br><b><i><a href="./ifLib.html#ifMaskGet">ifMaskGet</a></i>( )</b> - get the subnet mask for a network interface<br><b><i><a href="./ifLib.html#ifFlagChange">ifFlagChange</a></i>( )</b> - change the network interface flags<br><b><i><a href="./ifLib.html#ifFlagSet">ifFlagSet</a></i>( )</b> - specify the flags for a network interface<br><b><i><a href="./ifLib.html#ifFlagGet">ifFlagGet</a></i>( )</b> - get the network interface flags<br><b><i><a href="./ifLib.html#ifMetricSet">ifMetricSet</a></i>( )</b> - specify a network interface hop count<br><b><i><a href="./ifLib.html#ifMetricGet">ifMetricGet</a></i>( )</b> - get the metric for a network interface<br><b><i><a href="./ifLib.html#ifRouteDelete">ifRouteDelete</a></i>( )</b> - delete routes associated with a network interface<br><b><i><a href="./ifLib.html#ifunit">ifunit</a></i>( )</b> - map an interface name to an interface structure pointer<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains routines to configure the network interface parameters.Generally, each routine corresponds to one of the functions of the UNIXcommand <b>ifconfig</b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>ifLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b>, <b><a href="./hostLib.html#top">hostLib</a></b>, <i>VxWorks Programmer's Guide: Network</i><hr><a name="ifAddrAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ifAddrAdd</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ifAddrAdd</i>( )</strong> - Add an interface address for a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifAddrAdd ( char * interfaceName, /* name of interface to configure */ char * interfaceAddress, /* Internet address to assign to interface */ char * broadcastAddress, /* broadcast address to assign to interface */ int subnetMask /* subnetMask */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine assigns an Internet address to a specified network interface.The Internet address can be a host name or a standard Internet addressformat (e.g., 90.0.0.4). If a host name is specified, it should alreadyhave been added to the host table with <b><i><a href="./hostLib.html#hostAdd">hostAdd</a></i>( )</b>.<p>interfaceName, interfaceAddress must be specified.broadcastAddress is optional. If broadcastAddress is NULL,<b><i>in_ifinit</i>( )</b> will generate a broadcastAddress by using the interfaceAddressand the netmask. subnetMask is optional. If subnetMask is 0, <b><i>in_ifinit</i>( )</b>will set a subnetMask as same as a netmask which is generated by theinterfaceAddress. broadcastAddress is also destAddress in case of<b>IFF_POINTOPOINT</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the interface cannot be set.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b>, <b><i><a href="./ifLib.html#ifAddrGet">ifAddrGet</a></i>( )</b>, <b><i><a href="./ifLib.html#ifDstAddrSet">ifDstAddrSet</a></i>( )</b>, <b><i><a href="./ifLib.html#ifDstAddrGet">ifDstAddrGet</a></i>( )</b><hr><a name="ifAddrSet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ifAddrSet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ifAddrSet</i>( )</strong> - set an interface address for a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifAddrSet ( char * interfaceName, /* name of interface to configure, i.e. ei0 */ char * interfaceAddress /* Internet address to assign to interface */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine assigns an Internet address to a specified network interface.The Internet address can be a host name or a standard Internet addressformat (e.g., 90.0.0.4). If a host name is specified, it should alreadyhave been added to the host table with <b><i><a href="./hostLib.html#hostAdd">hostAdd</a></i>( )</b>.<p>A successful call to <b><i><a href="./ifLib.html#ifAddrSet">ifAddrSet</a></i>( )</b> results in the addition of a new route.<p>The subnet mask used in determining the network portion of the address willbe that set by <b><i><a href="./ifLib.html#ifMaskSet">ifMaskSet</a></i>( )</b>, or the default class mask if <b><i><a href="./ifLib.html#ifMaskSet">ifMaskSet</a></i>( )</b> has notbeen called. It is standard practice to call <b><i><a href="./ifLib.html#ifMaskSet">ifMaskSet</a></i>( )</b> prior to calling<b><i><a href="./ifLib.html#ifAddrSet">ifAddrSet</a></i>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the interface cannot be set.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b>, <b><i><a href="./ifLib.html#ifAddrGet">ifAddrGet</a></i>( )</b>, <b><i><a href="./ifLib.html#ifDstAddrSet">ifDstAddrSet</a></i>( )</b>, <b><i><a href="./ifLib.html#ifDstAddrGet">ifDstAddrGet</a></i>( )</b><hr><a name="ifAddrGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ifAddrGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ifAddrGet</i>( )</strong> - get the Internet address of a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifAddrGet ( char * interfaceName, /* name of interface, i.e. ei0 */ char * interfaceAddress /* buffer for Internet address */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the Internet address of a specified network interface andcopies it to <i>interfaceAddress</i>. This pointer should point to a bufferlarge enough to contain <b>INET_ADDR_LEN</b> bytes.<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><i><a href="./ifLib.html#ifAddrSet">ifAddrSet</a></i>( )</b>, <b><i><a href="./ifLib.html#ifDstAddrSet">ifDstAddrSet</a></i>( )</b>, <b><i><a href="./ifLib.html#ifDstAddrGet">ifDstAddrGet</a></i>( )</b><hr><a name="ifBroadcastSet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ifBroadcastSet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ifBroadcastSet</i>( )</strong> - set the broadcast address for a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifBroadcastSet ( char * interfaceName, /* name of interface to assign, i.e. ei0 */ char * broadcastAddress /* broadcast address to assign to interface */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine assigns a broadcast address for the specified network interface.The broadcast address must be a string in standard Internet address format(e.g., 90.0.0.0).<p>An interface's default broadcast address is its Internet address with ahost part of all ones (e.g., 90.255.255.255). This conforms to currentARPA specifications. However, some older systems use an Internet addresswith a host part of all zeros as the broadcast address.<p></blockquote><h4>NOTE</h4><blockquote><p>VxWorks automatically accepts a host part of all zeros as a broadcastaddress, in addition to the default or specified broadcast address. Butif VxWorks is to broadcast to older systems using a host part of all zerosas the broadcast address, this routine should be used to change thebroadcast address of the interface.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ifLib.html#top">ifLib</a></b><hr><a name="ifBroadcastGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ifBroadcastGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ifBroadcastGet</i>( )</strong> - get the broadcast address for a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifBroadcastGet ( char * interfaceName, /* name of interface, i.e. ei0 */ char * broadcastAddress /* buffer for broadcast address */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the broadcast address for a specified network interface.The broadcast address is copied to the buffer <i>broadcastAddress</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><i><a href="./ifLib.html#ifBroadcastSet">ifBroadcastSet</a></i>( )</b><hr><a name="ifDstAddrSet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ifDstAddrSet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ifDstAddrSet</i>( )</strong> - define an address for the other end of a point-to-point link</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifDstAddrSet ( char * interfaceName, /* name of interface to configure, i.e. ei0 */ char * dstAddress /* Internet address to assign to destination */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine assigns the Internet address of a machine connected to theopposite end of a point-to-point network connection, such as a SLIPconnection. Inherently, point-to-point connection-oriented protocols such asSLIP require that addresses for both ends of a connection be specified.<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><i><a href="./ifLib.html#ifAddrSet">ifAddrSet</a></i>( )</b>, <b><i><a href="./ifLib.html#ifDstAddrGet">ifDstAddrGet</a></i>( )</b><hr><a name="ifDstAddrGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ifDstAddrGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ifDstAddrGet</i>( )</strong> - get the Internet address of a point-to-point peer</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifDstAddrGet ( char * interfaceName, /* name of interface, i.e. ei0 */ char * dstAddress /* buffer for destination address */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the Internet address of a machine connected to theopposite end of a point-to-point network connection. The Internet address iscopied to the buffer <i>dstAddress</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><i><a href="./ifLib.html#ifDstAddrSet">ifDstAddrSet</a></i>( )</b>, <b><i><a href="./ifLib.html#ifAddrGet">ifAddrGet</a></i>( )</b><hr><a name="ifMaskSet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ifMaskSet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ifMaskSet</i>( )</strong> - define a subnet for a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ifMaskSet ( char * interfaceName, /* name of interface to set mask for, i.e. ei0 */ int netMask /* subnet mask (e.g. 0xff000000) */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allocates additional bits to the network portion of anInternet address. The network portion is specified with a mask that mustcontain ones in all positions that are to be interpreted as the networkportion. This includes all the bits that are normally interpreted as thenetwork portion for the given class of address, plus the bits to be added.Note that all bits must be contiguous. The mask is specified in host byteorder.<p>In order to correctly interpret the address, a subnet mask should be setfor an interface prior to setting the Internet address of the interfacewith the routine <b><i><a href="./ifLib.html#ifAddrSet">ifAddrSet</a></i>( )</b>.<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><i><a href="./ifLib.html#ifAddrSet">ifAddrSet</a></i>( )</b><hr><a name="ifMaskGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?