Home |
Function xn_add_host_table_entry Function xn_delete_host_table_entry Function xn_interface_open_config Function xn_interface_ethernet_statistics Function xn_interface_statistics Function xn_ping Function xn_send_ethernet_frame Function cb_wr_screen_string_fnc Function cb_rs232_connection_lost_fnc |
Function xn_pingSend a ping message to a host and wait for it to reply. int xn_ping(int sequence, int len, int ttl, BYTE * host, int route_type, struct _route_info * route_info, unsigned int wait_count, long * elapsed_msec); ParameterssequenceInteger sent to the host. The reply should contain this number. lenNumber of bytes to send in the packet (helps measure throughput). ttlTime-to-live to use for IP header in seconds. If 0, the default value will be used. hostIP address of the host in network byte order. route_typeIP options (0, SO_RECORD_ROUTE_OPTION, SO_LOOSE_ROUTE_OPTION, SO_STRICT_ROUTE_OPTION). See xn_ip_set_option. route_infoSpecifies routing information, i.e. addresses for LOOSE and STRICT routes and size for all routing options; also returns routing information for all routing options. See xn_ip_set_option. This parameter may be NULL. wait_countNumber of timer ticks to wait for a reply. elapsed_msecElapsed time in milliseconds after which a reply was received. This parameter may be NULL. return valueReturns 0 if the specified host replied with the correct sequence number within wait_count ticks, otherwise SOCKET_ERROR. If an error occurred, call xn_getlasterror and xn_geterror_string to return the error value. Section Error Codes further describes each error. Possible values for this function are:
This routine uses the ICMP layer to send a ping message to another network node. If the other node is up, it will echo the packet back to this node. The parameter route_type is used to set up one IP option in the ping request. If route_type is 0, the ping request will not contain any options.
|