From dea6a6c1a07462890dc8bed4d048febdd13a2a3a Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 23 Oct 2014 16:52:08 +0100 Subject: [ping] Allow "ping" command output to be inhibited Originally-implemented-by: Cedric Levasseur Signed-off-by: Michael Brown --- src/hci/commands/ping_cmd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/hci') 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; -- cgit v1.2.3-55-g7522