Commit Graph

43 Commits

Author SHA1 Message Date
hannes
1f93803fd1 from Carles Kishimoto <carles.kishimoto@gmail.com>: add support for two more bootp tag options 2007-09-20 15:04:45 +00:00
guy
c708411839 From Francois-Xavier Le Bail: decode DCHP option 249 (Microsoft's
Classless Static Route option) the same way as option 121 (RFC 3442's
Classless Static Route option).
2007-08-21 21:59:11 +00:00
guy
aa976c54cf From Francois-Xavier Le Bail: suport for the DHCP Classless Static Route
option (RFC 3442).

Just modify the "len" variable as we parse an option - no need for a
separate variable representing the amount of data left (I suspect that's
why the wrong variable appears to have been used in the "trailing data
length" message; I'd expect that message to indicate how much *extra*
data there was in the option, not how much *total* data there was in the
option).

Add checks for too-short options in some cases where they were missing.
In the check for the Client FQDN option, skip past what data there is in
the option if it's too short, so it doesn't show up as extra data in the
option.

For the Agent Circuit option, for each suboption:

	check to make sure the suboption length doesn't go past what's
	left in the option;

	don't reject options with an option type or length of 0 (neither
	are forbidden by RFC 3046, and, in fact, RFC 3046 says "a
	sub-option length may be zero");

	use fn_printn() to print the Agent Circuit ID suboption, rather
	than doing the equivalent ourselves with a safeputchar() loop.
2007-07-24 17:28:56 +00:00
guy
90c8108085 From Kevin Steves: in the client FQDN option:
0) fix off by one (4 vs. 3)
	1) print flag bits
	2) print rcode fields if either is non-zero
2007-01-29 20:55:01 +00:00
guy
94dcce9a92 From Kevin Steves: get rid of some extra blanks when printing flags. 2007-01-14 22:40:40 +00:00
guy
ac3e9eddeb From Kevin Steves:
0) use TTEST/TCHECK macros vs. snapend comparisons
	1) when -vvv display PAD and END options
	   (multiple PAD options are summarized)
	2) change a trunc string from bootp to rfc1048 because I think that is
	   what is intended (matches trunc label)
2007-01-14 21:29:22 +00:00
guy
c10cc49cd8 From Kevin Steves: fix the printing of options in a parameter request
list.
2007-01-14 21:22:05 +00:00
hannes
0bbf6ed647 clean up the bootp printer:
-print option/tag numbers and len
-change the tokenstring such that the most common options are human-readable
-add support for option 82 (Agent-ID) suboptions
-make more use ok tok2str() rather thane private lookalives
2006-02-13 18:59:29 +00:00
guy
b2957ddee9 Do more bounds checking. 2005-05-06 04:19:25 +00:00
guy
38a13e9304 Put in some missing brackets. 2005-04-20 10:30:52 +00:00
hannes
544802f183 From: alex medvedev <alexm@pycckue.org>
catch a segfault:
  option 81 min size should be 4 bytes:
    http://sunsite.uakom.sk/doc/rfc/bootp-dhcp-option-81
2004-03-02 07:38:10 +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
fenner
e851f0fc6c Fix typo in truncation check of bp_file 2003-08-01 03:10:11 +00:00
guy
d87f746286 Move the definitions of "bootp_flag_values[]" and "bootp_op_values[]"
out of "bootp.h" into "print-bootp.c", so we don't get unused copies of
them in files other than "print-bootp.c" that include "bootp.h", and so
we don't get warnings from GCC 3.3 about those unused copies.
2003-07-01 19:16:06 +00:00
guy
0661474e3e The source and destination port arguments to "bootp_print()" are no
longer used; get rid of them.
2003-05-01 18:02:12 +00:00
hannes
b466dcdfe6 per bill fenners suggestion:
lets print a little more useful information in non-verbose mode like
  - Request/Reply indication
  - hardware adress
2003-04-28 07:43:03 +00:00
fenner
5d2a060ede Update URL for IANA BOOTP and DHCP extensions registry 2003-03-16 23:43:41 +00:00
fenner
d35664b748 Print the length in the truncation message if we know it.
Fix the CID parser for type=0 (ASCII text) client IDs.
Make the overall parser a little more robust to buggy parsers like
 the CID one by incrementing bp when there are bytes left over.
2003-03-12 19:25:40 +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
fcc82f451d The "__attribute__((packed))" tag on structures causes some files not to
compile with Sun C, as "interface.h" isn't being included before the
structures are being declared.

Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun
C to generate code that's safe with unaligned accesses, as
"__attribute__" is defined as a do-nothing macro with compilers that
don't support it.

Therefore, we get rid of that tag on the structures to which it was
added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch
16-bit and 32-bit big-endian quantities from packets.  We also fix some
other references to multi-byte quantities to get rid of code that tries
to do unaligned loads on platforms that don't support them.

We also throw in a hack that makes those macros use
"__attribute__((packed))" on structures containing only one 16-bit or
32-bit integer to get the compiler to generate unaligned-safe code
rather than doing it by hand.  (GCC on SPARC produces the same code that
doing it by hand does; I don't know if GCC on any other big-endian
strict-alignment processor generates better code for that case.  On
little-endian processors, as "ntohs()" and "ntohl()" might be functions,
that might actually produce worse code.)

Fix some places to use "%u" rather than "%d" to print unsigned
quantities.
2002-12-11 07:13:49 +00:00
hannes
b34c1cc750 changed bootp decoder for multiline output, fixed segfault referencing NULL pointer 2002-12-04 19:09:29 +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
79877e90f4 Get rid of some unnecessary includes (<time.h>, <netdb.h>, and <ctype.h>
are included by <tcpdump-stdinc.h>, so we don't have to include them
explicitly; <errno.h> isn't needed by print routines).
2002-08-06 04:42:04 +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
4c6bada758 Get rid of unneeded incomplete definitions of "struct mbuf" and "struct
rtentry", and unneded includes of <sys/uio.h>, <sys/file.h>, and
<sys/ioctl.h>.
2002-06-01 23:50:30 +00:00
guy
03c3587323 Make the tag in "rfc1048_print()" a 16-bit variable, as 16-bit
quantities are stuffed into it.

Add an unsigned 8-bit variable as well, for 8-bit unsigned quantities.

Stuff unsigned 16-bit quantities into 16-bit variables.

Print unsigned values with "%u".
2002-04-26 04:59:08 +00:00
fenner
c672f00276 Eliminate some unused parameters.
Use const more.
Use EXTRACT_* macros more.
Use TCHECK* more.
Use tok2str() to replace some home-grown workalikes.
smb:
 - Get rid of private types, use tcpdump-defined types
 - Rename fdata and fdata1 to smb_fdata and smb_fdata1 to avoid conflict
   with IRIX library function.
2001-09-17 21:57:50 +00:00
fenner
77352e05a5 Add "$" format, meaning to escape to a special printer (from LBL)
Add "$" printers for NetBIOS Node Type (WNT), DHCP Option Overload (OO),
 Client Identifier (CID), Client FQDN (FQDN)
Change Vendor Class (VC) from decimal string to ASCII string
2001-07-04 21:18:12 +00:00
fenner
c153f2e6ef Don't bother using a variable to store a constant format string
in cmu_print()
2001-04-27 02:17:10 +00:00
itojun
1d753937ea constify/printf audit changes from netbsd. 2001-02-21 05:59:37 +00:00
fenner
0e6bd5e431 Use EXTRACT_* instead of memcpy() to extract numeric values to handle
byte orders properly.
2000-12-04 00:00:08 +00:00
fenner
0eeb5dba9d Undo spamming of rev 1.50 2000-12-03 23:45:37 +00:00
fenner
e89bfcd207 Update for new RFC's and IANA assignments. Many special-format options
are printed as binary strings.  Any of these that are in common use
 can get their own printers.
2000-12-03 23:42:23 +00:00
guy
8fb0656b71 Patch sent to Debian by Roderick Schertler <roderick@argon.org> to print
the time zone offset as a signed 32-bit integer (as RFC 1533 says it is)
rather than as an unsigned 32-bit integer.
2000-10-27 23:26:30 +00:00
guy
8b67f77134 Get rid of unneeded includes of <net/if.h>. 2000-09-28 06:42:55 +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
assar
d16e46379f print client-identifier in hex, from "Gisle Vanem" <gvanem@eunet.no> 2000-07-01 03:56:43 +00:00
assar
3cd171317f remove non-STDC code 2000-07-01 03:38:59 +00:00
fenner
b9ac23ce92 Switch to config.h instead of passing defines in DEFS. 1999-11-21 09:36:43 +00:00
mcr
ce751501ab now prints DHCP options 1999-10-17 23:35:46 +00:00
mcr
f555c163f9 Initial revision 1999-10-07 23:47:09 +00:00