path: root/caputils/capture-wpcap.c
AgeCommit message (Collapse)AuthorFilesLines
2017-05-12Include caputils/capture-wpcap.h whether HAVE_LIBPCAP is defined or not.Guy Harris1-1/+2
It declares what's defined here, so always include it. Change-Id: I1d7d5ed071e6f2d53af9ff147ede18b05b98ecd1 Reviewed-on: https://code.wireshark.org/review/21616 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-12Don't include headers that depend on pcap if you don't have it.Guy Harris1-5/+5
Change-Id: I17234ef60411f922678b900a6ac4fb264b9ce431 Reviewed-on: https://code.wireshark.org/review/21614 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-03Move npf_sys_is_running() from wsutil to caputils.Guy Harris1-0/+38
It has nothing to do with controlling privileges; it only tests whether the NPF or Npcap service (driver) is running, so it belongs in caputils. While we're at it, fix its signature (in C, a function with no arguments must have "void" as the argument list, for backwards compatibility with pre-function-prototype C), and close the handles it opens, so we don't have open handles leaked. Change-Id: Ia99e99d81617ed2e8cda2c44e53061b4502a2b58 Reviewed-on: https://code.wireshark.org/review/15714 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-22caputils: fix crash when calling 'dumpcap -i' without having WinPcap installedPascal Quantin1-1/+2
Add a test on err_str buffer presence before trying to use it, like what is done in other code paths. Bug: 12143 Change-Id: I30ae49a33224dc190c202637767df9d7de2c0f2b Reviewed-on: https://code.wireshark.org/review/14074 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-01-07Move more capture device handling to the caputils library.Guy Harris1-15/+49
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@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-06[WINPCAP] First step to be able to use pcap_create()AndersBroman1-0/+100
Change-Id: Id95640db0e647a696b39ccbfabc8cf2922df1407 Reviewed-on: https://code.wireshark.org/review/13051 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-17Extcap: allow Wireshark to list extcap interfaces even when WinPcap / Npcap ↵Pascal Quantin1-9/+3
is not installed Bug: 11715 Change-Id: I4a043c4a298506d51cb6bf8b97aac787113a7dfa Reviewed-on: https://code.wireshark.org/review/11869 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Guenter Ebermann <guenter.ebermann@googlemail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-10Change a lot of http:// URLs to https://.Gerald Combs1-12/+4
Most of our sites are now HTTPS-only. Update URLs accordingly. Update other URLs while we're at it. Remove or comment out dead links. Change-Id: I7c4f323e6585d22760bb90bf28fc0faa6b893a33 Reviewed-on: https://code.wireshark.org/review/7621 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-13caputils/*.c: As needed: Add editor modelines & Fix indentationBill Meier1-62/+75
Change-Id: I081446fbbc242c01f8ac9dede575c3ea77421c42 Reviewed-on: https://code.wireshark.org/review/7103 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-22Get rid of NO_INTERFACES_FOUND - it's not an error.Guy Harris1-1/+1
It just means "pcap didn't give me any interfaces, and didn't report an error". Hopefully, in the future, there will be pcap APIs that distinguish between the (admittedly unlikely, these days) case of "there really *are* no interfaces on which *anybody* can capture" and "you don't have sufficient permission to capture", and we can report the latter as an error. (Given that pcap supports more than just "regular interfaces", though, there are cases where you don't have permission to capture on those but you have permission to capture raw USB traffic, for example, so perhaps what's really needed is per-interface indications of permissions.) Change-Id: I7b8abb0829e8502f5259c95e8af31655f79d36a1 Reviewed-on: https://code.wireshark.org/review/3169 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-04Reflect the rename of get_XXX_pcap_version() to get_XXX_caplibs_version().Guy Harris1-4/+4
Change-Id: I55108e39d9d5a3fc5e1e3e0ec0040c08c92cc576 Reviewed-on: https://code.wireshark.org/review/2844 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-04Move utility routines for capturing into a libcaputils static library.Guy Harris1-0/+990
Some of those routines are used only in dumpcap; others are used in TShark and Wireshark as well. Change-Id: I9d92483f2fcff57a7d8b6bf6bdf2870505d19fb7 Reviewed-on: https://code.wireshark.org/review/2841 Reviewed-by: Guy Harris <guy@alum.mit.edu>