Commit Graph

14 Commits

Author SHA1 Message Date
Guy Harris
8bf7a9197c Squelch a warning.
We're returning the calculated checksum result modulo 65536, given that
Internet checksums are 16-bit; throw in a cast to let MSVC know that
this is intended.
2018-12-10 20:14:57 -08:00
Guy Harris
fb2479d733 Always include <config.h> rather than "config.h".
This can prevent bizarre failures if, for example, you've done a
configuration in the top-level source directory, leaving behind one
config.h file, and then do an out-of-tree build in another directory,
with different configuration options.  This way, we always pick up the
same config.h, in the build directory.
2018-01-21 12:27:28 -08:00
Francois-Xavier Le Bail
513f782ae1 Use quoted include netdissect-stdinc.h instead of angle-bracketed one 2018-01-21 10:28:15 +01:00
Francois-Xavier Le Bail
5cea270318 Remove all storage class specifier 'register'
Let the compiler do the optimizations (or not) based on build options.

Avoid 'value has been optimized out' messages in gdb using '-O0'.
2017-12-13 19:17:47 +01:00
Guy Harris
fd2a4d9ad2 Use uintptr_t to look at the bits of a pointer.
We use AC_TYPE_UINTPTR_T in the configure script, so it'll be defined if
we use autotools, and MSVC has supported it since at least Visual Studio
.NET 2003, so we'll use it instead of "unsigned long"; "unsigned long"
causes warnings on LLP64 platforms, as it's not wide enough for a
pointer on those platforms.
2015-12-15 11:22:19 -08:00
Francois-Xavier Le Bail
f5fe14663d libnetdissect code must include 'netdissect.h', not 'interface.h'
Moreover:
Remove netdissect.h include in interface.h
Move thiszone declaration in netdissect.h
Update a comment
2015-09-11 13:22:56 +02:00
Francois-Xavier Le Bail
99c91c3aec Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'
Get the full log via: git log --follow netdissect-stdinc.h
2015-09-10 08:50:40 +02:00
Guy Harris
69cb46af91 Fix a bunch of de-constifications. 2015-04-26 17:24:42 -07:00
Denis Ovsienko
38700c7f24 dismiss NETDISSECT_REWORKED macro
The purpose of this macro was to enable the file-by-file switch to NDO,
after which only tcpdump.c had a use of it and the definitions guarded
by it. Update tcpdump.c not to require them any more and dismiss the
unused definitions.
2015-03-22 10:06:15 +00:00
Guy Harris
a2633f2f21 More fixes for uint8_t being shorter than u_int8_t.
Fix a typo while we're at it.
2014-04-23 11:53:22 -07:00
Guy Harris
ed85e20e4d u_intN_t is dead, long live uintN_t.
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.
2014-04-23 00:20:40 -07:00
Guy Harris
5cdf53e257 Define NETDISSECT_REWORKED in a bunch of files, and fix the issues it finds.
The only one it found was that routines in sigsecret.c needed to refer
to ndo->ndo_sigsecret, not just sigsecret.
2014-04-04 00:53:03 -07:00
Guy Harris
9bfe2abe60 Get rid of $Id$ - you can't get that with Git. 2011-06-16 21:52:31 -07:00
Guy Harris
94a4b46080 Go with Wireshark's Internet checksum routine.
The Wireshark routine is based on the BSD in-kernel portable checksum
routine (thus BSD-licensed); it takes a vector of pointers and lengths
and checksums the concatenation of the buffers in question (just as the
BSD in-kernel routine checksums a chain of mbufs).

This simplifies the "with a pseudo-header" checksums; hopefully it'll
fix up the problems being seen on some big-endian platforms, which might
be due to hand-calculating some or all of the checksum and doing so
incorrectly.  It also gets rid of some code that might be dereferencing
unaligned pointers.
2011-06-13 14:08:51 -07:00