]> The Tcpdump Group git mirrors - libpcap/commit
Add more interface flags to pcap_findalldevs().
authorGuy Harris <[email protected]>
Sun, 29 Apr 2018 22:02:09 +0000 (15:02 -0700)
committerGuy Harris <[email protected]>
Sun, 29 Apr 2018 22:02:09 +0000 (15:02 -0700)
commit38fe5d4033c4e49b414617473aa581a75873fc89
treef87da023892e1eb2d06cbe981a2e473fc3f82ddd
parente3a28bfcb200115ef541c0eda3d9b3ae2136e4c5
Add more interface flags to pcap_findalldevs().

We add:

PCAP_IF_WIRELESS, which indicates whether the interface is "wireless" or
not.

PCAP_IF_CONNECTION_STATUS, which is a bitmask for a two-bit field that
can have one of the values:

PCAP_IF_CONNECTION_STATUS_UNKNOWN if the status of whether the interface
is "connected" or "disconnected" is unknown;

PCAP_IF_CONNECTION_STATUS_CONNECTED if the interface is "connected";

PCAP_IF_CONNECTION_STATUS_DISCONNECTED if the interface is
"disconnected";

PCAP_IF_CONNECTION_STATUS_NOT_APPLICABLE if the notion of "connected" or
"disconnected" doesn't apply to this interface.

Take that into account when sorting interfaces in the interface list,
penalizing "disconnected" interfaces, as you won't see traffic on them
if they're not wireless and you'd have to be in some form of "monitor
mode" to see traffic on them if they're wireless.

This should address GitHub issue #700.
24 files changed:
pcap-bpf.c
pcap-bt-linux.c
pcap-dag.c
pcap-dbus.c
pcap-dlpi.c
pcap-dos.c
pcap-int.h
pcap-libdlpi.c
pcap-linux.c
pcap-netfilter-linux.c
pcap-nit.c
pcap-npf.c
pcap-null.c
pcap-pf.c
pcap-rdmasniff.c
pcap-septel.c
pcap-snf.c
pcap-snit.c
pcap-snoop.c
pcap-usb-linux.c
pcap.c
pcap/pcap.h
pcap_findalldevs.3pcap
testprogs/findalldevstest.c