📄 pinglib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/pingLib.html - generated by refgen from pingLib.c --> <title> pingLib </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>pingLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pingLib</strong> - Packet InterNet Groper (PING) library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./pingLib.html#pingLibInit">pingLibInit</a>( )</b> - initialize the <b><a href="./pingLib.html#ping">ping</a>( )</b> utility<br><b><a href="./pingLib.html#ping">ping</a>( )</b> - test that a remote host is reachable<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains the <b><a href="./pingLib.html#ping">ping</a>( )</b> utility, which tests the reachabilityof a remote host.<p>The routine <b><a href="./pingLib.html#ping">ping</a>( )</b> is typically called from the VxWorks shell to check thenetwork connection to another VxWorks target or to a UNIX host. <b><a href="./pingLib.html#ping">ping</a>( )</b>may also be used programmatically by applications that require such a test.The remote host must be running TCP/IP networking code that responds toICMP echo request packets. The <b><a href="./pingLib.html#ping">ping</a>( )</b> routine is re-entrant, thus maybe called by many tasks concurrently.<p>The routine <b><a href="./pingLib.html#pingLibInit">pingLibInit</a>( )</b> initializes the <b><a href="./pingLib.html#ping">ping</a>( )</b> utility and allocatesresources used by this library. It is called automatically when<b>INCLUDE_PING</b> is defined.<hr><a name="pingLibInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>pingLibInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pingLibInit( )</strong> - initialize the <b><a href="./pingLib.html#ping">ping</a>( )</b> utility</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS pingLibInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allocates resources used by the <b><a href="./pingLib.html#ping">ping</a>( )</b> utility.It is called automatically when <b>INCLUDE_PING</b> is defined.<p></blockquote><h4>RETURNS</h4><blockquote><p><p></blockquote><h4>OK</h4><blockquote><p>SEE ALSO<b><a href="./pingLib.html#top">pingLib</a></b><hr><a name="ping"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>ping( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ping( )</strong> - test that a remote host is reachable</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ping ( char * host, /* host to ping */ int numPackets, /* number of packets to receive */ ulong_t options /* option flags */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine tests that a remote host is reachable by sending ICMPecho request packets, and waiting for replies. It may called fromthe VxWorks shell as follows:<pre> -> ping "remoteSystem", 1, 0</pre>where <i>remoteSystem</i> is either a host name that has been previously addedto the remote host table by a call to <b><a href="./hostLib.html#hostAdd">hostAdd</a>( )</b>, or an Internet address indot notation (for example, "90.0.0.2").<p>The second parameter, <i>numPackets</i>, specifies the number of ICMP packetsto receive from the remote host. If <i>numPackets</i> is 1, this routine waitsfor a single echo reply packet, and then prints a short messageindicating whether the remote host is reachable. For all other valuesof <i>numPackets</i>, timing and sequence information is printed as echoedpackets are received. If <i>numPackets</i> is 0, this routine runs continuously.<p>If no replies are received within a 5-second timeout period, theroutine exits. An ERROR status is returned if no echo repliesare received from the remote host.<p>The following flags may be given through the <i>options</i> parameter:<dl><dt><b>PING_OPT_SILENT</b><dd>Suppress output. This option is useful for applications that use <b><a href="./pingLib.html#ping">ping</a>( )</b> programmatically to examine the return status.<dt><b>PING_OPT_DONTROUTE</b><dd>Do not route packets past the local network. This also prevents pinginglocal addresses (i.e. the IP address of the host itself). The 127.x.x.x addresses will still work however.<dt><b>PING_OPT_NOHOST</b><dd>Suppress host lookup. This is useful when you have the DNS resolverbut the DNS server is down and not returning host names.<dt><b>PING_OPT_DEBUG</b><dd>Enables debug output.<p></blockquote><h4>NOTE</h4><blockquote><p>The following global variables can be set from the target shellor Windsh to configure the <b><a href="./pingLib.html#ping">ping</a>( )</b> parameters:<dt>_pingTxLen<dd>Size of the ICMP echo packet (default 64).<dt>_pingTxInterval<dd>Packet interval in seconds (default 1 second).<dt>_pingTxTmo<dd>Packet timeout in seconds (default 5 seconds).<p><br> </dl></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the remote host is not reachable.<p></blockquote><h4>ERRNO</h4><blockquote><p>EINVAL, <b>S_pingLib_NOT_INITIALIZED</b>, <b>S_pingLib_TIMEOUT</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pingLib.html#top">pingLib</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -