Commit Graph

91 Commits

Author SHA1 Message Date
Guy Harris
a91d20cc84 Convert the IPv6 printer to use netdissect. 2010-11-07 12:50:16 -08:00
Guy Harris
e8b5237589 Don't directly fetch multi-byte integers from packets.
Use the EXTRACT_ macros to extract multi-byte integral values from
packets, rather than just dereferencing pointers into the packet; there
is no guarantee that the packet data will be aligned on the right
boundary, and there is no guarantee that, if they're not, a direct
access will work correctly.
2010-02-21 00:27:00 -08:00
hannes
78299f4f5b add support for further dissection of the IPCP Compression Option 2005-12-05 11:35:58 +00:00
hannes
5b7e180a56 calculate correct length of LCP echo/echo-reply Magic-Num trailing data 2005-11-03 07:30:25 +00:00
guy
d16e94e848 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()".
2005-06-18 23:55:24 +00:00
guy
6aa76a8290 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.
2005-06-16 00:33:20 +00:00
hannes
d4fd1493e8 -make the PPP printer multiline (behind vflag)
-make more use of tok2str()
-improve unknown option hexprinting
2005-05-08 20:35:20 +00:00
guy
d71a5d9b81 Check, and use, the length from the PAP header. 2005-04-20 22:15:17 +00:00
mcr
4189fb7df6 refactored ip_print() so that chained header parser (ESP/AH) can
more easily call the inner parts.
2005-04-06 21:32:38 +00:00
hannes
523c5cdb69 cleanup: use (PPP_ADDRESS << 8 | PPP_CONTROL) rather than a private 0xff03 2005-01-25 16:27:56 +00:00
hannes
2bb115bda1 clean up the LCP Auth option printer, remove printf() chains and make use of tok2str() instead 2005-01-25 11:22:57 +00:00
hannes
19021b87db bugfix for MLPPP:
inserted the printer at the end of a fall-through chain
  which caused all packets to first get passed through the
  ML-PPP printer and causing bogus display output
2004-10-28 11:21:23 +00:00
hannes
abb16862de - add a brief ML-PPP printer
- add PPP_IPV6 in the PPP name resolution table
- change the cryptic SSNHF LCP options
    to "12 Bit seq #" for better clarity to human devices
2004-10-20 16:14:15 +00:00
hannes
258fb362b9 -add basic support for IP6CP
-make more use of tok2str() in the IPCP options printer
-print length field for empty conf-req messages
2004-09-11 14:23:28 +00:00
hannes
bf4f8908d2 make use of tok2str() in the CHAP and PAP printers, misc. display cosmetics 2004-09-09 16:36:23 +00:00
hannes
a663702261 add ppp support for DLT_PPP_WITHDIRECTION; print direction (hidden under eflag) 2004-08-18 14:56:27 +00:00
guy
832df9e4e7 Fix a comment (that's *not* a "can't happen" situation), and clean up
indentation.
2004-07-15 00:16:49 +00:00
hannes
6df70cbc6d from Darren Reed <darrenr@reed.wattle.id.au>:
catch the self-set null pointer if handle_ctrl_proto()
  stumbles across an unknown control-proto for which we
  have no specific options decoder;
2004-07-13 15:54:05 +00:00
guy
b41896e58d From Darren Reed: just show protocol 0x00fb as "compressed PPP data".
Also, show protocols we don't dissect by name, if we have the name in
"ppptype2str[]".
2004-07-06 22:11:17 +00:00
hannes
7168f3315c per suggestion from darrenr@reed.wattle.id.au: resolve the PPP_COMP proto-id 2004-07-05 10:59:14 +00:00
hannes
af73cfb14d from Darren Reed <darrenr@reed.wattle.id.au>:
support for HDLC inside PPP
2004-07-02 20:17:47 +00:00
hannes
5e801bbe91 call into the ip printer for non-compressed VJ IP packets, indicate the its IP inside the Van Jacobson encaps. 2004-07-02 06:32:47 +00:00
guy
883ff1e92b Add bounds checks. 2004-03-24 03:30:06 +00:00
hannes
0992744be6 display cosmetics: remove the PPP- string from proto output 2004-03-18 10:59:15 +00:00
hannes
b526e557fd add Vendor OUI resulution 2003-11-30 00:18:04 +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
hannes
89f487e976 print opcode number always 2003-10-20 08:26:49 +00:00
hannes
8f94d68a09 don't pass on src & dst MAC adresses to the isoclns decoder as MAC adresses
should be really printed in ether_print() using the eflag
2003-05-22 16:52:36 +00:00
hannes
615f0befd6 print length after LCP options 2003-05-22 15:54:53 +00:00
hannes
4ab75c3560 cleanup Magic-Num fields 2003-05-22 15:40:08 +00:00
hannes
ee4affc8c4 remove some EXTRACT_ lookalikes plus misc. display cleanup 2003-05-22 15:29:22 +00:00
hannes
9545ae8834 - be more verbose about the rejected protocol in handle_ctrl_proto()
- hook in MPLSCP, OSICP and IPV6CP handle_ctrl_proto()
2003-05-22 12:02:24 +00:00
hannes
63c668cbeb minor display cosmetics:
print 3-digit ttl field in print-ip.c
  unbracketize the LCP id in print-ppp.c
2003-05-15 15:25:18 +00:00
hannes
a7092012a3 misc. display cosmetics for e/v flags 2003-05-11 08:59:22 +00:00
hannes
2fb756a9e9 hide link-layer information correct under the eflag 2003-05-08 14:25:04 +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
hannes
a8cd324e5d better handling of PPP protocols which we know but do not have a dissector 2002-11-03 23:04:07 +00:00
hannes
e1de35df0b hide local hexdumping behind vv flag 2002-10-10 17:50:22 +00:00
hannes
fc39732a48 overseen ML-PPP string 2002-09-15 16:28:28 +00:00
hannes
25a9d4f085 more verbose handling of unknown protos 2002-09-15 00:56:25 +00:00
hannes
4c16d72eeb no boundary checking necessary anymore; 2002-09-14 23:06:10 +00:00
hannes
190aa970ee better handling of unknown data in handle_ctrl_proto() 2002-09-14 13:25:36 +00:00
hannes
18738ad2ff more consistent use of tok2str and support for MPLS over PPP 2002-09-14 13:14:04 +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
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