/* ****************************************************************************** * SOURCE FILE * * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipnet_cmd_ping.c,v $ $Revision: 1.99.10.12 $ * $Source: /home/interpeak/CVSRoot/ipnet2/src/ipnet_cmd_ping.c,v $ * $Author: svc-cmnet $ * $State: Exp $ $Locker: $ * * INTERPEAK_COPYRIGHT_STRING * Design and implementation by Kenneth Jonsson ****************************************************************************** */ /* **************************************************************************** * 1 DESCRIPTION **************************************************************************** * Implements the "ping" shell command. ping uses ICMP echo * request/response messages to see if a specific node is currently * reachable. * * This version of ping also implements ICMP timestamp * request/response where each intermediate router, between this node * and the node the request is sent to, can insert the time the packet * passed through that router. * */ /* **************************************************************************** * 2 CONFIGURATION **************************************************************************** */ #ifdef IPCOM_KERNEL #undef IPCOM_KERNEL #endif #include "ipnet_config.h" /* **************************************************************************** * 3 INCLUDE FILES **************************************************************************** */ #ifdef IPCOM_USE_INET #define IPCOM_USE_CLIB_PROTO #include #include #include #include "ipnet.h" #include "ipnet_h.h" /* **************************************************************************** * 4 DEFINES **************************************************************************** */ /* **************************************************************************** * 5 TYPES **************************************************************************** */ /* **************************************************************************** * 6 EXTERN PROTOTYPES **************************************************************************** */ #ifdef IP_PORT_VXWORKS extern int ping(char *host,int numPackets,unsigned long options); #endif /* **************************************************************************** * 7 LOCAL PROTOTYPES **************************************************************************** */ /* **************************************************************************** * 8 DATA **************************************************************************** */ /* **************************************************************************** * 9 LOCAL FUNCTIONS **************************************************************************** */ /* **************************************************************************** * 10 PUBLIC FUNCTIONS **************************************************************************** */ /* *=========================================================================== * ipnet_cmd_ping *=========================================================================== * Description: * Parameters: * Returns: * */ IP_PUBLIC int ipnet_cmd_ping(int argc, char **argv) { #ifdef IP_PORT_VXWORKS int i = 0; int len = 0; char *host; int ret = IPCOM_SHELL_SUCCESS; if(argc == 1) { (void)ping(IP_NULL,0,0); ret = IPCOM_SHELL_ERR_USAGE; } else { for(i = 1;i