tcpdump mailing list archives

Re: Patch for handling multiple interfaces


From: Stephen Donnelly <stephen () endace com>
Date: Tue, 16 Mar 2004 18:32:50 +1300

Doesn't this patch rely solely on select? What about platforms and devices that do not support select? I notice there was no use of get_selectable_fd().

Stephen.

Guy Thornley wrote:
Hi,

Here is a patch for tcpdump to handle multiple '-i' options
semi-intelligently.

Only tested on Linux 2.4.21, glibc 2.3.2

The patch is againt 3.8.1. I also have a patch against 3.7.2, since that is
what we are still using internally, but the 3.8.1 patch is probably more
interesting for you folks. The 3.7.2 patch is available on request.

In a nutshell, multiple -i options make it do select() after performing
pcap_setnonblocking() on each pcap_t. When activity is noticed,
pcap_dispatch() is run on all devices in turn until none of the devices have
any more activity, which than falls back to select() until more activity
occurs.

A single (or no) -i option, or presence of -r makes it fall back to the
previous mechanism of pcap_loop()

All devices must have the same link type.

If theres any cleanups you would like before you are particularly
interested, let me know.

Guy Thornley

--
-----------------------------------------------------------------------
    Stephen Donnelly BCMS PhD           email: sfd () endace com
    Endace Technology Ltd               phone: +64 7 839 0540
    Hamilton, New Zealand               cell:  +64 21 1104378
-----------------------------------------------------------------------

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe


Current thread: