Ethereal-dev: Re: [ethereal-dev] SIOCGIFCONF

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Wed, 6 Sep 2000 14:36:01 -0700
On Wed, Sep 06, 2000 at 08:37:40AM -0600, Warren Young wrote:
> That gets you mainly IP addresses, masks, flags and other things.  If
> instead you need adapter _names_,

...which both Ethereal and libpcap do (Ethereal to fill in the combo box
in the capture dialog, libpcap to get the name of the "default"
interface in "pcap_lookupdev()" for use by programs such as tcpdump that
don't get the full list of interfaces and pick a default themselves, as
Ethereal does)...

> you can use GetInterfaceInfo(), part
> of the IP Helper API on Windows 98 and Windows 2000.

...which doesn't help on W95 or NT 4.0.

> Or, there's the
> harder-to-use GetIfEntry(), which works on those two platforms, and on
> WinNT 4 SP4+ as well.

...which doesn't help on W95 or NT 4.0 prior to SP4.

I.e., what libpcap (and Ethereal, unless and until libpcap gets an
"return a list of interface names and information" API or, on platforms
lacking "getifaddrs()", provides its own implementation of that) needs
is a call to get adapter names, flags (if the flags can be interpreted
in the way they're interpreted on UNIX), IP addresses, and masks...

...and it needs one that works on all platforms supported by WinPcap,
including Windows 95 and all versions of NT 4.0.  It sounds as if there
isn't such a mechanism.

> Who says Windows is "unified"?

I certainly don't - Microsoft have two independent implementations of
(the common subset of) the Win32 API and ABI, Windows OT and Windows NT,
and there are also different releases of those implementations (although
the latter is a problem hardly unique to Windows; you can also get
bitten by some feature existing in release N+1 of some flavor of UNIX
but not existing in release N of that flavor).