Wireshark-commits: [Wireshark-commits] master ba3aa03: Move more capture device handling to the cap
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=ba3aa03dcfb49a3bb2b090b864f1311fa4ecbc0e
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
ba3aa03 by Guy Harris (guy@xxxxxxxxxxxx):
Move more capture device handling to the caputils library.
Move the code to open capture devices and get properties of capture
devices there, joining the code to get a list of capture devices.
This lets us do a better job of handling pcap_create() in WinPcap,
including handling both WinPcap with pcap_create() and WinPcap without
pcap_create() at run time, just in case somebody tries using WinPcap 3.x
with a Wireshark built with WinPcap 4.x.
It also could make it easier to use libpcap/WinPcap directly in
Wireshark and TShark, if we have versions of libpcap/WinPcap that run
small helper utilities to do privileged functions, allowing programs
using them never to need elevated privileges themselves. That might
make it easier to fix some issues with running TShark when not saving to
a file (we could avoid the file entirely) and with delays when stopping
a capture in Wireshark (Wireshark could stop writing to the file as soon
as you click the stop button, rather than letting dumpcap do so when the
signal gets to it).
It might also make it easier to handle future versions of
libpcap/WinPcap that support using pcap_create()/pcap_activate() for
remote captures, and other future extensions to libpcap/WinPcap.
Rename some XXX_linktype routines to XXX_datalink to indicate that they
work with DLT_ values rather than LINKTYPE_ values; future versions of
libpcap might use LINKTYPE_ values in newer APIs.
Check for pcap_create() on all platforms in CMake.
Change-Id: Ia12e1692c96ec945c07a135d246958771a29c817
Reviewed-on: https://code.wireshark.org/review/13062
Petri-Dish: Guy Harris <guy@xxxxxxxxxxxx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
Actions performed:
from 97378a5 Don't assume a stat() fails only if the target file doesn't exist.
adds ba3aa03 Move more capture device handling to the caputils library.
Summary of changes:
caputils/capture-pcap-util-int.h | 28 ++
caputils/capture-pcap-util-unix.c | 29 ++
caputils/capture-pcap-util.c | 715 ++++++++++++++++++++++++++++++++++++-
caputils/capture-pcap-util.h | 21 +-
caputils/capture-wpcap.c | 64 +++-
cmake/modules/FindPCAP.cmake | 25 +-
dumpcap.c | 609 +------------------------------
7 files changed, 852 insertions(+), 639 deletions(-)