Denis Ovsienko [Wed, 26 Mar 2014 09:08:22 +0000 (13:08 +0400)]
finalize some previous NDO conversions
Eliminate a number of fputs(), putchar() and fflush() uses. Justify
preprocessor directives. Don't typecast ND_PRINT() to void and fix some
indentation.
Denis Ovsienko [Tue, 25 Mar 2014 12:26:25 +0000 (16:26 +0400)]
OpenFlow: add IANA-allocated TCP port
OF specifications 1.0.2 and 1.3.3 use a different port number. That
said, the old port is still likely to be seen in the wild after 4 years
of deployment. Let tcpdump recognize both for a while.
Denis Ovsienko [Fri, 14 Mar 2014 05:52:40 +0000 (09:52 +0400)]
justify min()/max() macros declarations and usage
This change moves the macros to tcpdump-stdinc.h to make sure these are
available without interface.h. It also dismisses two redundant macros
MIN() and SMBMIN(). It is intended to fix the following Solaris compile
error:
Undefined first referenced
symbol in file
MIN print-zeromq.o
Denis Ovsienko [Wed, 5 Mar 2014 22:31:25 +0000 (02:31 +0400)]
VRRP: add a sample capture and two test cases
The sample capture consists of VRRPv2/IPv4, VRRPv3/IPv4 and VRRPv3/IPv6
packets. It was produced using 7 MikroTik devices running RouterOS 6.10
and configured for the same set of virtual addresses with different
priorities per device. The devices were powered on one after another
with a ~30 seconds delay in the order of VRRP priority ascending. The
test cases decode the capture with and without "-v".
Gisle Vanem [Wed, 5 Mar 2014 09:19:24 +0000 (13:19 +0400)]
ZMTP: fix an MSVC compiler warning
The prototype and implementation of 'zmtp1_print_datagram()' is slightly
different; the prototype has a 'const u_int len' as the last parameter.
Whereas the implementation has no 'const'. Hence I get a warning from
MSVC.
Guy Harris [Tue, 4 Mar 2014 23:15:09 +0000 (15:15 -0800)]
Use a common style for all option parsers.
Report "length bogus, should be ..." for invalid lengths for all
options. That's not a fatal error - the next option can be parsed - so
don't return 0 in that case.
Don't put a colon after the option length unless there's something
following it.
Do the TCHECKs for particular CCP options in the code to handle the
option, as is done elsewhere.
Print the values for the CCP options on the same line, as is done
elsewhere.
Denis Ovsienko [Fri, 28 Feb 2014 09:10:28 +0000 (13:10 +0400)]
don't include pcap.h needlessly
Both interface.h and netdissect.h include <pcap.h>, thus most files
should not include it regardless if these need it or not. The only
exceptions so far remain:
* addrtoname.c
* missing/datalinks.c
* missing/dlnames.c
* tcpdump.c
Denis Ovsienko [Wed, 26 Feb 2014 14:16:53 +0000 (18:16 +0400)]
revert the latest change
./configure fails during the "BUILD_LIBPCAP=true BUILD_IPV6=true"
scenarios (both GCC and Clang):
Makefile:8411: warning: overriding commands for target `configure'
Makefile:455: warning: ignoring old commands for target `configure'
Makefile:8416: warning: overriding commands for target `stamp-h.in'
Makefile:460: warning: ignoring old commands for target `stamp-h.in'
Makefile:8421: warning: overriding commands for target `stamp-h'
Makefile:465: warning: ignoring old commands for target `stamp-h'
Makefile:8424: warning: overriding commands for target `Makefile'
Makefile:468: warning: ignoring old commands for target `Makefile'
Makefile:8427: warning: overriding commands for target `config.status'
Makefile:471: warning: ignoring old commands for target `config.status'
[...]
./config.status: line 1103: syntax error near unexpected token `done'
./config.status: line 1103: `done # for ac_tag'
I don't have the expertise to resolve it well right now, keep Travis CI
working meanwihle.
Guy Harris [Sun, 16 Feb 2014 10:21:28 +0000 (02:21 -0800)]
Fetch the sequence number the way we fetch the acknowledgment number.
Fetch 24 bits if the X bit isn't set, 48 bits if it is, using the
appropriate EXTRACT_ macros.
We do this with "struct dccp_hdr" being a header structure with a 24-bit
sequence number and "struct dccp_hdr_ext" being a header structure with
a 48-bit sequence number.
Guy Harris [Sun, 16 Feb 2014 04:37:28 +0000 (20:37 -0800)]
Add {40,48,56}-bit big-endian extract macros and use them for DCCP ACKs.
Add macros to, given an octet pointer, extract 40-bit, 48-bit, and
56-bit big-endian numbers from the location pointed to by that pointer,
and use them when extracting ACK numbers from DCCP packets. This fixes
problems on big-endian(!) machines.
Guy Harris [Sun, 16 Feb 2014 04:01:06 +0000 (20:01 -0800)]
Mark structures with UNALIGNED.
Maybe this will fix the crashes that appear to be occurring on the
opencsw.org buildbot; it's building with Sun/Oracle C, not GCC, but it's
at least worth a try.