I'm on Win7 and Qt and I need to track local network interfaces. The problem is - some of them don't have IP layer but I want to know if they are connected or not. I've tried
QNetworkInterface::allInterfaces() from Qt
and
GetInterfaceInfo() from iphlpapi.h
But both work only for interfaces with IP assigned. Duh. I've also tried
pcap library
But pcap_if_t
has no fields to track connection status, only MAC and others.
I feel stuck between two layers and don't know how to handle this.
I suppose there is a way with WMI query
but it seems to be an overkill.
GetAdaptersInfo()
orGetAdaptersAddresses()
function. They will give you detailed information and statuses of every installed network adapter.