Commit Graph

31 Commits

Author SHA1 Message Date
guy
1fa41f1313 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.
2005-04-26 19:48:38 +00:00
guy
99711cd61e Use %u to print unsigned quantities.
Check, and use, the supplied packet length in the PPPoE dissector.  (It
reflects the actual packet length; snapend reflects the captured packet
length.)

As we're now doing bounds checks with TCHECK, the loop over the tagged
fields doesn't have to check against snapend.
2004-08-27 03:57:40 +00:00
guy
728fd81dac Add some bounds checks. 2004-08-27 03:28:58 +00:00
guy
650537f0cc Improve bounds checking. 2004-03-24 03:04:01 +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
65eedd691a Use the right format to print a value as 2 hex digits. 2003-11-15 01:02:02 +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
dc0522fcb1 Get rid of an unused variable.
Cast lengths to "int" when using them in "%*" formats.

Restore the "TODO print UTF-8 decoded text" comment, as RFC 2516 says
that text in PPPoE is, in fact, UTF-8, and we could, in principle, do
more than just dumping stuff as hex if there are more non-printable than
printable characters (and dumping it as text if there aren't).
2003-07-01 08:36:53 +00:00
hannes
b6b96b4d5f credit Greg Stark as being the original Author of the PPPoE decoder 2003-06-14 06:05:52 +00:00
hannes
b2406c50ca from Greg Stark <gsstark[AT]mit.edu>:
honor the payload length in PPPoE frames to match actual
BRAS and client behaviour
2003-06-13 05:55:21 +00:00
guy
4bec97f457 Hoist a bunch of stuff that should be done by all if_print routines into
tcpdump.c.  Have if_print routines return the length of the link-layer
header, so that the common code knows how to skip the link-layer header
when printing the packet in hex/ASCII.
2002-12-19 09:39:10 +00:00
guy
cfabfb053b Add a new routine "default_print_packet()", which takes a pointer to the
beginning of the raw packet data, the captured length of the raw packet
data, and the length of the link-layer header, and:

	if "-e" was specified, prints all the raw packet data;

	if "-e" was not specified, prints all the raw packet data past
	the link-layer header, if there is any.

Use that routine in all the "xxx_if_print()" routines if "-x" was
specified.

Make "arcnet_encap_print()" static - it's not used outside
"print-arcnet.c".

Add missing info printing code to "atm_if_print()".

Print the packet data in "lane_if_print()", not in "lane_print()", as
"lane_print()" can be called from other "xxx_if_print()" routines, and
those routines will also print the packet data if "-x" was specified -
no need to print it twice.
2002-12-18 09:41:13 +00:00
guy
e070cf232f We no longer use "packetp" for anything, so eliminate it. (If any
dissector really needs source and destination MAC addresses, we should
make global pointers to them - which would be null for packets lacking
MAC addresses, so dissectors that need them will need to do something
sensible if those pointers are null.)

Don't fake up an Ethernet header if there aren't any MAC addresses to
use when faking it up.

"bp_chaddr" in "print-bootp.c" is an array, so "bp->bp_chaddr" cannot be
null, and there's no need to test for it not being null.
2002-12-18 08:53:18 +00:00
guy
c422d3ab0f Get rid of the "-Wno-unused" flag, and fix up most of the
unused-parameter problems reported by GCC.  Add an _U_ tag to label
parameters as unused if the function is called through a pointer (so
that you can't change its signature by removing parameters) or if there
are unused parameters only because the function isn't complete.

Add some additional bounds checks the necessity for which was revealed
while cleaning up unused-parameter problems.

Make some routines static.

"lcp_print()", defined in "print-lcp.c", isn't called anywhere -
"print-ppp.c" has the code to dissect LCP.  Get rid of "print-lcp.c".
2002-09-05 21:25:34 +00:00
risso
3d932490b8 Added support for Win32, based on WinPcap. 2002-08-01 08:52:55 +00:00
guy
b58cddb154 Make "-x" and "-X" work with PPPoE interfaces; based on code from Darren
Reed, with additions to get the PPP header length from the PPP print
routine.
2002-05-29 10:32:00 +00:00
guy
176a3e4986 Put the infodelay wrapping into the remaining "XXX_if_print()" routines.
Split the Cisco HDLC printer into "chdlc_if_print()", which does the
stuff expected of a low-level print routine (printing the time stamp,
printing the final newline, doing the infodelay stuff) and
"chdlc_print()", which doesn't do that stuff.  This lets us clean up
"ppp_hdlc_if_print()" a bit - it can just print the time stamp at the
beginning, and do the infodelay stuff at the end, without having to
treat Cisco HDLC specially by skipping the time stamp printing.  (This
also ensures that the time stamp is always printed, which wasn't the
case before.)

Print the missing final newline in "pppoe_if_print()".
2001-07-05 18:54:13 +00:00
guy
b5e3ba55d0 Add support for NetBSD DLT_PPP_ETHER; adapted from NetBSD changes by
Martin Husemann <martin@netbsd.org>.

Clean up PPPoE dissector - get rid of unused variable, and have it just
use its first argument as a pointer to the PPPoE packet (which may also
make it work if, for example, you have PPPoE packets wrapped inside VLAN
headers).
2001-06-20 07:40:44 +00:00
itojun
b0cc8d65e5 style 2001-06-15 07:24:51 +00:00
guy
d16cf6488c Some compilers may pad structures to a length that's a multiple of 2 or
4 bytes, even though no member in the structure requires such an
alignment; don't use "sizeof (struct ether_header)" or "sizeof (struct
fddi_header)", explicitly #define the header length and use that
#defined value.
2000-10-09 02:59:39 +00:00
guy
e11ed169b1 Get rid of some includes of <net/route.h>, and empty declarations of
"struct mbuf" and "struct rtentry" - they shouldn't be necessary (and
weren't on the platforms on which I tested, both with GCC and the native
compiler if it isn't GCC).
2000-10-06 04:23:10 +00:00
itojun
535dd007b3 some sprintf fixes, from kris@freebsd.org (patches@tcpdump.org #89)
pedant.
2000-10-05 04:10:00 +00:00
guy
8b67f77134 Get rid of unneeded includes of <net/if.h>. 2000-09-28 06:42:55 +00:00
guy
82a146e7f9 In "pppoe_print()", in the loop for processing tags, "tag_type" merely
has to be set to a non-zero value at the beginning of the loop; setting
it to -1 causes some compilers to warn that -1 doesn't fit in an
unsigned short, so set it to 0xffff instead.
2000-09-24 07:46:05 +00:00
guy
e894092542 Add definitions of Ethernet types from
"linux-includes/netinet/if_ether.h" to "ethertype.h".

Move other stuff used by dissectors from <netinet/if_ether.h> to
"ether.h", along the lines of "fddi.h" and "token.h".

Move ARP declarations from BSD include files to "print-arp.c".

Remove from dissectors includes of <netinet/if_ether.h>, and add
includes of "ethertype.h" and/or "ether.h" as necessary.

Get rid of configuration options that test declarations now made in
"ether.h" or "print-arp.c", as those declarations are now under our
control, not the OS's control.
2000-09-23 08: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
f5477a012b remove trailing comma in enum 2000-07-10 04:36:19 +00:00
assar
3cd171317f remove non-STDC code 2000-07-01 03:38:59 +00:00
fenner
b0e32153fc Add prototype for print-pppoe.
Remove unused "caplen" arg from pppoe_print() to agree with how it's called
 in print-ether.c
1999-12-15 00:23:06 +00:00
fenner
b9ac23ce92 Switch to config.h instead of passing defines in DEFS. 1999-11-21 09:36:43 +00:00
assar
b036fcb377 print pppOE. From <kuznet@ms2.inr.ac.ru> 1999-11-21 03:54:24 +00:00