[Winpcap-users] Telling the difference between devices

Guy Harris guy at alum.mit.edu
Wed Nov 21 09:46:44 PST 2012

On Nov 20, 2012, at 9:34 AM, Sam Roberts <vieuxtech at gmail.com> wrote:

> On Mon, Nov 19, 2012 at 9:44 AM, Joe Anello <joe.anello at roadrunner.com> wrote:
>> I’m sure it is in the documentation, but I just can’t seem to find it.
> Better to read the source.
>> I have a Windows based system with 6 GigE ports (all based on the same Intel
>> chips).  When I call pcap_findalldevs, it returns a list that contains 6
>> IDENTICAL strings for the ports. Pcap_open_live expects me to pass it that
>> identification string, but since they are all the same, how do I identify
>> which of the 6 ports I want to open?
> You mean in struct pcap_if, the .name fields are all the same, or the
> .description fields?

...because the .name field is what should be passed to pcap_open_live(), not the description field.

There is no guarantee that the description field will be different for all interfaces - on Windows (i.e., in WinPcap rather than in libpcap on various UN*Xes), it comes from the "vendor description" supplied by the driver, which describes the adapter's hardware (or, in some cases, describes an intermediate driver), so if you have multiple adapters of the same type, the descriptions will be identical.

I suspect that the .name field is *not* the same for all the adapters.

More information about the Winpcap-users mailing list