Commit Graph

162 Commits

Author SHA1 Message Date
Guy Harris
02ae5549fc As with libpcap, so with tcpdump; when testing whether "inline" works,
use the V_CCOPT flags, because some of those might disable inlining;
otherwise, the test for inlining will succeed, but inlining won't work
with the options we're using when compiling.
2009-07-02 11:55:55 -07:00
Guy Harris
2425b023c1 Use <sys/bitypes.h> in all tests for types. 2009-06-29 00:58:33 -07:00
Guy Harris
6b510e1a1b On AIX, if we have pcap-config, rely on it to supply the right extra
flags for linking with libpcap.
2009-06-16 00:21:06 -07:00
Guy Harris
97b52f9f3f Don't put -L/usr/lib into LDFLAGS - it would cause linking with -lpcap,
on a system that comes with libpcap, to link with the system libpcap
even if, say, you've installed a newer libpcap under /usr/local and its
pcap-config added -L/usr/local/lib to LDFLAGS, as the -L/usr/lib comes
earlier in LDFLAGS.  (For "would", read "did, when I tried it".)
2009-06-07 18:19:59 -07:00
Guy Harris
018e7fe40d If we're using a local libpcap library, check for a local pcap-config
script and, if we find it, query it to see what additional libraries are
needed to link with that library.

If we're not, check for a system pcap-config script and, if we find it,
query it to see what C compiler flags and linker flags are needed to
build with that library.
2009-05-22 18:45:27 -07:00
Guy Harris
2c28d8f466 From Bert Vermeulen: add a USB printer, and fix the error message
printed when trying to print packets for a DLT_ for which we don't have
a printer to indicate that you can still save to a capture file in that
case.  (Slightly changed not to require DLT_USB_LINUX_MMAPPED to be
defined, for older libpcaps that only define DLT_USB_LINUX.)
2009-04-04 12:30:27 -07:00
guy
a28495afd3 Propagate from the git tree:
Author: Peter Volkov <pva@gentoo.org>
Date:   Sun Nov 9 20:33:27 2008 -0500

    Currently it's impossible to build tcpdump without libsmi on system with
    libsmi installed. The patch in attachment adds --with{,out}-smi
    configure switch which allows to disable it.
2008-11-18 07:39:20 +00:00
guy
7ec2b0b9f7 Run the tcpdump man page through config, so that it refers to the right
man page sections.  Have it refer to the new pcap-savefile man page for
a description of the savefile format.
2008-10-27 21:20:16 +00:00
guy
2fa88fe1a3 We support building tcpdump with versions of libpcap other than the one
with which it was released, and DLT_BLUETOOTH_HCI_H4_WITH_PHDR might be
defined by pcap-bpf.h without pcap/bluetooth.h being present (as appears
to be the case on Fedora 9, for example), so check whether
<pcap/bluetooth.h> is usable.

Update a comment - F9 appears to have a "/usr/include/pcap.h" if you
install the libpcap headers.

When adding -I flags when running a compiler-based test, add them to
CPPFLAGS, not CFLAGS - the latter doesn't work right with
AC_CHECK_HEADERS, as the "gcc -E" run doesn't have the -I flags added.
2008-09-25 21:45:50 +00:00
guy
bca64a2755 Use the new libpcap API's if available; that means we can support "-B"
on all platforms in that case.  Also, add a "-I" flag to turn on monitor
mode.
2008-04-04 19:42:11 +00:00
guy
eb65de093f From Sagun Shakya: check whether we need libdlpi. 2008-03-13 18:32:51 +00:00
guy
5d375b6ca0 Have --with-crypto take an optional argument, specifying where libcrypto
can be found.  If --with-crypto is specified, and libcrypto isn't found,
fail, as presumably the user expected libcrypto to be available.
2008-02-26 20:47:12 +00:00
guy
d5744f5949 From Mike Frysinger: include the Blackfin processor as one of the
processors that don't support unaligned accesses.
2008-02-26 19:17:56 +00:00
guy
0fe13260f1 The string-comparison operator in the "test" command is "=", not "==". 2008-02-05 18:58:19 +00:00
guy
411c7e7f10 Run ranlib on libnetdissect.a if necessary. Remove it before building
it, so we discard any stuff already in the archive.
2008-02-04 20:42:09 +00:00
guy
7e5e89df69 From Max Laier: check whether the system has <net/pfvar.h> and:
if it does, use that for the pf definitions;

	if it doesn't, don't compile in pf support;

as both OpenBSD and FreeBSD have changed the pf definitions and header
format without changing the DLT value, so you can't reliably read
pflog-format libpcap files on a machine running an OS version other than
the one on which the file was generated.
2007-09-12 19:36:18 +00:00
guy
625ce5e12d Add -Wpointer-arith to the list of warnings we enable with GCC. 2005-11-08 02:59:40 +00:00
guy
385cd8601b From David Smith: let the path for the crypto headers and libraries be
set explicitly by setting Xprefix as an environment variable, for use
when cross-compiling.
2005-09-21 16:47:59 +00:00
guy
e39a8ce814 Re-generate with 2.57, just to minimize the changes at this point. 2005-06-04 09:30:10 +00:00
guy
e549a22820 Use pcap_dump_ftell() rather than casting a pcap_dumper_t * to a FILE *
and using ftell(); that won't necessarily work on Windows (if libpcap
was built with a different version of the C runtime library than tcpdump
is), and, even on UN*X, would break if a pcap_dumper_t * were ever made
something other than a FILE *.

Provide a pcap_dump_ftell() implementation that does that cheating cast
for use if libpcap doesn't have it (a pcap_dumper_t * is just a FILE *
on those older versions of libpcap).
2005-06-03 22:08:51 +00:00
guy
674ca18295 Fix to work with autoconf 2.59. 2005-06-03 21:36:41 +00:00
guy
d0f903c65d Split a line to match the way it's split in libpcap's configure.in. 2005-04-24 01:34:59 +00:00
guy
505ddaca27 Albert Chin's patch to libpcap's configure.in:
AC_CHECK_DECLS will define the HAVE_DECL_xxx variable whether it
	succeeds or fails, so you can't erase a "no" result and try
	again with a different header.  Use AC_CHECK_DECL, which doesn't
	define HAVE_DECL_xxx, and then explicitly define it based on
	whether we found a declaration or not.

is required for tcpdump's configure.in as well.
2005-04-24 01:25:23 +00:00
guy
d4290ae435 AC_TRY_COMPILE works only for code that fits inside "main()"; the test
for __attribute__ doesn't fit inside "main()" with GCC 4.0, as it
defines a function.
2005-04-21 03:50:29 +00:00
guy
d26090f659 Put back AC_LBL_C_INLINE; it turns out that wasn't the cause of the
inline problem, and AC_LBL_C_INLINE checks for a case that some versions
of the HP C compiler don't handle, and only uses inline if that case
succeeds.
2005-04-21 02:21:47 +00:00
guy
794a52c42c Some systems (*cough*Irix*cough) not only don't declare
"ether_ntohost()" but don't even declare "struct ether_addr"; on those
systems, declare "struct ether_addr".
2005-04-20 11:17:18 +00:00
guy
caf503e482 From Albert Chin:
1. aclocal.m4 patch required by Tru64 UNIX which has
     inttypes.h in a non-standard location so gcc cannot find
     the PRI types. So, use <sys/bitypes.h> to get u_int#_t
     types for help detecting %llx, etc.
  2. Help gcc on aix find ether_ntohost declaration.
2005-04-20 09:49:52 +00:00
guy
e1db53eeb7 From Albert Chin:
1. On AIX, AC_LBL_C_INLINE detected the compiler supported
     the inline keyword which is wrong. AC_C_INLINE from
     autoconf-2.59 worked.
  2. AC_CHECK_TYPE from autoconf-2.5x is no longer broken.
     Replaced AC_LBL_CHECK_TYPE with it, mainly to use
     <sys/bitypes.h> for Tru64 UNIX where some of the u_int#_t
     types are defined.
  3. Tru64 UNIX 4.0D doesn't support %llx; however, it does support %lx.
  4. Added <stdint.h> to interface.h for int#_t types on
     Tru64 UNIX 4.0D (required for missing/snprintf.c).
  5. Reworked includes in tcpdump-stdinc.h for int#_t types.
2005-04-20 09:44:30 +00:00
guy
6198b3a089 Check for ether_ntohost() after checking for libpcap, so that we do so
after we've checked whether we need -lsocket -lnsl to get routines such
as ether_ntohost().
2005-03-27 23:16:08 +00:00
guy
a7f2c5e465 Don't check for netinet/ether.h unless we're going to use it. 2005-03-27 22:58:08 +00:00
guy
97f3ed0073 Fix an error in the previous checkin. 2005-03-27 22:46:21 +00:00
guy
969f75a107 Fix a typo.
Don't bother checking whether ether_ntohost() is declared if it exists
but is buggy so we won't be using it.
2005-03-27 22:44:22 +00:00
guy
0b6991cfd5 Do the same sort of checks whether ether_ntohost() is declared that we
do in libpcap for ether_hostton().  Include <netinet/ether.h> only if it
declares ether_ntohost().  If nothing declares it, declare it ourselves,
as we do in libpcap.

Don't cast the second argument to ether_ntohost() to a const pointer, as
some systems don't modify it but don't declare that argument as a const
pointer.  (This is similar to what we do on libpvap for
ether_hostton().)

Fix indentation.
2005-03-27 22:38:09 +00:00
guy
b2eeaa3e02 When testing whether "inline" works, use the V_CCOPT flags, because some
of those might disable inlining; otherwise, the test for inlining will
succeed, but inlining won't work with the options we're using when
compiling.
2005-03-27 03:31:01 +00:00
guy
128d636bc2 Regenerate. 2004-12-27 01:15:06 +00:00
guy
0b18136512 From Andrew Church <andrew@users.sourceforge.net>: when testing for
"pcap_version", "pcap_debug", and "yydebug", don't add our own functions
referring to those variables - GCC 3.4.1 optimizes the test code out
before the link is done, as it's in a function that's not called.
2004-08-27 07:17:03 +00:00
guy
fb8b947488 When checking for pcap_if_t, add $V_INCLS to CFLAGS, so we look at the
header files for the version of libpcap we'll be using.
2004-07-10 21:53:31 +00:00
guy
faf8160c18 Second stage of adding support for 64-bit integral data types - this
causes the configure script to attempt to define the PRI[doux]64 macros
if they're not defined by including <inttypes.h>, and causes
"missing/bittypes.h" to attempt to define them, if undefined, in a
fashion that should, with any luck, work on MSVC++ and various flavors
of GNU C on Windows.

Fix the spelling of "Mac OS X".
2004-04-17 08:44:49 +00:00
guy
1875b8ffe1 First stage of adding support for 64-bit integral data types - this
causes "int64_t" and "u_int64_t" to be defined by the configure script,
and causes "missing/bittypes.h" to attempt to define "u_int64_t" in a
fashion that should, with any luck, work on MSVC++ and various flavors
of GNU C on Windows.
2004-04-17 04:33:16 +00:00
mcr
c85f67869c regenerated configure with 2.57. 2004-04-05 00:17:03 +00:00
fenner
3f07fce716 Regenerate. 2004-03-23 18:59:23 +00:00
guy
5f9a33d806 Regenerate. 2004-03-11 23:53:33 +00:00
guy
fb99d7da2d AC_LIBOBJ takes the name of an object file without the extension (as the
extension is platform-dependent).
2004-01-31 05:41:37 +00:00
guy
ea83407f9f Regenerate. 2004-01-26 00:51:31 +00:00
guy
d88193ac89 From Gisle Vanem:
When saving to a file with "-w", have the "-v" flag make tcpdump
	report, every 10 seconds, the number of packets captured.

	Include <smi.h> if we're building with libsmi, to declare
	"smiInit()" and "smiLoadModule()".
2004-01-15 19:53:48 +00:00
guy
c8e5cd1da7 Regenerate with autoconf 2.57. 2004-01-14 03:15:08 +00:00
guy
def0866994 From Albert Chin <china@thewrittenword.com>:
propagate CPPFLAGS to Makefile.in;

	move the CPPFLAGS and V_INCLS change to the end of the configure
	run so users don't see "-I$(srcdir)/missing" in their config.log
	output.
2003-12-15 02:12:40 +00:00
guy
0cf35b497d Print both the name and the description of a link-layer type (the name
isn't always very suggestive - for example, somebody might think
"EN10MB" is always 10 MB/s, and might not know that "IEEE802" is Token
Ring), using "pcap_datalink_val_to_description()".  Supply our own
"pcap_datalink_val_to_description()" if libpcap doesn't have it (even if
it has "pcap_datalink_name_to_val()").
2003-11-18 23:09:42 +00:00
guy
ea8077fb78 From Brian Ginsbach: add the Cray NV1 CPU to the list of CPUs that don't
support unaligned accesses.
2003-11-16 10:13:34 +00:00
guy
ae71d1db52 Have the configure script arrange that the Makefile define _U_
appropriately, and that GNUmakefile and the MSVC++ project file define
it apppriately, as we do with libpcap, rather than defining it in
"interface.h".

Undo the rcsid-shuffling and addition of extra #includes, as we no
longer need to arrange that "interface.h" be included before using _U_
in an RCS ID or copyright.
2003-11-16 09:42:39 +00:00