guy [Sat, 18 Jun 2005 23:56:40 +0000 (23:56 +0000)]
The data in an Echo-Request, Echo-Reply, or Discard-Request packet are
just uninterpreted data; calling it "Unknown Data" makes it sound as if
it's data that shouldn't be there or for which we don't have any code to
interpret it. Just call it "Data".
The data in a Protocol-Reject packet is the rejected packet; label it as
such.
The data in an Identification packet is a message intended to be
human-readable; print it with "fn_printn()".
guy [Thu, 16 Jun 2005 00:34:20 +0000 (00:34 +0000)]
Check to make sure PPP options have a minimum length of 2, as the length
includes the lengths of the 1-byte type and length fields. Thanks and a
tip of the hat to Gerald Combs for catching this one with his
fuzz-testing stuff.
guy [Fri, 3 Jun 2005 22:10:14 +0000 (22:10 +0000)]
Use pcap_dump_ftell() rather than casting a pcap_dumper_t * to a FILE *
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).
guy [Mon, 23 May 2005 21:39:16 +0000 (21:39 +0000)]
Do some additional sanity checking.
The first option must be an OPT_LENGTH option; make sure it is, and use
that length when processing the option list, rather than just running to
the end of the packet or an OPT_END, whichever comes first.
guy [Fri, 13 May 2005 23:39:28 +0000 (23:39 +0000)]
Fix up the bounds checking for NetBIOS-over-TCP. Among other things,
this means that we don't go past the end of the captured data when
dumping raw packet data and that we distinguish between "this packet was
cut off by the snapshot length" and "this packet is continued in a
subsequent TCP segment".
hannes [Thu, 12 May 2005 07:23:04 +0000 (07:23 +0000)]
add support for DLT_JUNIPER_PPPOE_ATM printer
replace the JUNIPER_ enums with real DLT_JUNIPER types
(does this break environments where an old libpcap is present ?)
guy [Sun, 8 May 2005 20:01:09 +0000 (20:01 +0000)]
Fix up the bounds checking for NetBIOS-over-TCP. Among other things,
this means that we don't go past the end of the captured data when
dumping raw packet data and that we distinguish between "this packet was
cut off by the snapshot length" and "this packet is continued in a
subsequent TCP segment".
guy [Fri, 6 May 2005 07:57:17 +0000 (07:57 +0000)]
Add an "fn_printzp()" routine for printing null-padded strings (strings
with a maximum length, where a string shorter than that length is padded
with NULs), as "fn_print()" won't handle the maximum length *and* the
snapshot length and "fn_printn()" won't stop on a null string. Use it
where appropriate.
Always pass "snapend" to "fn_print()" and "fn_printn()" if they're
passed a pointer into the packet data; only pass NULL if they're being
handed a pointer into a buffer that's not part of the packet data.
Always check the return value of "fn_print()", "fn_printn()", and
"fn_printzp()" if they're passed "snapend", and do the appropriate
string termination and "packet truncated" indication if they return 1.
guy [Fri, 6 May 2005 02:16:53 +0000 (02:16 +0000)]
Add a bunch of bounds checks.
Don't bother copying the route header - we're using the EXTRACT_ macros,
so we don't have to worry about alignment.
Use the length field from the packet, not just the length of the
containing packet, and check to make sure the containing packet is long
enough to contain it.
Add a bunch of checks against the packet length.
In "default_print()" calls, cut the length off at the captured data
length. In other calls, don't - let the bounds checks handle caplen <
length.
risso [Wed, 4 May 2005 19:22:50 +0000 (19:22 +0000)]
Added some new files to the cygnus and MSVC makefiles. The cignus makefile
still doesn't work because of the missing support for getnameinfo() into the
official release of cygwin.
guy [Wed, 27 Apr 2005 21:44:06 +0000 (21:44 +0000)]
Get rid of the multiple-include protection in our RPC headers, so we
include them even if we also happen to have included system RPC headers,
as we want *our* versions of the structures (which use types with
explicit sizes for structure members, as we use them for on-the-wire
data).
Change pmap_prot.h to prefix all #defines and structure names with
"SUNRPC_" or "sunrpc_", to avoid collisions with any definitions and
structure names from the system header files.
guy [Wed, 27 Apr 2005 01:13:46 +0000 (01:13 +0000)]
From Alexander Dupuy: don't define our own [hn]to[nh][sl] macros if
__ntohl is defined; __ntohl is defined in some OSes as a special asm
function that does the same sort of fast byte swapping, and that gets in
the way of our so defining it.
guy [Tue, 26 Apr 2005 19:48:56 +0000 (19:48 +0000)]
According to RFC 2516, use of the End-Of-List tag is not required, and
at least one PPPoE implementation doesn't put that tag into the tag
list, so we can't ignore the payload length.
hannes [Tue, 26 Apr 2005 09:42:44 +0000 (09:42 +0000)]
differentiate between SLARP_LEN and SLARP_MIN_LEN - otherwise we do print the trailing-junk message for all short frames (and we should it print for frames > 18
guy [Tue, 26 Apr 2005 07:27:15 +0000 (07:27 +0000)]
Make "snap_print()" handle fetching and printing the OUI.
Don't copy the LLC header to a "struct llc", just construct the
individual fields.
Fetch the control field early in the dissection process, and check to
make sure we have at least 4 bytes of LLC header if it's not a U frame.
Fetch both bytes of the control field for I and S frames, and display
all 4 hex digits of it.
Only dissect UI frames as BPDUs, and pass the BPDU dissector a pointer
to the beginning of the BPDU, not the beginning of the LLC header - not
all BPDUs are encapsulated in LLC headers.
hannes [Mon, 25 Apr 2005 09:11:04 +0000 (09:11 +0000)]
bugfix: do not attempt to decode zero-length TLVs, only attempt to decode IS-REACH (varlength) TLVs if the TLV length indicates that there is at least a single byte on the wire
guy [Sun, 24 Apr 2005 01:26:27 +0000 (01:26 +0000)]
Albert Chin's patch to libpcap's configure.in:
AC_CHECK_DECLS will define the HAVE_DECL_xxx variable whether it
succeeds or fails, so you can't erase a "no" result and try
again with a different header. Use AC_CHECK_DECL, which doesn't
define HAVE_DECL_xxx, and then explicitly define it based on
whether we found a declaration or not.