On Mon, Mar 20, 2000 at 02:07:19PM -0700, Paul Welchinski wrote:
> Here is a patch to show the proper interface list in Windows 95/98 as
> well as allow packet captures on WIN32 operating systems.
Checked in. (libpcap really shouldn't be getting the IP address and
netmask by looking up the host name, as
1) the lookup might fail;
2) that doesn't *really* tell you the netmask - the code in
libpcap is currently assuming you're on a class A, B, or C
network, which isn't necessarily the case;
3) it doesn't necessarily get you the right answer on a
multi-homed system;
but for now hopefully this will work better. I have a patch to the
Politecnico di Torino code that gets the (primary) IP address and
netmask for an interface from the registry on NT; however, it doesn't
seem to be in any obvious place in the registry on Windows OT, and I'm
not sure whether there's another way to get it.
Note that any other way
1) should work on vanilla W95 and NT 4.0 - e.g., we probably
don't want to require W98 or NT 4.0 with some particular
service pack;
2) must allow you to find that information out given only the
name of the interface, as that's the only input argument
passed to "pcap_lookupnet()" - e.g., a call that gives you a
list of IP addresses and netmasks *without* providing, with
each address/netmask, enough information to find out the
*name* of the interface to which it applies, where "name"
refers to the name you'd hand to "pcap_open_live()", isn't
sufficient.)