aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindPCAP.cmake
AgeCommit message (Collapse)AuthorFilesLines
2016-01-07Move more capture device handling to the caputils library.Guy Harris1-15/+10
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>
2015-03-25Have a #define for whether the capture buffer size can be set.Guy Harris1-1/+12
It can be set if either 1) this is Windows (where we're assumed to be using WinPcap, which includes calls to set the buffer size) or 2) we have pcap_create() (in which case we also have pcap_set_buffer_size(), at least in a normal libpcap release). Use that rather than testing "defined(_WIN32) || defined(HAVE_PCAP_CREATE)"; that makes it a bit more obvious what's being tested. Change-Id: Id9f8455019d19206b04dd6820a748cb97ae5ad12 Reviewed-on: https://code.wireshark.org/review/7816 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-09CMake: Set WIRESHARK_TARGET_PLATFORM.Gerald Combs1-1/+1
Set WIRESHARK_TARGET_PLATFORM near the top of CMakeLists.txt. It's used by a couple of our modules and will be used for NSIS packaging. Change-Id: Ief43733bdf162998cd54ff3732f94c8baa3d1e11 Reviewed-on: https://code.wireshark.org/review/6458 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-04No *pcap should have pcap_open() without the other remote extensions.Guy Harris1-3/+1
WinPcap 3.0 introduced pcap_open(); it also introduced pcap_findalldevs_ex() and pcap_createsrcstr(). If you're going to put pcap_open() in libpcap, there's not much point to doing so but not also putting pcap_findalldevs_ex() and pcap_createsrcstr() there. (And, in the future, there'll be support for remote capturing with pcap_create() and pcap_activate(), with no need for pcap_createsrcstr(), and a replacement for pcap_findalldevs() and pcap_findalldevs_ex(), which we'll also check for.) So there's no need to check for pcap_findalldevs_ex() or pcap_createsrcstr(). Change-Id: I9323aad20136684d05d1e909326792a2f1408887 Reviewed-on: https://code.wireshark.org/review/6311 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-28Add support for getting nanosecond time stamp resolution when capturing.Guy Harris1-0/+1
If we have pcap_set_tstamp_precision(), use it to request nanosecond time stamp resolution *if* we're writing a pcap-ng file; any code that reads those files and can't handle nanosecond time stamp resolution is broken and needs to be fixed. If we're writing a pcap file, don't ask for nanosecond resolution time stamps, as that requires a different magic number for pcap files, and not all code that reads pcap files can handle that. (Unlike pcap-ng, where the ability to have non-microsecond time stamp resolution was present from Day One, it's a relatively recent addition to pcap.) We could add a command-line option/GUI option for that, like the option recent versions of tcpdump have, if it matters. Change-Id: I8fa464eb929feecb9a70be70712502c9f0cc5270 Reviewed-on: https://code.wireshark.org/review/4355 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-21Fix CMake checks of PCap functions, along with AirPCapGraham Bloice1-2/+3
Change-Id: If55498167d5e357258841f2194962749c0dfc81e Reviewed-on: https://code.wireshark.org/review/3787 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-08-01Fix comparison.Gerald Combs1-1/+1
Change-Id: If2af35c8a49f405bee70eb144e26e539a7dc61f2 Reviewed-on: https://code.wireshark.org/review/3335 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-08-01Fix the CMake WinPcap library path check.Gerald Combs1-1/+7
Look for wpcap.lib in WpdPack/Lib/x64 when our target platform is Win64. Change-Id: I9a1bac22106bcb6a1f155ce83c02e344e6ec0d55 Reviewed-on: https://code.wireshark.org/review/3331 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-06-18Don't put c-comments into cmake files. Won't work at midnight either.Joerg Mayer1-2/+2
Change-Id: I80efce78a044f477af56f82cc9d8e85c8544ffbc Reviewed-on: https://code.wireshark.org/review/2372 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-18Fix building uiqt on Windows with the cmake build system:Joerg Mayer1-1/+5
Protecting HAVE_PCAP_CREATE was not enough for the moc run in qt, maybe it doesn't have _WIN32 set? Don't even try to detect this function on WIN32 for now. Change-Id: I0d8a8b5b110cec164f86fe11f26a7add558eee1b Reviewed-on: https://code.wireshark.org/review/2370 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-03-31Continue to remove $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^\# \$Id\$/,+1 d') (start with dash) Change-Id: Ia4b5a6c2302f6a531f6a86c1ec3a2f8205c8c2dd Reviewed-on: https://code.wireshark.org/review/881 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-10-10Don't check for pcap_version(); we don't use it.Guy Harris1-1/+0
Sort the #cmakedefines in cmakeconfig.h.in to more closely match the order in config.h.in, to make it easier to make sure CMake and autofoo are doing the same checks. Remove some #cmakedefines that don't correspond to check that are being done either by CMake or autofoo. svn path=/trunk/; revision=52515
2013-10-10Check for bpf_image(), just as the autoconf script does.Guy Harris1-0/+1
svn path=/trunk/; revision=52514
2013-10-06Rewrite FindPCAP.cmake to current practicesJörg Mayer1-127/+58
svn path=/trunk/; revision=52405
2013-09-23Beginnings of win cmake support (not yet working), created by Graham Bloice,Jörg Mayer1-0/+9
some smaller changes by me. - README.cmake Document how to (one day) run on Windows - CMakeLists.txt Use MSVC compiler flags for MSVC instead of gcc flags - FindWSWinLibs.cmake New: Creates HINTS for finding includes and libraries inside the Wireshark support library installation. - FindXXX.cmake Make use of HINTS generated by FindWSWinLibs.cmake This has not really been tested on Windows as my installation seems to have automagically downloaded some fixes and is in an inconsistent state since. Will probably need to reinstall. svn path=/trunk/; revision=52194
2011-08-05FindGTK2: Add a check for pangocairo. It has to be linked explicitly, atGerald Combs1-5/+6
least for MacPorts. FindPCAP: Define HAVE_PCAP_CREATE if we have pcap_create. svn path=/trunk/; revision=38372
2011-07-06Add detection of rpcap support in libpcap and use it if available.Jörg Mayer1-10/+18
svn path=/trunk/; revision=37914
2010-09-28- Reset a few more variables used in FindXYZ scripts.Jörg Mayer1-0/+3
- README.cmake: small update. - Set a variable before using it for installation. svn path=/trunk/; revision=34274
2010-05-24Jose Pedro Oliveira <jpo@di.uminho.pt>Jörg Mayer1-0/+1
(via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4786) Add missing +INCLUDE(CheckVariableExists) to make the previous commit work. svn path=/trunk/; revision=32939
2010-05-24At least according to the CMake 2.6 documentation,Guy Harris1-0/+1
CHECK_VARIABLE_EXISTS() can be used to check for C variables; use that to check for pcap_version. svn path=/trunk/; revision=32938
2010-03-17Add CMake tests for pcap_datalink_val_to_description() andGuy Harris1-6/+14
pcap_free_datalinks(). Sort the CMake tests in cmake/modules/FindPCAP.cmake into the same order as the tests in the autoconf script, and note that, in the autoconf script, the checks for pcap_open_dead() and pcap_freecode() do more than just look for the routines in the library. svn path=/trunk/; revision=32225
2009-12-29- Beginnings of cmake in docbook directoryJörg Mayer1-6/+2
- Add note about "make help" - Move beginnings of packaging into its own file: CPackConfig.txt svn path=/trunk/; revision=31379
2009-09-23- Add $Id: $ tagsJörg Mayer1-0/+3
- FindHtmlViewer.cmake: Try to add reading the name of the html viewer from the HTML_VIEWER environment variable (untested) svn path=/trunk/; revision=30104
2009-09-09CMAKE: Get most of of missing *build* pieces into placeJörg Mayer1-4/+4
svn path=/trunk/; revision=29819
2006-10-30frederic heem:Jörg Mayer1-0/+35
Please find the patch that adds copyrights. svn path=/trunk/; revision=19744
2006-10-26frederic.heem:Jörg Mayer1-11/+48
Update/Add FindPCAP.cmake CMakeInstallDirs.cmake CMakeLists.txt me: Fix a typo, change gcc flags to mimic the behaviour of autofoo stuff. svn path=/trunk/; revision=19707
2006-10-24Parts of http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1179Jörg Mayer1-8/+30
Frederic Heem: * More cmake system checks. It compiles dumpcap without running configure, svn path=/trunk/; revision=19672
2006-09-06cmake/Jörg Mayer1-0/+27
Add some more (hackish) tests. Add a LICENSE file until I find the time to add it to all files individually. CMakeLists.txt Add some addiotional stuff regarding options. Add (non-working) code to generate config.h Handle GTK1 vs GTK2 and GLIB1 vs GLIB2 svn path=/trunk/; revision=19168