Bug 20907 - RFE: add option to specify all devices with '-i'
RFE: add option to specify all devices with '-i'
Product: Red Hat Raw Hide
Classification: Retired
Component: tcpdump (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
: FutureFeature
Depends On:
Blocks: 20906
  Show dependency treegraph
Reported: 2000-11-15 10:28 EST by Enrico Scholz
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-01-22 10:49:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
fix -i behaviour and documentation plus minor odds and ends (2.17 KB, patch)
2000-12-30 17:41 EST, Pekka Savola
no flags Details | Diff

  None (edit)
Description Enrico Scholz 2000-11-15 10:28:11 EST
Although tcpdump listens on all devices if called *without* '-i', there
doesn't exist a possibility to express such a request with '-i'. 

I think that's a bad style, because default values should be accessable at
the commandline also (e.g. to keep portability in scripts).


+	if ( device!=0 && (strcmp(device,"all")==0) ) device=0

shortly after the getopt()-while-switch clause in tcpdump.c would introduce
the 'all' keyword as synonym for 'all devices'.
Comment 1 Pekka Savola 2000-12-28 15:05:46 EST
reminder: a man page change would also be necessary.
Comment 2 Pekka Savola 2000-12-30 17:39:47 EST
This patch:

 * adds -i 'any' and 'all'.  'any' looks up an interface using the old algorithm.  
'all' tries to use all interfaces (no error message if used in -R where it wouldn't work).

 * changes default behaviour for -R so that 'any' is assumed (no need to always use -i anymore).

 * document some stuff in -i and -p, fix a typo.

       -i     Listen on interface.  Special keywords ``all'' or ``any'' may also be used.
              ``all'' is effective only in default, packet socket  mode.   ``any''  means
              that  tcpdump  searches  the system interface list for the lowest numbered,
              configured up interface (excluding loopback).  Ties are broken by  choosing
              the  earliest  match.   The default is ``all'' in packet and ``any'' in raw
              socket mode.
       -p     Do put the interface into promiscuous mode.  Note that legacy mode  was  to
              use  promiscuous mode by default.  tcpdump can only listen to one interface
              in promiscuous mode.  Also note that the interface might be in  promiscuous
              mode for some other reason.
Comment 3 Pekka Savola 2000-12-30 17:41:07 EST
Created attachment 6862 [details]
fix -i behaviour and documentation plus minor odds and ends
Comment 4 Pekka Savola 2000-12-30 19:50:23 EST
It seems tcpdump.org has semantics where 'any' mean "all".  In the hindsight, for the future 
compatibility it would probably be better make all and any synonyms and use something
like 'one' for the algorithm.  Oh well.
Comment 5 Pekka Savola 2000-12-31 09:45:17 EST
Changed the behaviour in patches above to 'any' and 'one' as the patch had to be modified anyway for
another reason.

Note You need to log in before you can comment on or make changes to this bug.