Commit Graph

26 Commits

Author SHA1 Message Date
Denis Ovsienko
d57e945e5e NDOize EIGRP, ICMP, L2TP, STP and UDP decoders 2014-03-15 23:25:06 +04:00
Denis Ovsienko
fe3253b9b8 remove tcpdump's own CVS keywords
Remove lots of $Header's and a few $Id's that all belong to the former
CVS repository of tcpdump itself. These keywords have been frozen since
the migration to git in late 2008.
2014-01-03 00:59:08 +04:00
Guy Harris
27d428c0a1 Pull a bunch of headers into the only source file that includes them.
For headers included in only one source file, put the header contents in
the source file in question, and get rid of a bunch of stuff from the
header not used in the source file.
2013-12-30 22:52:15 -08:00
Denis Ovsienko
d8acd8f5d0 make consistent use of the "tstr" idiom
For each decoder that has more than one instance of truncation signaling
and prints the same string in each instance make sure that the string is
declared as "static const char tstr[]" right after the initial includes
block. Where necessary, replace fputs(s, stdout) with equivalent
printf("%s", s).
2013-12-26 18:19:50 +04:00
Denis Ovsienko
7de355927b justify declarations of struct tok arrays
Make sure all of them are declared const and most of them -- static.
Proper declaration of token arrays is a common review point for new code
that is based on existing decoders. Thus fix the issue at its root.
2013-09-24 20:54:03 +04:00
Guy Harris
c91c13825f Just use a u_char * to go through the packet data; don't try to be
clever and use a u_int16_t * - the generated code will be the same, and
this code works even if the Offset Size field value is odd.
2009-08-18 14:56:06 -07:00
hannes
617f68b272 remove redundant TRUE|FALSE defs 2006-06-23 02:03:09 +00:00
guy
d2b1b6c778 If the length is specified, check to make sure it doesn't go past the
end of the packet, and isn't shorter than the header length.

Control messages have to have lengths.
2005-04-20 21:49:56 +00:00
guy
c0f9c66c4f Get rid of an unused variable. 2005-04-20 21:36:09 +00:00
guy
9511388a32 Check to make sure the length of an AVP is large enough to include the
AVP header and doesn't go past the remaining length of the packet.
2003-12-26 23:20:58 +00:00
guy
bbc1cfa669 Have the configure script arrange that the Makefile define _U_
appropriately, and that GNUmakefile and the MSVC++ project file define
it apppriately, as we do with libpcap, rather than defining it in
"interface.h".

Undo the rcsid-shuffling and addition of extra #includes, as we no
longer need to arrange that "interface.h" be included before using _U_
in an RCS ID or copyright.
2003-11-16 09:36:07 +00:00
guy
3824a6c041 From Neil Spring:
use "_U_" in the definitions of "rcsid[]", to eliminate
	complaints about those variables being unused;

	move the definitions after the include of "interface.h", or add
	an include of "interface.h", so that "_U_" is defined.

Include "config.h" before including "tcpdump-stdinc.h" in
"missing/datalinks.c".
2003-11-15 00:39:12 +00:00
guy
edb0e92cdc Add a few more GCC warnings on GCC >= 2 for ".devel" builds.
From Neil T. Spring: fixes for many of those warnings:

	addrtoname.c, configure.in: Linux needs netinet/ether.h for
	ether_ntohost

	print-*.c: change char *foo = "bar" to const char *foo = "bar"
	to appease -Wwrite-strings; should affect no run-time behavior.

	print-*.c: make some variables unsigned.

	print-bgp.c: plen ('prefix len') is unsigned, no reason to
	validate by comparing to zero.

	print-cnfp.c, print-rx.c: use intoa, provided by addrtoname,
	instead of inet_ntoa.

	print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to
	be false, so check for (u_int)-1, which represents failure,
	explicitly.

	print-isakmp.c: complete initialization of attrmap objects.

	print-lwres.c: "if(x); print foo;" seemed much more likely to be
	intended to be "if(x) { print foo; }".

	print-smb.c: complete initialization of some structures.

In addition, add some fixes for the signed vs. unsigned comparison
warnings:

	extract.h: cast the result of the byte-extraction-and-combining,
	as, at least for the 16-bit version, C's integral promotions
	will turn "u_int16_t" into "int" if there are other "int"s
	nearby.

	print-*.c: make some more variables unsigned, or add casts to an
	unsigned type of signed values known not to be negative, or add
	casts to "int" of unsigned values known to fit in an "int", and
	make other changes needed to handle the aforementioned variables
	now being unsigned.

	print-isakmp.c: clean up the handling of error/status indicators
	in notify messages.

	print-ppp.c: get rid of a check that an unsigned quantity is >=
	0.

	print-radius.c: clean up some of the bounds checking.

	print-smb.c: extract the word count into a "u_int" to avoid the
	aforementioned problems with C's integral promotions.

	print-snmp.c: change a check that an unsigned variable is >= 0
	to a check that it's != 0.

Also, fix some formats to use "%u" rather than "%d" for unsigned
quantities.
2002-09-05 00:00:07 +00:00
risso
3d932490b8 Added support for Win32, based on WinPcap. 2002-08-01 08:52:55 +00:00
itojun
111ff8a61d whitespace cleanup 2002-06-11 17:08:37 +00:00
guy
eba1a41534 From Rick Watson <watsonrick@users.sourceforge.net>: use
unaligned-extraction macros to fetch 16-bit and 32-bit big-endian
quantities.
2002-05-25 09:41:06 +00:00
guy
ebec80a51b Squelch a compiler warning. 2001-11-10 21:37:58 +00:00
guy
de390b1f7e L2TP dissector changes, from Motonori Shindo:
o completely TCHECK()-ified
  o PPP disconnect cause info AVP support added (RFC3145)
  o use u_int16_t/u_int32_t instead of u_short/u_int
  o use tok2str() to better support discrete array
  o fixed bug (Authen Name AVP is now decoded as a string)
  o code clean up
2001-11-05 10:03:27 +00:00
itojun
1d0f632354 more detailed output in ppp/pppoe/l2tp.
From: Motonori Shindo <mshindo@mshindo.net>
2000-08-18 07:44:45 +00:00
assar
1deef47516 updates/bug fixes from Motonori Shindo <mshindo@mshindo.net> 2000-07-01 03:48:44 +00:00
itojun
c4521bbf47 * print-rt6.c: make IPv6 routing header printing work with new 2292bis
API.
* print-bgp.c: improve options printing.  ugly code exists for
  unaligned option parsing (need some fix).
* const poisoning in SMB decoder.
* make dump format back to original.  someone may want to add an
  option to do ascii printing, but keep the default behavior as is
  for scripts used in many places.
* -Wall -Werror clean checks.
1999-12-22 06:27:19 +00:00
fenner
80e8a9bd28 Include stdio.h and fix up printf formats. 1999-12-15 06:55:43 +00:00
fenner
b9ac23ce92 Switch to config.h instead of passing defines in DEFS. 1999-11-21 09:36:43 +00:00
assar
bf782e5566 fixes to make ansi-pedantic compilers happier. no char types for bit fields and minor type correctness 1999-11-17 04:14:50 +00:00
itojun
70fbff8d34 HP-UX 10.20 build fix <http://www.sics.se/~assar/tcpdump_patches/13>
#ifdef h_errno, snprintf -> sprintf, arpa/inet.h for [hn]to[hn][sl]
1999-10-30 23:45:50 +00:00
itojun
c9d84d15c5 Bring in KAME IPv6 tcpdump. replaces esp/ah/isakmp decoder.
Hope I did not break anything.  Portability on IPv4-only node needs checking,
I'll do this very soon.  (sorry for rather jumbo commit)

XXx what is _FAVOR_BSD?
1999-10-30 05:11:06 +00:00