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 /acinclude.m4 | |
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 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 546eb2c4bd..f0591bd5da 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -309,7 +309,34 @@ and did you also install that package?]]) # Check whether various variables and functions are defined by # libpcap. # - AC_CHECK_FUNCS(pcap_open_dead pcap_freecode pcap_open pcap_setsampling) + AC_CHECK_FUNCS(pcap_open_dead pcap_freecode) + AC_CHECK_FUNCS(pcap_open) + if test $ac_cv_func_pcap_open = "yes" ; then + AC_DEFINE(HAVE_PCAP_REMOTE, 1, + [Define to 1 if you have libpcap/WinPcap remote capturing support]) + + # + # 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.) + # + AC_CHECK_FUNCS(pcap_setsampling) + fi + # # pcap_breakloop may be present in the library but not declared # in the pcap.h header file. If it's not declared in the header |