From 40ba2e9e613677603432ce9b3736ef13f6dabe0f Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 27 Mar 2001 06:16:11 +0000 Subject: [PATCH] Give Tethereal a "-D" flag, inspired by WinPcap's "-D" flag, which prints a list of all network interfaces it found on which it can capture (the same list as the one that shows up in the "Interface" combo box in Ethereal's "Capture Preferences" dialog). svn path=/trunk/; revision=3194 --- doc/tethereal.pod.template | 10 ++++++++++ tethereal.c | 28 +++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/doc/tethereal.pod.template b/doc/tethereal.pod.template index 95b713d0f2..001277130b 100644 --- a/doc/tethereal.pod.template +++ b/doc/tethereal.pod.template @@ -7,6 +7,7 @@ Tethereal - Dump and analyze network traffic B S<[ B<-c> count ]> +S<[ B<-D> ]> S<[ B<-f> capture filter expression ]> S<[ B<-F> file format ]> S<[ B<-h> ]> @@ -108,6 +109,15 @@ B<-r> flag was specified). Sets the default number of packets to read when capturing live data. +=item -D + +Prints a list of the interfaces on which B can capture, and +exits. Note that "can capture" means that B was able to open +that device to do a live capture; if, on your system, a program doing a +network capture must be run from an account with special privileges (for +example, as root), then, if B is run with the B<-D> flag and +is not run from such an account, it will not list any interfaces. + =item -f Sets the capture filter expression. diff --git a/tethereal.c b/tethereal.c index 661c46d201..4ba00a4069 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.70 2001/03/24 09:24:41 guy Exp $ + * $Id: tethereal.c,v 1.71 2001/03/27 06:16:10 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -145,7 +145,7 @@ print_usage(void) fprintf(stderr, "This is GNU t%s %s, compiled with %s\n", PACKAGE, VERSION, comp_info_str); #ifdef HAVE_LIBPCAP - fprintf(stderr, "t%s [ -vVhlp ] [ -c count ] [ -f ]\n", PACKAGE); + fprintf(stderr, "t%s [ -DvVhlp ] [ -c count ] [ -f ]\n", PACKAGE); fprintf(stderr, "\t[ -F ] [ -i interface ] [ -n ]\n"); fprintf(stderr, "\t[ -o ] ... [ -r infile ] [ -R ]\n"); fprintf(stderr, "\t[ -s snaplen ] [ -t