5.8. ping — Ping

5.8.1. Debug file system commands

One debug file system command is available, located in the directory inet/ping/.

Command Description
ping <remote host> Ping a remote host by given ip address.

Example output from the shell:

$ inet/ping/ping 192.168.1.100
Successfully pinged '192.168.1.100' in 10 ms.
$

Source code: src/inet/ping.h, src/inet/ping.c

Test code: tst/inet/ping/main.c

Test coverage: src/inet/ping.c


Functions

int ping_module_init(void)
int ping_host_by_ip_address(struct inet_ip_addr_t *address_p, struct time_t *timeout_p, struct time_t *round_trip_time_p)

Ping host by given ip address. Send an echo request packet to given host and wait for the echo reply packet. No extra payload data is transmitted, only the ICMP header.

Return
zero(0) or negative error code.
Parameters
  • address_p: IP address of the host to ping.
  • timeout_p: Number of seconds to wait for the echo reply packet.
  • round_trip_time_p: The time it took from sending the echo request packet to receiving the echo reply packet. Only valid if this functions returns zero(0).