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.
guy [Thu, 21 Apr 2005 03:51:19 +0000 (03:51 +0000)]
AC_TRY_COMPILE works only for code that fits inside "main()"; the test
for __attribute__ doesn't fit inside "main()" with GCC 4.0, as it
defines a function.
guy [Thu, 21 Apr 2005 02:22:38 +0000 (02:22 +0000)]
Put back AC_LBL_C_INLINE; it turns out that wasn't the cause of the
inline problem, and AC_LBL_C_INLINE checks for a case that some versions
of the HP C compiler don't handle, and only uses inline if that case
succeeds.
guy [Wed, 20 Apr 2005 20:46:05 +0000 (20:46 +0000)]
Check for a negative "advance" value, which indicates an error.
Don't make the last statement in a loop a break statement, as that means
the body of the loop will be executed at most once.
When looping over the data in a TCP segment containing BGP packets, loop
until we reach the first of the end of the captured data or the end of
the segment, not just the end of the captured data.
guy [Wed, 20 Apr 2005 11:20:51 +0000 (11:20 +0000)]
Some systems (*cough*Irix*cough) not only don't declare
"ether_ntohost()" but don't even declare "struct ether_addr"; on those
systems, declare "struct ether_addr".
guy [Wed, 20 Apr 2005 10:51:02 +0000 (10:51 +0000)]
If we don't have ether_ntohost(), don't bother declaring it merely
because it's not declared in a system header file, as the reason it's
not declared is that it doesn't exist.
guy [Wed, 20 Apr 2005 09:51:03 +0000 (09:51 +0000)]
From Albert Chin:
1. aclocal.m4 patch required by Tru64 UNIX which has
inttypes.h in a non-standard location so gcc cannot find
the PRI types. So, use <sys/bitypes.h> to get u_int#_t
types for help detecting %llx, etc.
2. Help gcc on aix find ether_ntohost declaration.
guy [Wed, 20 Apr 2005 09:46:42 +0000 (09:46 +0000)]
From Albert Chin:
1. On AIX, AC_LBL_C_INLINE detected the compiler supported
the inline keyword which is wrong. AC_C_INLINE from
autoconf-2.59 worked.
2. AC_CHECK_TYPE from autoconf-2.5x is no longer broken.
Replaced AC_LBL_CHECK_TYPE with it, mainly to use
<sys/bitypes.h> for Tru64 UNIX where some of the u_int#_t
types are defined.
3. Tru64 UNIX 4.0D doesn't support %llx; however, it does support %lx.
4. Added <stdint.h> to interface.h for int#_t types on
Tru64 UNIX 4.0D (required for missing/snprintf.c).
5. Reworked includes in tcpdump-stdinc.h for int#_t types.
guy [Wed, 20 Apr 2005 02:59:49 +0000 (02:59 +0000)]
From Albert Chin: IBM's AIX C compiler complains about "&buf[sizeof
buf]", but doesn't complain about the equivalent "buf + sizeof(buf)".
(C89 allows a pointer into an array to point one element past the end of
the array, so both should, at least as I understand it, be legal, and we
decrement the resulting pointer before we use it, so both should be
safe.)
guy [Tue, 19 Apr 2005 20:33:37 +0000 (20:33 +0000)]
Declare "gndo" as "extern", so that it's only defined in tcpdump.c; on
some platforms, you get linker errors or, at least, warnings from
multiple definitions.
hannes [Tue, 19 Apr 2005 19:42:08 +0000 (19:42 +0000)]
-bugfix: attempt to print ldp messages as long there is something on the wire
-improve support (add interface parameter TLV parser) for the Martini FEC TLV
guy [Sun, 17 Apr 2005 01:38:26 +0000 (01:38 +0000)]
Propagate
date: 2005/04/07 01:27:52; author: mcr; state: Exp; lines: +5 -2
adjust #ifdef to work with NetBSD file as well, which
has slightly different multiple-include protection (alas)