summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Schwebel <r.schwebel@pengutronix.de>2010-12-13 21:15:15 +0100
committerRobert Schwebel <r.schwebel@pengutronix.de>2010-12-17 21:28:41 +0100
commitdcff25c26aee79135b67190ca95b1a912c8b74aa (patch)
treefbc64d67ca0a053e58d29df0691ff0bf7aa169f7
parente1b089a07c3c836b7ac1443616123f9754e459af (diff)
downloadbarebox-dcff25c26aee79135b67190ca95b1a912c8b74aa.tar.gz
barebox-dcff25c26aee79135b67190ca95b1a912c8b74aa.tar.xz
doc: add documentation for 'ping' command
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
-rw-r--r--Documentation/commands.dox2
-rw-r--r--net/ping.c16
2 files changed, 17 insertions, 1 deletions
diff --git a/Documentation/commands.dox b/Documentation/commands.dox
index 438d33ef..9638728a 100644
--- a/Documentation/commands.dox
+++ b/Documentation/commands.dox
@@ -80,7 +80,7 @@ available in @a Barebox:
@li @subpage nand_boot_test
@li @subpage nfs
@li @subpage passwd
-@li @subpage ping
+@li @subpage ping_command
@li @subpage printenv_command
@li @subpage protect_command
@li @subpage pwd_command
diff --git a/net/ping.c b/net/ping.c
index d414784e..c46a1149 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -107,7 +107,23 @@ out:
return ping_state == PING_STATE_SUCCESS ? 0 : 1;
}
+BAREBOX_CMD_HELP_START(ping)
+BAREBOX_CMD_HELP_USAGE("ping HOST\n")
+BAREBOX_CMD_HELP_SHORT("Send ICMP echo request to network host.\n")
+BAREBOX_CMD_HELP_END
+
+/**
+ * @page ping_command
+
+<p> HOST can be an IP address or a host name. If a host name is
+specified, barebox tries to resolve that host name and exits with a
+failure if not successful. If the host didn't answer for 10 seconds,
+ping exits with a failure. </p>
+
+ */
+
BAREBOX_CMD_START(ping)
.cmd = do_ping,
.usage = "ping <destination>",
+ BAREBOX_CMD_HELP(cmd_ping_help)
BAREBOX_CMD_END