tcpdump mailing list archives

Re: libpcap: patches required for OpenSolaris/SXCE


From: Guy Harris <guy () alum mit edu>
Date: Tue, 1 Dec 2009 16:44:46 -0800


On Dec 1, 2009, at 4:10 PM, Darren Reed wrote:

Use of libdladm is going to be required.

Required for what?  Enumerating capture interfaces?

libpcap uses SIOCGLIFCONF to get the list of interfaces.

...if

        1) you *don't* have getifaddrs()

and

        2) you *do* have SIOCGLIFCONF

(and 3) you're not Windows, but we're talking UN*X here).

If you have getifaddrs(), that's used (fad-getad.c); otherwise, if you have SIOCGLIFCONF, that's used (fad-glifc.c), otherwise SIOCGIFCONF is used (fad-gifc.c).

Additional fad-*.c modules can be added (on Windows, for example, it uses fad-win32.c - yes, even on Win64 :-)).

What would the appropriate APIs be on (various versions of) Solaris for enumerating interfaces and, if available, getting network addresses?

Looking at tcpdump, pcap_lookupnet() should only be called from tcpdump.c if fflag is true because the returned values of localnet and netmask are ignored
by init_addrtoname if fflag is not true.

localnet is unused if fflag is false; however, netmask is used by pcap_compile() for the "ip broadcast" filter even if fflag is false.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: