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-snit.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-snit.c')
-rw-r--r-- | pcap-snit.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pcap-snit.c b/pcap-snit.c index 9da8573d..2fa809aa 100644 --- a/pcap-snit.c +++ b/pcap-snit.c @@ -479,6 +479,17 @@ can_be_bound(const char *name _U_) } int +get_if_flags(const char *name _U_, bpf_u_int32 flags _U_, char *errbuf _U_) +{ + /* + * Nothing we can do. + * XXX - is there a way to find out whether an adapter has + * something plugged into it? + */ + return (0); +} + +int pcap_platform_finddevs(pcap_if_list_t *devlistp, char *errbuf) { return (pcap_findalldevs_interfaces(devlistp, errbuf, can_be_bound)); |