]> The Tcpdump Group git mirrors - libpcap/commit
Let the platform decide how to check capturable interfaces.
authorGuy Harris <[email protected]>
Tue, 28 Jun 2016 09:29:46 +0000 (02:29 -0700)
committerGuy Harris <[email protected]>
Tue, 28 Jun 2016 09:30:09 +0000 (02:30 -0700)
commit01dabcda25ed695976e5c844cdd7fc6875a17bf6
tree1942c269617b36aa4dcb03ce42f4cf26da8e599c
parent71d90a93c5cb7f15e10254d6ee711f1f690b0a9c
Let the platform decide how to check capturable interfaces.

(Git's annoying policy of expecting a short one-line description of every
change means that the first line isn't very explanatory.)

Make pcap_findalldevs_interfaces() take as an argument a function that's
used to check whether an interface can be captured on or not, rather
than doing the check by trying to open the device for capturing.

This lets pcap_findalldevs() find interfaces even if you don't have
permission to capture on them; that way, instead of users saying "why
isn't {tcpdump -D, tshark -D, dumpcap -D, Wireshark, etc.} showing me
any interfaces?", they'll say "why am I getting a 'you don't have
permissions' error when I try to capture on this interface?", which is a
better description of the underlying problem.

On some platforms, it also avoids a bunch of extra work when getting a
list of interfaces.
12 files changed:
fad-getad.c
fad-gifc.c
fad-glifc.c
pcap-bpf.c
pcap-dlpi.c
pcap-int.h
pcap-libdlpi.c
pcap-linux.c
pcap-nit.c
pcap-pf.c
pcap-snit.c
pcap-snoop.c