📄 arplib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/arpLib.html - generated by refgen from arpLib.c --> <title> arpLib </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>arpLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>arpLib</strong> - Address Resolution Protocol (ARP) table manipulation library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./arpLib.html#arpAdd">arpAdd</a>( )</b> - create or modify an ARP table entry<br><b><a href="./arpLib.html#arpDelete">arpDelete</a>( )</b> - remove an ARP table entry<br><b><a href="./arpLib.html#arpFlush">arpFlush</a>( )</b> - flush all entries in the system ARP table<br><b><a href="./arpLib.html#arpResolve">arpResolve</a>( )</b> - resolve a hardware address for a specified Internet address<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides direct access to the address translation tablemaintained by the Address Resolution Protocol (ARP). Each entry inthe table maps an Internet Protocol (IP) address to a physical hardware address. This library supports only those entries that translate between IP and Ethernet addresses. It is linked into the VxWorks image if <b>INCLUDE_ARP</b> is defined at the time the image is built. The underlying ARP protocol, which creates and maintains the table, is included automatically as part of the IP component.<p></blockquote><h4>RELATED INTERFACES</h4><blockquote><p>The <b><a href="./netShow.html#arpShow">arpShow</a>( )</b> routine (in the <b><a href="./netShow.html#top">netShow</a></b> library) displays the current contents of the ARP table.<p>A low -evel interface to the ARP table is available with the socket-specific SIOCSARP, SIOCDARP and SIOCGARP ioctl functions.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>arpLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./inetLib.html#top">inetLib</a></b>, <b><a href="./routeLib.html#top">routeLib</a></b>, <b><a href="./netShow.html#top">netShow</a></b><hr><a name="arpAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>arpAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>arpAdd( )</strong> - create or modify an ARP table entry</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS arpAdd ( char * pHost, /* host name or IP address */ char * pEther, /* Ethernet address */ int flags /* ARP flags */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine assigns an Ethernet address to an IP address in the ARP table.The <i>pHost</i> parameter specifies the host by name or by Internet address using standard dotted decimal notation. The <i>pEther</i> parameter provides the Ethernet address as six hexadecimal bytes (between 0 and ff) separated by colons. A new entry is created for the specified host if necessary.Otherwise, the existing entry is changed to use the given Ethernet address.<p>The <i>flags</i> parameter combines any of the following options: <dl><dt><b>ATF_PERM</b> (0x04)<dd>Create a permanent ARP entry which will not time out.<dt><b>ATF_PUBL</b> (0x08)<dd>Publish this entry. The host will respond to ARP requests even if the<i>pHost</i> parameter does not match a local IP address. This setting provides a limited form of proxy ARP.<dt><b>ATF_PROXY</b> (0x10)<dd>Use a "wildcard" hardware address. The proxy server uses this setting tosupport multiple proxy networks. The entry always supplies the hardwareaddress of the sending interface.<br> </dl></blockquote><h4>EXAMPLE</h4><blockquote><p><p>* Create a permanent ARP table entry for the host named "myHost" withEthernet address 0:80:f9:1:2:3:<pre> arpAdd ("myHost", "0:80:f9:1:2:3", 0x4);</pre>Assuming "myHost" has the Internet address "90.0.0.3", the following callchanges the Ethernet address to 0:80:f9:1:2:4. No additional flags are set for that entry.<pre> arpAdd ("90.0.0.3", "0:80:f9:1:2:4", 0);</pre></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if unsuccessful.<p></blockquote><h4>ERRNO</h4><blockquote><p><p> <b>S_arpLib_INVALID_ARGUMENT</b><br> <b>S_arpLib_INVALID_HOST</b><br> <b>S_arpLib_INVALID_ENET_ADDRESS</b><br> <b>S_arpLib_INVALID_FLAG</b><br> or results of low-level ioctl call.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./arpLib.html#top">arpLib</a></b><hr><a name="arpDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>arpDelete( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>arpDelete( )</strong> - remove an ARP table entry</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS arpDelete ( char * pHost /* host name or IP address */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes an ARP table entry. The <i>pHost</i> parameter indicatesthe target entry using the host name or Internet address.<p></blockquote><h4>EXAMPLE</h4><blockquote><p><pre> arpDelete ("91.0.0.3") arpDelete ("myHost")</pre></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if unsuccessful.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_arpLib_INVALID_ARGUMENT</b><br> <b>S_arpLib_INVALID_HOST</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./arpLib.html#top">arpLib</a></b><hr><a name="arpFlush"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>arpFlush( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>arpFlush( )</strong> - flush all entries in the system ARP table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void arpFlush (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine flushes all non-permanent entries in the ARP cache.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./arpLib.html#top">arpLib</a></b><hr><a name="arpResolve"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>arpResolve( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>arpResolve( )</strong> - resolve a hardware address for a specified Internet address</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS arpResolve ( char * targetAddr, /* name or Internet address of target */ char * pHwAddr, /* where to return the H/W address */ int numTries, /* number of times to try ARPing (-1 means */ /* try forever) */ int numTicks /* number of ticks between ARPs */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine uses the Address Resolution Protocol (ARP) and internal ARPcache to resolve the hardware address of a machine that owns the Internetaddress given in <i>targetAddr</i>.<p>The hardware address is copied to <i>pHwAddr</i> as network byte order, if theresolution of <i>targetAddr</i> is successful. <i>pHwAddr</i> must point to a bufferwhich is large enough to receive the address.<p></blockquote><h4>NOTE</h4><blockquote><p>RFC 1122 prohibits sending more than one arp request per second. AnynumTicks value that would result in a shorter time than this is ignored.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK if the address is resolved successfully, or ERROR if <i>pHwAddr</i> is NULL,<i>targetAddr</i> is invalid, or address resolution is unsuccessful.<p></blockquote><h4>ERRNO</h4><blockquote><p><p> <b>S_arpLib_INVALID_ARGUMENT</b><br> <b>S_arpLib_INVALID_HOST</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./arpLib.html#top">arpLib</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -