ping
所属分类:VxWorks
开发工具:C/C++
文件大小:4KB
下载次数:65
上传日期:2008-06-19 15:10:37
上 传 者:
200433
说明: vxworks 下的网络程序源码--PING源代码
(VxWorks under the network program source code- PING source code)
文件列表:
ping\vxPing.c (10318, 2002-07-17)
ping (0, 2008-06-19)
FILE LIST -
vxPing.c
DESCRIPTION -
ping - sends ICMP ECHO_REPLY packets to a particular network host to
elicit an ICMP ECHO_RESPONSE from that specified network host
and prints " is alive" on the standard output if the host
responds; otherwise prints ICMP error messages.
When using ping, make sure the host you want to ping is already
in the host table. If not, add the host to the host table using
hostAdd. If the host you want to ping is in a different network
than your VxWorks system, make sure route is established to that
host. If the route is not already established, use routeAdd to add
the route.
RUNNING DEMO -
Place the vxPing.c file in your dir. Depending on the
target you have, define the CPU in your compile line and use
the Makefile in the agent dir. to compile.
Run ping() on vxworks target.
TESTED ON - Host/Target : Solaris 2.5.1 / mv1604
VxWorks : 5.3.1
EXAMPLE COMPILE LINE -
make CPU=PPC604 vxPing.o
% make CPU=PPC604 vxPing.o
ccppc -B/petaluma1/mayur/tor101-ppc/host/sun4-solaris2/lib/gcc-lib/
-mstrict-align -ansi -nostdinc -O2 -fvolatile -fno-builtin -fno-for-scope
-Wall -I/h -I. -I/petaluma1/mayur/tor101-ppc/target/config/all
-I/petaluma1/mayur/tor101-ppc/target/h
-I/petaluma1/mayur/tor101-ppc/target/src/config
-I/petaluma1/mayur/tor101-ppc/target/src/drv -DCPU=PPC604 -DMV1600 -DTARGET_DIR="\"mv1604\"" -g -O0 -c vxPing.c
OUTPUTS/LOGFILE -
On VxWorks target:
==================
-> ld vxPing("petaluma",5)
value = 0 = 0x0
Output on the console:
======================
Name of the host to ping is -> petaluma
wrote petaluma 28 bytes, return = 28
wrote petaluma 28 bytes, return = 28
wrote petaluma 28 bytes, return = 28
wrote petaluma 28 bytes, return = 28
wrote petaluma 28 bytes, return = 28
host petaluma is alive
近期下载者:
相关文件:
收藏者: