[Winpcap-users] How to get local MAC address ?

Wentao Shang wentaoshang at gmail.com
Mon Sep 12 18:43:00 PDT 2011


I think it should be 'AdapterName'.

If I remember it right, the 'AdapterName' is something like
'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX', which is the GUID for the device
written in the Windows registry. 'Description' is something like
'Intel(R) 82566MM Gigabit Network Connection' while 'FriendlyName' is
'Local Network Connection' which is the name you see in the Windows
Control Panel. The latter two fields can be viewed by 'ipconfig /all'.

The 'name' field in the 'pcap_if' struct is similar to 'AdapterName'
but with a prefix '\Device\NPF_{' and a '}' around the GUID.

Regards.

Wentao

2011/9/13 "Fish" (David B. Trout) <fish at infidels.org>:
> Wentao Shang wrote:
>
> [...]
>> One solution is to compare the 'AdapterName' field
>
> (Or maybe Description?  Or maybe FriendlyName?)
>
>
>> in IP_ADAPTER_ADDRESSES struct with the field in pcap_if_t struct
>> (i don't remember the name).
>
> (Description?)
>
>
>> You may first get the whole pcap_if_t struct list then select
>> the one you need.
>
> I agree.  That is probably the best way.  Scan the list of IP_ADAPTER_ADDRESSES returned by GetAdaptersAddresses and find(*) the entry for the WinPCap adapter you're interested in.
>
> --
> "Fish" (David B. Trout)
>  fish at softdevlabs.com
>
> (*) AdapterName? Description? FriendlyName? Not sure which one is correct, but I seem to recall ONE of them matches the WinPCap Description field (I think).
>
>
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
>



-- 
Wentao Shang

Master Candidate and Research Assistant at CERNET Center & NGN Lab, EE
Department, Tsinghua University,

Email: wentaoshang at gmail.com, mundou at qq.com,

Mobile: +86-13466605118, +86-18952150939,


More information about the Winpcap-users mailing list