diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-04-29 15:02:09 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-04-29 15:02:09 -0700 |
commit | 38fe5d4033c4e49b414617473aa581a75873fc89 (patch) | |
tree | f87da023892e1eb2d06cbe981a2e473fc3f82ddd /pcap-dos.c | |
parent | e3a28bfcb200115ef541c0eda3d9b3ae2136e4c5 (diff) |
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.
Diffstat (limited to 'pcap-dos.c')
-rw-r--r-- | pcap-dos.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -579,6 +579,9 @@ int pcap_platform_finddevs (pcap_if_list_t *devlistp, char *errbuf) /* * XXX - find out whether it's up or running? Does that apply here? + * Can we find out if anything's plugged into the adapter, if it's + * a wired device, and set PCAP_IF_CONNECTION_STATUS_CONNECTED + * or PCAP_IF_CONNECTION_STATUS_DISCONNECTED? */ if ((curdev = add_dev(devlistp, dev->name, 0, dev->long_name, errbuf)) == NULL) |