aboutsummaryrefslogtreecommitdiff
path: root/pcap-rdmasniff.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-04-29 15:02:09 -0700
committerGuy Harris <guy@alum.mit.edu>2018-04-29 15:02:09 -0700
commit38fe5d4033c4e49b414617473aa581a75873fc89 (patch)
treef87da023892e1eb2d06cbe981a2e473fc3f82ddd /pcap-rdmasniff.c
parente3a28bfcb200115ef541c0eda3d9b3ae2136e4c5 (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-rdmasniff.c')
-rw-r--r--pcap-rdmasniff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pcap-rdmasniff.c b/pcap-rdmasniff.c
index 512d8431..c50fe3fd 100644
--- a/pcap-rdmasniff.c
+++ b/pcap-rdmasniff.c
@@ -420,6 +420,10 @@ rdmasniff_findalldevs(pcap_if_list_t *devlistp, char *err_str)
}
for (i = 0; i < numdev; ++i) {
+ /*
+ * XXX - do the notions of "up", "running", or
+ * "connected" apply here?
+ */
if (!add_dev(devlistp, dev_list[i]->name, 0, "RDMA sniffer", err_str)) {
ret = -1;
goto out;