| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
And, as we require at least autoconf 2.61, and as autoconf 2.61 and
later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to
define the uintN_t and intN_t macros if the system doesn't define them
for us.
This lets us get rid of bitypes.h as well.
|
| |
|
|
|
|
|
|
| |
Eliminate a number of fputs(), putchar() and fflush() uses. Justify
preprocessor directives. Don't typecast ND_PRINT() to void and fix some
indentation.
|
| |
|
| |
|
|
|
|
| |
If the processor does unaligned accesses, it's not necessary.
|
|
|
|
|
| |
This simplifies the code, gets rid of some type-punning about which GCC
warns, and reduces the size of the list entries.
|
|
|
|
| |
They are, after all, not guaranteed to be aligned.
|
| |
|
|
|
|
|
|
| |
Remove lots of $Header's and a few $Id's that all belong to the former
CVS repository of tcpdump itself. These keywords have been frozen since
the migration to git in late 2008.
|
|\
| |
| |
| |
| | |
Conflicts:
enc.h
|
| |
| |
| |
| |
| |
| | |
For headers included in only one source file, put the header contents in
the source file in question, and get rid of a bunch of stuff from the
header not used in the source file.
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A MacOS build of tcpdump used to produce deprecation warnings on OpenSSL
function calls. Alan DeKok explained that this is the effect of Apple's
modifications to OpenSSL and that the very same problem has already been
solved in FreeRADIUS server source code with pre-processor macros.
Copy the macros into tcpdump header file and make use of them around the
functions that call OpenSSL functions.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Use the EXTRACT_ macros to extract multi-byte integral values from
packets, rather than just dereferencing pointers into the packet; there
is no guarantee that the packet data will be aligned on the right
boundary, and there is no guarantee that, if they're not, a direct
access will work correctly.
|
|
|
|
|
|
| |
running tcpdump -v -E in valgrind reports a memory leak. The memory
allocated by EVP_CipherInit is not freed. This patch fixes the problem
for me.
|
|
|
|
|
|
|
| |
when optimization is not on, glibc6 doesn't define ntohs(), and our attempt
to optimize it for x86 doesn't work --- the functions need to be static, not
extern.
added decryption of IKE v2 payloads, when keys are provided by -E.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
"hex_print_with_offset()", and "hex_print()" is a string used as a tag;
make it a "const char *", not a "const u_char *".
Copy the declaration of "strsep()" from "interface.h" to "netdissect.h",
and get rid of the include of "interface.h" from "print-esp.c", as it
includes "netdissect.h".
Update the "ND_TTEST2()" macro to do the same overflow checks that
"TTEST2()" now does.
|
|
|
|
|
|
|
| |
Get rid of the declaration of "strsep()" - we include "interface.h",
which should declare it if we don't define HAVE_STRSEP, and if
HAVE_STRSEP is defined on a platform that doesn't have "strsep()",
that's a bug that should be fixed by arranging not to define it.
|
|
|
|
|
| |
we're supplying our own "strsep()" due to it not being supplied by the
OS or the compiler.
|
| |
|
|
|
|
| |
authentication trailer.
|
|
|
|
|
| |
replace error() and warning() with ndo-ized version.
moved snaplen/snapend to ndo structure.
|
| |
|
| |
|
|
|
|
|
|
|
| |
return -1 if they run out of data.
Have the IPv4 and IPv6 dissectors check for non-positive return values
from those routines and quit if they see one.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
use "_U_" in the definitions of "rcsid[]", to eliminate
complaints about those variables being unused;
move the definitions after the include of "interface.h", or add
an include of "interface.h", so that "_U_" is defined.
Include "config.h" before including "tcpdump-stdinc.h" in
"missing/datalinks.c".
|
| |
|
|
|
|
|
|
|
|
|
| |
and make the initialization of some that are otherwise unused if
HAVE_LIBCRYPTO isn't defined conditional on it being defined and #ifdef
them out, too.
#ifndef in some _U_'s for parameters not used if HAVE_LIBCRYPTO isn't
defined.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
attempt fails - it's not interesting to most if not all users, and you
have to worry about the right format (%d is right for size_t on some
platforms, %ld is right on others). Use "error()" to report the error
while we're at it.
|
| |
|
|
|
|
|
|
| |
so, fix the code to correctly handle bytes with the 8th bit set (well,
to handle them correctly if the string is made up solely of single-byte
characters...).
|
|
|
|
|
| |
allow it to compile on Darwin (and there may be other platforms where
that's necessary as well).
|
| |
|
|
|
|
|
| |
versions, and changes to make it work on DOS/Windows with various
compilers and C support libraries.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compile with Sun C, as "interface.h" isn't being included before the
structures are being declared.
Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun
C to generate code that's safe with unaligned accesses, as
"__attribute__" is defined as a do-nothing macro with compilers that
don't support it.
Therefore, we get rid of that tag on the structures to which it was
added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch
16-bit and 32-bit big-endian quantities from packets. We also fix some
other references to multi-byte quantities to get rid of code that tries
to do unaligned loads on platforms that don't support them.
We also throw in a hack that makes those macros use
"__attribute__((packed))" on structures containing only one 16-bit or
32-bit integer to get the compiler to generate unaligned-safe code
rather than doing it by hand. (GCC on SPARC produces the same code that
doing it by hand does; I don't know if GCC on any other big-endian
strict-alignment processor generates better code for that case. On
little-endian processors, as "ntohs()" and "ntohl()" might be functions,
that might actually produce worse code.)
Fix some places to use "%u" rather than "%d" to print unsigned
quantities.
|
|
|
|
|
| |
how far into the packet we parse, so that we don't dissect trailers or,
if it's part of the packet data, an FCS.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
configure doesn't know how to handle this yet.
|