guy [Mon, 5 Dec 2005 21:48:10 +0000 (21:48 +0000)]
From Gisle Vanem: don't use GCC features such as the ability to declare
variables in the middle of the block., and #if out dccp_hdr_data()
(which is unused, and defined in such a fashion that it doesn't work on
MSVC++, with the structure name and the function name the same).
guy [Mon, 5 Dec 2005 21:46:37 +0000 (21:46 +0000)]
Propagate from main branch:
date: 2005-11-04 00:45:39 +0000; author: hannes; state: Exp; lines: +23 -22
from Ian Mc Donald <imcdnzl AT gmail.com>:
displaying ACKs for close packets
guy [Sun, 13 Nov 2005 20:30:18 +0000 (20:30 +0000)]
We've gotten our IP definitions/declarations from our own "ip.h" for a
while, and it defines IP_MF and IP_DF; we don't need to compensate for
system headers lacking them.
guy [Sun, 13 Nov 2005 20:23:09 +0000 (20:23 +0000)]
Use sizeof to get sizes of various structure members, rather than
hardwiring the sizes (which runs the risk that the hardwired size in the
structure definition and code could get out of sync).
guy [Sun, 13 Nov 2005 12:12:58 +0000 (12:12 +0000)]
Have print_llc() clear out the extracted_ethertype argument, rather than
having its callers do so - some of its callers *weren't* doing so,
leaving random junk in that argument in some cases.
When checking for "802.3-encapsulated" IPX, check the raw values of the
SSAP and DSAP for 0xFF, don't check them after the low-order bit has
been masked off.
The "flag" values in the LLC header aren't bits, they're combinations of
bits, including the combination "no bits"; don't use "bittok2str()" on
them. Also, combine the proper bits, namely the C/R bit (which we
weren't combining) and the P/F bit (which we were).
guy [Sun, 13 Nov 2005 12:07:44 +0000 (12:07 +0000)]
Have parse_elements() flag each item as "present (and not truncated)",
"present but truncated", and "not present", and don't have it return an
indication of whether we ran past the end of a packet - instead, have
the routines that handle particular management frame types use macros
that check what the status of a particular tagged parameter is and:
print it if present and not truncated;
skip it if not present;
return a "packet truncated" indication if present but truncated.
This means we handle tagged parameters that aren't present, and print
parameters that are present and not truncated even if there's a
present-but-truncated field after them.
Add some additional bounds checks.
Make the table of rates bigger - there can be more than 8 rates in a
rates tagged parameter.
guy [Sun, 16 Oct 2005 18:17:12 +0000 (18:17 +0000)]
Before subtracting a value from a prefix length, make sure the prefix
length is >= the value. (In theory, if that check isn't done, the
prefix length will overflow, and, as it's unsigned, that'd make it very
large, and rejected by the other sanity check - but it's cleaner to
check explicitly.)
In decode_rt_routing_info(), fix the checks for the prefix length -
according to draft-marques-ppvpn-rt-constrain-01, the default route
target has a 0-length prefix, and all others have a length between 32
and 96.
guy [Sun, 16 Oct 2005 06:05:46 +0000 (06:05 +0000)]
From Noritoshi Demizu: memcmp() returns a value = 0 if the two memory
regions are =, < 0 if the first memory region is < the second, or > 0 if
the first memory region is > the second, so to check whether two memory
regions are equal, check whether memcmp()'s return value is == 0.
uid2056 [Thu, 13 Oct 2005 09:17:39 +0000 (09:17 +0000)]
Propagate
revision 1.3.2.1
date: 2005/10/02 22:29:54; author: mcr; state: Exp; lines: +0 -0
pullup of working test results
for print-X.out and
revision 1.3.2.1
date: 2005/10/02 22:29:55; author: mcr; state: Exp; lines: +0 -0
pullup of working test results
for print-XX.out to print-capX.out and print-capXX.out, and re-remove
print-X.out and print-XX.out, so that they don't collide with
"print-x.out" and "print-xx.out" on systems with case-insensitive file
systems (not only are modern Windows file systems case-insensitive but
case-preserving, so, by default, is HFS+ on OS X, so you can even have
case-insensitivity on UN*X systems).
hannes [Thu, 29 Sep 2005 07:40:12 +0000 (07:40 +0000)]
rework the LLC printer:
-remove tok2str() and bittok2str() lookalikes
-print length field
-print more self-describing tokensstring
e.g. "Receiver not ready" instead of "rnr"
-add codepoint for SNA
guy [Mon, 26 Sep 2005 01:02:40 +0000 (01:02 +0000)]
Don't set the length of the attributes based on the snapshot length,
just add some additional TCHECK/TCHECK2 bounds checks to the code that
dissects attributes and let that handle the snapshot length checks.
Do the length check once per attribute, rather than doing a single check
up front.
Use TCHECK/TCHECK2 and TTEST/TTEST2, so that we print "too short"
indications. Make the "too short" indications all look the same.
Rename "radius_attr_print()" to "radius_attrs_print()" to make it
clearer that it has a loop to print all attributes, rather than just
printing one attribute.
Add in a bunch of additional bounary/length checks, and do the
As per Steiner Haug, the length of a vendor-specific attribute includes
the type and length bytes, so subtract two from the length to get the
length of the attribute's data.
guy [Wed, 21 Sep 2005 16:50:01 +0000 (16:50 +0000)]
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.
guy [Mon, 5 Sep 2005 18:21:22 +0000 (18:21 +0000)]
But the PDU length checks back, so "tmp" doesn't go negative.
At least as I read RFC 3847, you won't get a system ID without the
remaining hold time field; after printing the flags field, check whether
there's anything else after the flag field and, if not, quit, otherwise
print the remaining hold time field and, if present, the system ID field.
hannes [Mon, 5 Sep 2005 11:16:25 +0000 (11:16 +0000)]
rework the restart signaling TLV printer:
-accept TLV length of 1 as this is now perfectly valid as per rfc 3847
-only attempt to print a trailing system-ID and not a node-ID
hannes [Tue, 9 Aug 2005 20:10:32 +0000 (20:10 +0000)]
-share some code between the FRF.15 and FRF.16 printer
-display B, E & C header flags in the FRF.16 printer
-evaluate the correct data [!flags] in the FRF.15 printer
for deciding if the frame is a end-to-end frag or an interface frag
guy [Sat, 30 Jul 2005 21:37:50 +0000 (21:37 +0000)]
Put calls to print the management frame type in the switch statement,
rather than having a separate table; this makes it clearer that unknown
manaagement frame types already have a message printed, and that you
have to add a call to print that if a new management frame type is
created.
guy [Sat, 30 Jul 2005 00:05:53 +0000 (00:05 +0000)]
Make "subtype_text[]" have 16 elements, for all 16 possible subtypes,
and make all unknown subtypes have null pointers and, if the pointer for
a subtype is null, print the subtype as "Unknown subtype".
Compute the sizes of the tables of authentication algorithm names,
status code strings, and reason code strings at compile time, and use
those values to check whether the value is in the table or not. Get rid
of trailing NULL pointers in those tables.
guy [Fri, 29 Jul 2005 23:51:37 +0000 (23:51 +0000)]
#ifdef references to various Juniper DLT_ values, so that we can build
even on systems with older libpcaps that lack them. (tcpdump isn't
supposed to *require* the corresponding version of libpcap, although it
works best with that version or later.)
hannes [Mon, 11 Jul 2005 20:24:32 +0000 (20:24 +0000)]
code cosmetics:
at places where the entity to print / or increment
shares the semantics of an IPv4 or IPv6 address
use sizeof(in_addr) and sizeof(in6_addr),
rather than a hardcoded 4 or 16
guy [Thu, 7 Jul 2005 01:24:32 +0000 (01:24 +0000)]
Add a flag to suppress the "default_print()" call made in various
link-layer print routines if no other print routine claimed the packet.
Test whether that flag is set rather than testing whether neither of -x
or -q were specified, and have -x, -q, *and* -X set that flag, so that
-X suppresses it just as -x does. That way you don't get those pckets
dumped twice if -X was specified.
guy [Wed, 6 Jul 2005 20:54:48 +0000 (20:54 +0000)]
Have "ascii_print()" do the "-A" output, and nothing but the "-A"
output. Have "hex_and_ascii_print_with_offset()" and
"hex_and_ascii_print()" to the "-X"-style offset, leaving
"hex_print_with_offset()" and "hex_print()" doing the "-x"-style output.
Don't have any of them check "xflag", "Xflag", or "Aflag" - they print
what they're intended to print, and the caller should check the flags in
question.
Don't have "-A" set "xflag" or "Xflag".
This cleans up some problems with "-A" printing hex informatioin - it's
not supposed to.
guy [Wed, 6 Jul 2005 06:49:00 +0000 (06:49 +0000)]
Propagate to the x.9 branch the change
revision 1.18
date: 2005/06/04 22:08:26; author: risso; state: Exp; lines: +2 -2
Defined INET6 in the Windows project to prevent compilation errors of print-dhcp6.c
hannes [Tue, 5 Jul 2005 09:39:29 +0000 (09:39 +0000)]
-code cosmetics: improve readability by replacing "v" by "label_entry"
-do multiline formatting for label-stacks deeper than 1
-hide the IPv4/IPv6 printer under the vflag for explicit NULL labels