diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-12-02 22:23:39 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-12-03 06:24:30 +0000 |
commit | 40fc796818ffa8476ff0868c39ecb2375a4e6ace (patch) | |
tree | 9d7178c9e6aad9093336dfd37a18a00f6300c09a /cmake | |
parent | 0455040c0e26b9b76d10efa8c321099989dc7b7e (diff) |
Fix the configuration check for remote-capture support in libpcap.
In autotools, if we find pcap_open(), define HAVE_PCAP_REMOTE, so we
build the remote capture support.
In both autotools and CMake, only check for pcap_setsampling() if we
have pcap_open(), as the compile fails if we have pcap_setsampling() but
don't have remote capture.
Change-Id: I0e7b78a2d372ea658a19ed2f6493532928c36872
Reviewed-on: https://code.wireshark.org/review/24680
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindPCAP.cmake | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/cmake/modules/FindPCAP.cmake b/cmake/modules/FindPCAP.cmake index d8812c94c6..469a8347ac 100644 --- a/cmake/modules/FindPCAP.cmake +++ b/cmake/modules/FindPCAP.cmake @@ -83,13 +83,32 @@ if( PCAP_FOUND ) check_function_exists( "pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS ) check_function_exists( "pcap_set_datalink" HAVE_PCAP_SET_DATALINK ) check_function_exists( "bpf_image" HAVE_BPF_IMAGE ) - check_function_exists( "pcap_setsampling" HAVE_PCAP_SETSAMPLING ) check_function_exists( "pcap_set_tstamp_precision" HAVE_PCAP_SET_TSTAMP_PRECISION ) check_function_exists( "pcap_set_tstamp_type" HAVE_PCAP_SET_TSTAMP_TYPE ) # Remote pcap checks check_function_exists( "pcap_open" HAVE_PCAP_OPEN ) if( HAVE_PCAP_OPEN ) set( HAVE_PCAP_REMOTE 1 ) + # + # XXX - this *should* be checked for independently of checking + # for pcap_open(), as you might have pcap_setsampling() without + # remote capture support. + # + # However, 1) the sampling options are treated as remote options + # in the GUI and and 2) having pcap_setsampling() doesn't mean + # you have sampling support. libpcap needs a way to indicate + # whether a given device supports sampling, and the GUI should + # be changed to decouple them. + # + # (Actually, libpcap needs a general mechanism to offer options + # for particular devices, and Wireshark needs to use that + # mechanism. The former is a work in progress.) + # + # (Note: another work in progress is support for remote + # capturing using pcap_create()/pcap_activate(), which we + # also need to support once it's available.) + # + check_function_exists( "pcap_setsampling" HAVE_PCAP_SETSAMPLING ) endif() cmake_pop_check_state() |