summaryrefslogtreecommitdiff
path: root/configure
Commit message (Collapse)AuthorAgeFilesLines
* autoconf: replace --with-system-libpcap with --disable-local-libpcap.Guy Harris2020-07-191-59/+59
| | | | | | | | --with-system-libpcap didn't work - it didn't prevent searching for a local libpcap - and had a misleading name. Replace it with --disable-local-libpcap. This should address GitHub issue #823.
* Compile with '-Wmissing-variable-declarations' if it's availableFrancois-Xavier Le Bail2020-05-301-1/+56
| | | | (In devel mode)
* $srcdir suffices.Guy Harris2020-03-021-1/+1
| | | | | | It's "the name of the top source directory, assuming that the working directory is the top build directory"; when running the configure script, the working directory will, in fact, be the top build directory.
* Look for Makefile-devel-adds in the top-level source directory.Guy Harris2020-03-021-1/+1
| | | | | If you're doing an out-of-tree build, that's *not* the current directory.
* Look for mkdep in the top-level source directory.Guy Harris2020-03-021-1/+1
| | | | | Not currently a problem for tcpdump, as we have no subdirectories, but this will leave us prepared for subdirectories if we ever add any.
* Remove the hacks to avoid floating-point issues in the tcpdump checks.Guy Harris2020-02-041-52/+2
| | | | | | | | | | | I can't seem to make those issues pop up on my (x86-64) machine, and, if they do show up on any platforms, the best hack to handle it is probably to have a special tcpdump flag to force it to do a floating-point calculation and see what result is generated, and report the result, so we know what it'll do with the numbers in the test files, and have tests/TESTrun run tcpdump with that flag. If those tests *do* fail, we'll know what calculations to do.
* Clean up ESP and ISAKMP decryption.Guy Harris2020-01-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At least as I read RFC 5996 section 3.14 and RFC 4303 section 2.4, if the cipher has a block size of which the ciphertext's size must be a multiple, the payload must be padded to make that happen, so the ciphertext length must be a multiple of the block size. Instead of allocating a buffer, copying the ciphertext to it, and padding it to the block size, fail if its size isn't a multiple of the block size. (Note also that the old padding code added a block's worth of padding to the end of a ciphertext block that *was* a multiple of the cipher block size; this might have caused problems.) Don't use the undocumented EVP_Cipher(); the lack of documentation means a lack of information about whatever requirements it might impose. Use EVP_DecryptUpdate() instead. Before calling it, use EVP_CIPHER_CTX_set_padding() to say "don't do your own padding, this block is a multiple of the cipher block size". Instead of using EVP_CipherInit() or EVP_CipherInit_ex(), use EVP_DecryptInit() or EVP_DecryptInit_ex(). as we're always doing decryption and never doing encryption - the extra parameter to EVP_CipherInit() and EVP_CipherInit_ex() is always 0. This may address GitHub issue #814. It may also make it a bit easier to have the code use Common Crypto on macOS (rather than requiring that OpenSSL be installed - macOS ships with an OpenSSL shared library for binary compatibility with older releases, but doesn't ship with the headers, because Apple wants you using their crypto code) and use Cryptography API: Next Generation on Windows (Vista/Server 2008 and later) (rather than requiring a Windows build of OpenSSL). (Hopefully this will all work with LibreSSL.)
* libdnet has bugs, do not use it.Denis Ovsienko2019-11-031-129/+0
| | | | | | | | | | | | | | | | | | The only function tcpdump used in libdnet was dnet_htoa(), which tries to translate a binary DECnet address to a nodename through a lookup in /etc/decnet.conf. The translation is slow and has a bug, so stop using the function and remove the dependency on libdnet. This makes tcpdump always print DECnet addresses in numeric format, if anybody needs the translation back they are welcome to fix libdnet or (more realistically) add an implementation of dnet_htoa() to the tcpdump source code and use it. (This is a forward-port of commit 9a6eb27 from tcpdump-4.9 to master. Sadly, together with libdnet this change removes the fine work that Guy had done in the master branch in commits ebf3f19 and 4ef8d63 to put libdnet usage right whilst my original "do not use libdnet" commit was aging in the pipeline.)
* Remove more old-compiler compensation.Guy Harris2019-08-081-30/+12
| | | | | | | | | | | | We require an environment with a C99-compatible snprintf(), so we don't need to work around older implementations. Make the configuration process fail if we don't have snprintf() and vsnprintf(). We require at least VS 2015, so we don't have to check for _MSC_VER >= 1400. Make the build fail if we don't have at least VS 2015. We apparently do, however, have to use __inline, as the VS 2015 documentation doesn't meaning plain old "inline". Update a comment.
* Use -Wpointer-sign if it's availableFrancois-Xavier Le Bail2019-07-131-1/+56
|
* (update configure too)Craig Leres2019-05-021-1/+1
|
* Note that we don't need to worry about pkg-config lacking --exists.Guy Harris2019-04-301-0/+4
| | | | [skip ci]
* Use pkg-config if we can. Clean up some CMake stuff.Guy Harris2019-04-261-41/+190
| | | | | | | | | | | | | | | | If we have pkg-config, *and* it has .pc files for libpcap, use it to get the C compiler flags and linker flags for libpcap. find_library() sets a cache variable; when we're looping over libraries, trying to find their full paths, we really want the variable to act as a local variable, as we're looking up different libraries, so unset it after we're finished processing a particular library. When we're searching for static libraries, save the current value of CMAKE_FIND_LIBRARY_SUFFIXES, set it to ".a", and then restore it when we're done. Don't use cmake_push_check_state() for that, as CMAKE_FIND_LIBRARY_SUFFIXES is *not* one of the variables that it's guaranteed to save and restore.
* Require sys/capsicum.h to use Capsicum.Guy Harris2018-11-091-1/+14
| | | | | | My PC-BSD 9.1 VM, at least, has sys/capability.h but not sys/capsicum.h; we now use sys/capsicum.h, so require it to be present (which it is in FreeBSD 10 and later).
* Compile with '-Wsign-compare' in devel mode if supportedFrancois-Xavier Le Bail2018-10-291-0/+43
|
* Don't warn about declarations after statements.Guy Harris2018-09-151-43/+0
| | | | | We now allow them, and require a compiler that supports them, so there's no need to warn about them.
* Don't warn about declarations after statements.Guy Harris2018-09-151-13/+9
| | | | | We now allow them, and require a compiler that supports them, so there's no need to warn about them.
* Fix spacesFrancois-Xavier Le Bail2018-09-031-1/+1
|
* Remove a useless warning about the SMB decoder.Denis Ovsienko2018-07-281-2/+0
| | | | | | In the last couple years it had been proved that any decoder can potentially have buffer overflows, hence let's not emphasize one of them more than the others.
* Fix a typo in a comment.Denis Ovsienko2018-07-281-1/+1
|
* Try the pcap_dump_ftell() check after pcap-config.Denis Ovsienko2018-07-281-13/+14
| | | | | | | | | | | | | | | | Apparently, the test for pcap_dump_ftell() cannot succeed if the test program isn't linked with libpcap, this depending on the output of pcap-config. That's why all pcap_* function checks come after the pcap-config check. This explains why in my working copy a ./configure build of the previous commit tree with the master branch of libpcap found that the function was "missing" and tried to substitute it with the local implementation and eventually failed trying to link with libpcap that actually had the function. However, this does not explain why all 32 Travis CI builds of the same tree passed, including the builds that used autotools.
* Stick with one version of pcap_dump_ftell.c.Denis Ovsienko2018-07-281-17/+13
| | | | | | | | | | | | | | | It looks like CMake after commit 3e9e2b6 started to use the newly added missing/pcap_dump_ftell.c to make pcap_dump_ftell() available in tcpdump if libpcap does not have it. However, autotools continued to use the previously existing ./pcap_dump_ftell.c for the same purpose. Remove the previously existing file and amend autotools files to cover pcap_dump_ftell() the same way as the other functions in the missing/ directory files. Amend missing/pcap_dump_ftell.c not to use pcap_dump_file(), as it may be unavailable. This has been tested to work with libpcap 0.6.1.
* Display interface and index and name on DLT_LINUX_SLL2Petr Vorel2018-07-191-1/+1
| | | | | | | | | | | | | | | | | Index is displayed always, name only if available. Warn about possible wrong interfaces when in reading mode (pcap file can be displayed on a different host then where was captured) [1]. See: GH the-tcpdump-group/libpcap#127 [1] https://lists.sandelman.ca/pipermail/tcpdump-workers/2018-July/001019.html Signed-off-by: Petr Vorel <pvorel@suse.cz> Suggested-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Denis Ovsienko <denis@ovsienko.info> Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Compile with '-Wunreachable-code-return' in devel mode if supportedFrancois-Xavier Le Bail2018-07-171-0/+43
|
* Sort the tested compiler warning optionsFrancois-Xavier Le Bail2018-07-071-131/+143
|
* Declare the NFLOG pseudo-header ourselves.Guy Harris2018-05-231-24/+0
| | | | | | | | | | It's not specified by a libpcap header that might have a different layout in different pcap releases, it's specified on the list of link-layer header types and must remain the same forever (except for getting additional bits defined), so we don't need to pick it up from libpcap. This means we get to use tcpdump's nd_ types; do so.
* Declare the Bluetooth pseudo-header ourselves.Guy Harris2018-05-231-13/+0
| | | | | | | | | | It's not specified by a libpcap header that might have a different layout in different pcap releases, it's specified on the list of link-layer header types and must remain the same forever (except for getting additional bits defined), so we don't need to pick it up from libpcap. This means we get to use tcpdump's nd_ types; do so.
* If we have a local libpcap, add it to the dependencies for tcpdump.Guy Harris2018-01-221-2/+6
| | | | We weren't doing so if we found a local pcap-config script.
* Regenerate configure script.Guy Harris2018-01-221-2/+5
|
* Configure for ether_ntohost() as libpcap does it for ether_hostton().Guy Harris2018-01-221-68/+122
| | | | | Check for the same header files that declare it, and handle the results of those checks in a similar fashion.
* Don't check for netinet/if_ether.h unless we need it.Guy Harris2018-01-221-44/+19
| | | | | | We only use it in addrtoname.c to declare ether_ntohost(), so there's no need to check for it unless we have ether_ntohost() and there's no other header that declares it.
* Clean up comments to reflect reality.Guy Harris2018-01-211-10/+12
|
* Again, we don't replace vfprintf().Guy Harris2018-01-211-13/+0
|
* Don't test for __attribute__ in the configure script.Guy Harris2018-01-211-144/+0
| | | | | | | | | Instead, use compiler test macros to check whether *particular* attributes are supported, and set various #defines appropriately, in header files. Rename the UNALIGNED structure attribute to ND_UNALIGNED, and ask whether we still need it.
* Use nd_ types, add host-endian extract routines, clean up signed vs. unsigned.Guy Harris2018-01-111-13/+0
| | | | | We now define the structures for Linux USB headers in print-usb.c, so it doesn't need to include <pcap/usb.h>; don't check for it.
* Use pcapng as the name of the file format.Guy Harris2018-01-081-2/+2
| | | | | | | | | | | | At one point, I remember a discussion resulting in the official name of the next-generation replacement for pcap format being changed to "pcapng", with no hyphen. Make tcpdump reflect that. While we're at it, uppdate to use "macOS" as the name of Apple's UNIX-for-Macs, as appropriate (don't use it for versions that were still called Mac OS X or OS X).
* C99 - ask for it by name!Guy Harris2018-01-071-0/+177
| | | | | | Use AC_PROG_CC_C99, to try to get the appropriate flags to make C99 the C version for which we compile. (XXX - should we fail if we don't get support for C99?)
* Clean up handling of libdnet headers.Guy Harris2017-12-301-74/+117
| | | | | | | | | | | | | | | | | If we don't have dnet_htoa(), we don't need any of the headers. Check for them only if we have dnet_htoa(). Use AC_CHECK_DECL to see if netdnet/dnetdb.h declares dnet_htoa(). Check for netdnet/dn.h and, if we have it, check whether it declares struct dn_naddr; if so, include it, rather than defining the structure ourselves. Don't define union etheraddr ourselves; we only need to define an etheraddr typedef. That avoids colliding with a libdnet header definition of union etheraddr. (When we use etheraddr, we care about what's on the wire, and we don't rely on system headers to tell us what's on the wire.)
* Fix typo, and request additional libraries for *static* linking.Guy Harris2017-11-301-4/+5
|
* Fix the handling of libpcap.Guy Harris2017-11-291-108/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have four possibilities: 1) local library, with a pcap-config; 2) local library, without a pcap-config; 3) installed library, with a pcap-config; 4) installed library, without a pcap-config. If we have a local library, i.e. one in ../libpcap{whatever}, we: add -I flags to the C compiler flags to point it at whatever directories in ../libpcap{whatever}; add ../libpcap{whatever}/libpcap.a to $LIBS and: if it has a pcap-config, we use it, with --additional-libraries, to find the additional libraries with which we need to link; otherwise, we do the usual OS-dependent hacks to try to figure out with what additional flags we need to link; and add them to $LIBS after libpcap.a. If we have an installed library: if it has a pcap-config we use it, with --cflags, to find what flags to add to the C compiler flags, and use it, with --libs, to see what flags to add to $LIBS; if it doesn't have a pcap-config, we search for -lpcap and, if that succeeds, we assume the headers are under /usr/local/include or /usr/include, search for them there, and, if we don't find pcap.h there, we look for it in a pcap subdirectory under there, and add the appropriate -I flag to the C compiler flags, and then do the usual OS-dependent hacks to try to figure out with what additional flags we need to link. While we're at it, we do the libdlpi check only on Solaris, as part of "the usual OS-dependent hacks".
* Regenerate configure script.Guy Harris2017-11-131-140/+141
|
* Use alarm() iff we're not on Windows.Guy Harris2017-11-121-5/+4
| | | | | | | | We assume "not on Windows" means "on UN*X", which means we have alarm() (we don't care about V6 and earlier; 1978 called, they want their UNIX back). If somebody wants to support something that's neither UN*X nor Windows, they'll need to contribute support, properly checking for that other OS.
* improved check for ipv6 support on windows (autotools)Ali Abdulkadir2017-11-061-0/+4
|
* regenerateAli Abdulkadir2017-10-241-0/+13
|
* Add support for remote capture if libpcap supports it.Guy Harris2017-10-201-17/+39
|
* Do the version number the way it's now done for libpcap.Guy Harris2017-10-161-15/+18
| | | | | | | | | | Use the two-argument version of AC_INIT() - which requires autoconf 2.64 or later, so require that as a minimum - and get the version string from the VERSION file. Use AC_CONFIG_SRCDIR() to say that the source directory needs tcpdump.c; the two-argument version of AC_INIT() doesn't do that. This means that we no longer have a version.c file.
* Get rid of obsolescent configure test.Guy Harris2017-10-161-36/+0
| | | | All UN*Xes, these days, let you include both <time.h> and <sys/time.h>.
* Check for unaligned memory access support at compile time.Guy Harris2017-10-161-95/+0
| | | | | Don't test at configure time; that doesn't work when cross-compiling and may be a pain to do with CMake.
* On UN*X, always use sigaction(), and always have signal handlers return void.Guy Harris2017-10-151-79/+0
| | | | | | | | | Some time between the mid 1980's and 1990 called; they want their old-fashioned UNIX signal handling back. ANSI C has had signal handlers returning void sincer, well, 1989, and POSIX has had sigaction() since close to forever. No need to worry about really old UN*Xes here. On Windows, it's also void (as per ANSI C); use signal().
* Get rid of an unnecessary test.Guy Harris2017-10-151-34/+0
| | | | We don't care whether struct sockaddr has an sa_len field or not.