📄 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.html"><i>VxWorks Reference Manual : Libraries</i></a></p></blockquote><h1>pingLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pingLib</strong> - Packet InterNet Grouper (PING) library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./pingLib.html#pingLibInit">pingLibInit</a></i>( )</b> - initialize the <b><i><a href="./pingLib.html#ping">ping</a></i>( )</b> utility<br><b><i><a href="./pingLib.html#ping">ping</a></i>( )</b> - test that a remote host is reachable<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains the <b><i><a href="./pingLib.html#ping">ping</a></i>( )</b> utility, which tests the reachabilityof a remote host.<p>The routine <b><i><a href="./pingLib.html#ping">ping</a></i>( )</b> is typically called from the VxWorks shell to check thenetwork connection to another VxWorks target or to a UNIX host. <b><i><a href="./pingLib.html#ping">ping</a></i>( )</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><i><a href="./pingLib.html#ping">ping</a></i>( )</b> routine is re-entrant, thus maybe called by many tasks concurrently.<p>The routine <b><i><a href="./pingLib.html#pingLibInit">pingLibInit</a></i>( )</b> initializes the <b><i><a href="./pingLib.html#ping">ping</a></i>( )</b> utility and allocatesresources used by this library. It is called automatically whenthe configuration macro <b>INCLUDE_PING</b> is defined.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pingLib.html#top">pingLib</a></b><hr><a name="pingLibInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>pingLibInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>pingLibInit</i>( )</strong> - initialize the <b><i><a href="./pingLib.html#ping">ping</a></i>( )</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><i><a href="./pingLib.html#ping">ping</a></i>( )</b> utility.It must be called before <b><i><a href="./pingLib.html#ping">ping</a></i>( )</b> is used. It is called automaticallywhen the configuration macro <b>INCLUDE_PING</b> is defined.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the <b><i><a href="./pingLib.html#ping">ping</a></i>( )</b> utility could not be initialized.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pingLib.html#top">pingLib</a></b><hr><a name="ping"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>ping</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>ping</i>( )</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><i><a href="./hostLib.html#hostAdd">hostAdd</a></i>( )</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><i><a href="./pingLib.html#ping">ping</a></i>( )</b> programmatically to examine the return status.<p><dt><b>PING_OPT_DONTROUTE</b><dd>Do not route packets past the local network.<p></blockquote><h4>NOTE</h4><blockquote><p>The following global variables can be set from the target shellor Windsh to configure the <b><i><a href="./pingLib.html#ping">ping</a></i>( )</b> parameters:<p><dt>_pingTxLen<dd>Size of the ICMP echo packet (default 64).<p><dt>_pingTxInterval<dd>Packet interval in seconds (default 1 second).<p><dt>_pingTxTmo<dd> Packet timeout in seconds (default 5 seconds).<p></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, S_pingLib_NOT_INITIALIZED, S_pingLib_TIMEOUT</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 + -