Open weskoerber opened 2 months ago
Windows has IfType in the IP_ADAPTER_ADDRESSES_LH structure; one of these values might indicate a layer 3+ device
The full IfType
specification can be found in ipifcons.h
(permalink).
The IfType
value of my Tailscale device on my Windows 11 machine reports a value of 53
:
#define IF_TYPE_PROP_VIRTUAL 53 // Proprietary virtual/internal
It seems that we'll have to get the ARP table and iterate each entry in the table, comparing it against the interface. Rough steps to make this work:
GetAdaptersAddresses
to get a list of adaptersGetIpNetTable
to get the ARP table
table
dwPhysAddrLen
field in the table entry is 0
, it means the interface identified by dwIndex
is not attached to a physical address; filter it outIn one (confusing) sentence: Filter addresses returned from GetAdaptersAddresses
having IfIndex
that matches dwIndex
in table
returned from GetIpNetTable
.
Closes #9 closes #12
TODOs:
IfType
in the IP_ADAPTER_ADDRESSES_LH structure; one of these values might indicate a layer 3+ device.