tcpdump.
Check whether __attribute__((format)) can be applied to function
pointers and, if not, don't apply it to function pointers; some older
versions of GCC appear to support applying it to functions, but not
pointers to functions.
As we've gotten rid of missing/getaddrinfo.c, don't use it.
elsewhere in the macro.
For the Alpha C compiler, don't set -std1 unless it's necessary for ANSI
mode - we don't want to limit the compiler only to C89 features and,
more importantly, C89 headers (<inttypes.h> doesn't work, on at least
some versions of Digital UNIX and some C compiler versions, with -std1).
Remove unused items, and items for which we now have AC_DEFINE() calls
that supply a comment, from acconfig.h.
Note that a host OS that matches "osf*" is assumed to be DEC
OSF1/Digital UNIX/Tru64 UNIX.
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.
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.
On e.g. an x86_64 Linux system, configure won't find libcrypto because
it's located in .../lib64. As a temporal workaround, use the last part
of $libdir instead of "lib". On the long run, AC_LBL_SSLEAY should
probably be rewritten.
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.
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).
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.
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.
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.
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".
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.
modify it.
AC_LIBOBJ isn't supported by pre-2.50 autoconf; require 2.50.
2.5x apparently does quoting, or dnl, or something differently from
2.13; fix AC_EGREP_CPP calls.
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()").
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.
safer way to terminate "pcap_loop()" in a signal handler (it just sets a
flag, it doesn't muck with data structures that might have been in the
middle of being updated).
Have "setsignal()" not request SA_RESTART, so that if we call
"pcap_breakloop()" in a signal handler and then return, we don't restart
a call that was waiting for captured packets, we just make that call
EINTR out.
is also documented to work in Bash, but is not documented to work in the
real Bourne shell, and doesn't appear to work in the real Bourne shell.
Don't use it.
where we wire in the idea that it can't handle unaligned accesses. (I
don't know why the test program doesn't work - but perhaps the test
program is the wrong answer anyway, as it doesn't work when
cross-compiling.)
doing the compile in a directory other than the source directory, by
using the "--srcdir=" option, it finds libpcap if it's in a directory at
the same level as the tcpdump source directory or in a libpcap
subdirectory of that directory.
"pcap_list_datalinks()", "pcap_set_datalink()", and
"pcap_datalink_name_to_val()" in the version of libpcap we're using -
AC_CHECK_LIB can't check the local version, if that's what we're using,
but AC_CHECK_FUNC can (it just uses the current LIBS setting).
Young <dyoung@ojctech.com>, with some minor changes by Jason R. Thorpe
<thorpej@netbsd.org>, and further changes by me to:
use "-y" rather than "-D" to set the link type ("-D" was already
taken);
use libpcap APIs to map between data link type names and values;
supply stub versions of missing-but-needed libpcap APIs.
Update Jason Thorpe's e-mail address (Zembu is going away, if it hasn't
done so already).
hidden in a "pcap" subdirectory of "/usr/include" or
"/usr/local/include" and, if so, add a "-I" flag to search in that
subdirectory, so we manage to find "pcap.h", as Red Hat decided to
"improve" things by putting "pcap.h" in "/usr/include/pcap" (that's
probably where libpcap should have put it originally, but moving it now
just breaks source compatibility).
unused-parameter problems reported by GCC. Add an _U_ tag to label
parameters as unused if the function is called through a pointer (so
that you can't change its signature by removing parameters) or if there
are unused parameters only because the function isn't complete.
Add some additional bounds checks the necessity for which was revealed
while cleaning up unused-parameter problems.
Make some routines static.
"lcp_print()", defined in "print-lcp.c", isn't called anywhere -
"print-ppp.c" has the code to dissect LCP. Get rid of "print-lcp.c".
From Neil T. Spring: fixes for many of those warnings:
addrtoname.c, configure.in: Linux needs netinet/ether.h for
ether_ntohost
print-*.c: change char *foo = "bar" to const char *foo = "bar"
to appease -Wwrite-strings; should affect no run-time behavior.
print-*.c: make some variables unsigned.
print-bgp.c: plen ('prefix len') is unsigned, no reason to
validate by comparing to zero.
print-cnfp.c, print-rx.c: use intoa, provided by addrtoname,
instead of inet_ntoa.
print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to
be false, so check for (u_int)-1, which represents failure,
explicitly.
print-isakmp.c: complete initialization of attrmap objects.
print-lwres.c: "if(x); print foo;" seemed much more likely to be
intended to be "if(x) { print foo; }".
print-smb.c: complete initialization of some structures.
In addition, add some fixes for the signed vs. unsigned comparison
warnings:
extract.h: cast the result of the byte-extraction-and-combining,
as, at least for the 16-bit version, C's integral promotions
will turn "u_int16_t" into "int" if there are other "int"s
nearby.
print-*.c: make some more variables unsigned, or add casts to an
unsigned type of signed values known not to be negative, or add
casts to "int" of unsigned values known to fit in an "int", and
make other changes needed to handle the aforementioned variables
now being unsigned.
print-isakmp.c: clean up the handling of error/status indicators
in notify messages.
print-ppp.c: get rid of a check that an unsigned quantity is >=
0.
print-radius.c: clean up some of the bounds checking.
print-smb.c: extract the word count into a "u_int" to avoid the
aforementioned problems with C's integral promotions.
print-snmp.c: change a check that an unsigned variable is >= 0
to a check that it's != 0.
Also, fix some formats to use "%u" rather than "%d" for unsigned
quantities.
section - the other section gets stuck in the middle of "main()", and,
although GCC lets you define functions inside functions, other C
compilers don't.
Pick a name more likely to be unique to use as the iterator variable in
AC_LBL_C_INLINE.
Make AC_LBL_C_INLINE print "no" rather than "not supported" if inline
isn't supported, to match what AC_C_INLINE does.
return a structure pointer. Check whether the C compiler can handle
inline functions that return a structure pointer, not whether they can
handle inline functions that return an int, as at least some versions of
autoconf's AC_C_INLINE do.