hannes [Mon, 25 Apr 2005 09:09:11 +0000 (09:09 +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:25:23 +0000 (01:25 +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:50:29 +0000 (03:50 +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:21:47 +0000 (02:21 +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:45:34 +0000 (20:45 +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:17:18 +0000 (11:17 +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:50:41 +0000 (10:50 +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:49:52 +0000 (09:49 +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:44:30 +0000 (09:44 +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:30 +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:15 +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:41:02 +0000 (19:41 +0000)]
-bugfix: attempt to print ldp messages as long there is something on the wire
-improve support (add interface paramter TLV parser) for the Martini FEC TLV
guy [Wed, 13 Apr 2005 08:30:41 +0000 (08:30 +0000)]
Don't use "u_long", as its length is not guaranteed to be 4 bytes. In
fact, don't even use "u_int32_t", as we're just pointing into a packet,
which is made up of bytes - use "u_char", and bump the pointer by 4 for
each item.
guy [Sun, 27 Mar 2005 23:16:08 +0000 (23:16 +0000)]
Check for ether_ntohost() after checking for libpcap, so that we do so
after we've checked whether we need -lsocket -lnsl to get routines such
as ether_ntohost().
guy [Sun, 27 Mar 2005 22:38:09 +0000 (22:38 +0000)]
Do the same sort of checks whether ether_ntohost() is declared that we
do in libpcap for ether_hostton(). Include <netinet/ether.h> only if it
declares ether_ntohost(). If nothing declares it, declare it ourselves,
as we do in libpcap.
Don't cast the second argument to ether_ntohost() to a const pointer, as
some systems don't modify it but don't declare that argument as a const
pointer. (This is similar to what we do on libpvap for
ether_hostton().)
guy [Sun, 27 Mar 2005 03:31:01 +0000 (03:31 +0000)]
When testing whether "inline" works, use the V_CCOPT flags, because some
of those might disable inlining; otherwise, the test for inlining will
succeed, but inlining won't work with the options we're using when
compiling.
hannes [Mon, 21 Mar 2005 11:35:55 +0000 (11:35 +0000)]
-add basic support for codeset shifting for IE printing in the frame-relay printer
-harden tok2str() and bittok2str() to catch NULL refs
-don't attempt to print a frame-relay IE if there is not enough bytes on the wire
to print at least a full TLV
hannes [Tue, 8 Mar 2005 08:52:38 +0000 (08:52 +0000)]
code cleanup:
- remove the private print_nsap() and use isonsap_string() instead
- pass on a length indicator to isonsap_string as CLNP and ES-IS,IS-IS TLVs
and options store the length differently (semioctets vs. octets)
- make the isonsap_string() output equal to the now abandoned print_nsap()
printer which reflects representation of contemporary router software
hannes [Thu, 27 Jan 2005 10:13:51 +0000 (10:13 +0000)]
-export the q933 printer and call it from the OSI printer
-display cosmetics:
make the comma settings eflag compatible
place a colon after printing the OSI proto-ID to indicate
that we are crossing a layer boundary