I'm looking for a method to acurately determine if an interface is the physical 802.3 ethernet port on a pc in windows.
Using ipconfig /all I can list all the interfaces, and when I do this on my pc several entries can be listed here including VPN, Bluetooth, Wifi and the physical ethernet interface.
I'm looking for something like, "isPhysical(interface)". (It's ok to have multiple physical lan ports, I just want to know if it is a physical port or not).
UPDATE:
Jay and Chris thanks!
(Not enough space in the comments so I'll post here)
I'm currently looking at using WMI Win32_NetworkAdapter. However, it shows 4 interfaces with AdapterType="Ethernet 802.3".
I only have 1 phyical port on my pc the others have the Name, "Virtual Machine Network Services Driver". (I assume these are installed by my company for some nefarious reason)
I found the attribute I need in the interface, but it's not available in winXP!!!
PhysicalAdapter Data type: boolean Access type: Read-only
Indicates whether the adapter is a physical or a logical adapter. If True, the adapter is physical. Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0: This property is not available.
Is there any way to determine if it's a physical port, other than doing a text filter for the word "Virtual" in the name?
UPDATE 12/08
Looks like the virtual interfaces are added when you have a VM installed.
Here's some details about the virtual adapter: http://blogs.msdn.com/virtual_pc_guy/archive/2005/04/01/404816.aspx
Found an issue where if the user doesn't have admin rights the WMI interface doesn't return the data needed. So, now looking at the GetAdapterInfo method. However, it seems to add 'virtual machine services driver" to the actual adapter's description, making the 'virtual' text check invalid.
And the structure returned by GetAdapterInfo:
http://msdn.microsoft.com/en-us/library/aa366062(VS.85).aspx