summaryrefslogtreecommitdiffstats
path: root/src/hci
diff options
context:
space:
mode:
authorMichael Brown2014-10-23 17:52:08 +0200
committerMichael Brown2014-10-23 17:52:08 +0200
commitdea6a6c1a07462890dc8bed4d048febdd13a2a3a (patch)
tree9bee6d8e8215e0c73ea4a5f4f38b77a8c0bf5d74 /src/hci
parent[ping] Allow termination after a specified number of packets (diff)
downloadipxe-dea6a6c1a07462890dc8bed4d048febdd13a2a3a.tar.gz
ipxe-dea6a6c1a07462890dc8bed4d048febdd13a2a3a.tar.xz
ipxe-dea6a6c1a07462890dc8bed4d048febdd13a2a3a.zip
[ping] Allow "ping" command output to be inhibited
Originally-implemented-by: Cedric Levasseur <cyr-ius@ipocus.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci')
-rw-r--r--src/hci/commands/ping_cmd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/hci/commands/ping_cmd.c b/src/hci/commands/ping_cmd.c
index 92c5443a..34807696 100644
--- a/src/hci/commands/ping_cmd.c
+++ b/src/hci/commands/ping_cmd.c
@@ -50,6 +50,8 @@ struct ping_options {
unsigned long timeout;
/** Number of packets to send (or zero for no limit) */
unsigned int count;
+ /** Inhibit output */
+ int quiet;
};
/** "ping" option list */
@@ -60,6 +62,8 @@ static struct option_descriptor ping_opts[] = {
struct ping_options, timeout, parse_timeout ),
OPTION_DESC ( "count", 'c', required_argument,
struct ping_options, count, parse_integer ),
+ OPTION_DESC ( "quiet", 'q', no_argument,
+ struct ping_options, quiet, parse_flag ),
};
/** "ping" command descriptor */
@@ -92,7 +96,7 @@ static int ping_exec ( int argc, char **argv ) {
/* Ping */
if ( ( rc = ping ( hostname, opts.timeout, opts.size,
- opts.count ) ) != 0 )
+ opts.count, opts.quiet ) ) != 0 )
return rc;
return 0;