5.7. ping — Ping

5.7.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
Successfully pinged '' 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


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.

zero(0) or negative error code.
  • 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).