19#pragma comment(lib,"libIP.lib")
23 if (command->
length - index < 2)
25 send_message(info,
"USAGE: ping deviceName or ping IPAddress\n");
36 send_message(info,
"%s is not a valid IP address or valid device name.\n",
55 int len = (int)strlen(msg);
79 send_message(info,
"%s IP is not associated with any device.\n",
85 if (ipVar && !ipVar->
isICMP)
87 send_message(info,
"ICMP is not configured for device %d.\n", d);
92 if (ipVar && !ipVar->
isICMP)
94 send_message(info,
"ICMP is not configured for device %d.\n", dest);
bool isCommandAsDeviceName(char *name)
void send_message(ptrCLIENTINFO info, char *msg,...)
void * ICMP_StartPingRequest(NETSIM_ID src, NETSIM_ID dest, UINT count, bool(*resp)(void *, char *, bool), void *arg)
bool isValidIPAddress(char *ip)
NETSIM_IPAddress STR_TO_IP(char *ipStr, int type)
int STR_GET_IP_TYPE(char *ip)
void execute_ping_command(ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index, NETSIM_ID d)
bool validate_ping_command(ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index)
bool resp(ptrCLIENTINFO info, char *msg, bool isMore)
NETSIM_ID fn_NetSim_Stack_GetDeviceId_asName(const char *name)
NETSIM_ID fn_NetSim_Stack_GetDeviceId_asIP(NETSIM_IPAddress ip, NETSIM_ID *nInterfaceId)
Structure to store the device ip details.
union stru_clientInfo::client CLIENT
bool(* multResp)(void *, char *, int, bool)
SOCKCLIENTINFO sockClient