summaryrefslogtreecommitdiff
path: root/print-bootp.c
Commit message (Collapse)AuthorAgeFilesLines
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-7/+7
| | | | | | | | | And, as we require at least autoconf 2.61, and as autoconf 2.61 and later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to define the uintN_t and intN_t macros if the system doesn't define them for us. This lets us get rid of bitypes.h as well.
* NDOize the rest of util.cDenis Ovsienko2014-04-141-6/+6
|
* Netdissectify the to-name resolution routines.Guy Harris2014-04-041-11/+11
| | | | | | | | Have them take a netdissect_options * argument, and get the "no name resolution" flag from it. Move the declaration of dnaddr_string to addrtoname.h, along with the other XXX-to-string routines.
* spell "%s" format strings (complements 708a68a)Denis Ovsienko2014-03-311-2/+2
| | | | | Make "%s" format string always reside in the print function call explicitly such that the reader doesn't have to assess its safety.
* Fix some unsafe print calls.Guy Harris2014-03-301-2/+2
| | | | | | | | | | | | | The format argument to a printf-like routine should either be a constant string or a variable *known* to point to a format string. It should not be an arbitrary string you're trying to print - if that string contains % characters, they will be interpreted as part of a format specification, which can cause crashes (e.g., "%s", if what appears to be an argument corresponding to that %s, when interpreted as a pointer, doesn't point to a valid string) or other incorrect behavior. If you want to print a string, use "%s" as the format and the string as the argument.
* BOOTP: try to fix 2 newly added compile warningsDenis Ovsienko2014-03-271-2/+2
| | | | format not a string literal and no format arguments [-Wformat-security]
* finalize some previous NDO conversionsDenis Ovsienko2014-03-261-31/+31
| | | | | | Eliminate a number of fputs(), putchar() and fflush() uses. Justify preprocessor directives. Don't typecast ND_PRINT() to void and fix some indentation.
* NDOize BOOTP, DHCPv6, DNS, PIM and sFlow decodersDenis Ovsienko2014-03-251-117/+119
| | | | Also add/remove tabs in a few involved functions to justify indentation.
* Use EXTRACT_nBITS even when just testing against zero.Guy Harris2014-01-161-6/+6
| | | | | *All* references to possibly-unaligned multi-byte fields have to be done in an unaligned-safe fashion.
* remove tcpdump's own CVS keywordsDenis Ovsienko2014-01-031-4/+0
| | | | | | 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.
* ndo-ize print-ascii: hex_print_with_offset()Michael Richardson2014-01-011-1/+1
|
* whitespace changesMichael Richardson2014-01-011-1/+1
|
* make consistent use of the "tstr" idiomDenis Ovsienko2013-12-261-2/+2
| | | | | | | | 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).
* justify declarations of struct tok arraysDenis Ovsienko2013-09-241-7/+7
| | | | | | 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.
* removing unnecessary processing for zero length optionshannes2008-04-221-7/+1
|
* from Carles Kishimoto <carles.kishimoto@gmail.com>: add support for two more ↵hannes2007-09-201-5/+11
| | | | bootp tag options
* From Francois-Xavier Le Bail: decode DCHP option 249 (Microsoft'sguy2007-08-211-1/+3
| | | | | Classless Static Route option) the same way as option 121 (RFC 3442's Classless Static Route option).
* From Francois-Xavier Le Bail: suport for the DHCP Classless Static Routeguy2007-07-241-73/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* From Kevin Steves: in the client FQDN option:guy2007-01-291-7/+28
| | | | | | 0) fix off by one (4 vs. 3) 1) print flag bits 2) print rcode fields if either is non-zero
* From Kevin Steves: get rid of some extra blanks when printing flags.guy2007-01-141-5/+5
|
* From Kevin Steves:guy2007-01-141-12/+24
| | | | | | | | 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)
* From Kevin Steves: fix the printing of options in a parameter requestguy2007-01-141-11/+9
| | | | list.
* clean up the bootp printer:hannes2006-02-131-60/+108
| | | | | | | -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
* Do more bounds checking.guy2005-05-061-4/+13
|
* Put in some missing brackets.guy2005-04-201-2/+3
|
* From: alex medvedev <alexm@pycckue.org>hannes2004-03-021-1/+5
| | | | | | catch a segfault: option 81 min size should be 4 bytes: http://sunsite.uakom.sk/doc/rfc/bootp-dhcp-option-81
* Have the configure script arrange that the Makefile define _U_guy2003-11-161-4/+4
| | | | | | | | | | 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.
* From Neil Spring:guy2003-11-151-4/+4
| | | | | | | | | | | 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".
* Fix typo in truncation check of bp_filefenner2003-08-011-2/+2
|
* Move the definitions of "bootp_flag_values[]" and "bootp_op_values[]"guy2003-07-011-1/+12
| | | | | | 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.
* The source and destination port arguments to "bootp_print()" are noguy2003-05-011-2/+2
| | | | longer used; get rid of them.
* per bill fenners suggestion:hannes2003-04-281-25/+18
| | | | | | lets print a little more useful information in non-verbose mode like - Request/Reply indication - hardware adress
* Update URL for IANA BOOTP and DHCP extensions registryfenner2003-03-161-2/+2
|
* Print the length in the truncation message if we know it.fenner2003-03-121-3/+7
| | | | | | 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.
* We no longer use "packetp" for anything, so eliminate it. (If anyguy2002-12-181-13/+2
| | | | | | | | | | | | | 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.
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* changed bootp decoder for multiline output, fixed segfault referencing NULL ↵hannes2002-12-041-25/+31
| | | | pointer
* Get rid of the "-Wno-unused" flag, and fix up most of theguy2002-09-051-3/+2
| | | | | | | | | | | | | | | 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".
* Get rid of some unnecessary includes (<time.h>, <netdb.h>, and <ctype.h>guy2002-08-061-2/+1
| | | | | are included by <tcpdump-stdinc.h>, so we don't have to include them explicitly; <errno.h> isn't needed by print routines).
* Added support for Win32, based on WinPcap.risso2002-08-011-6/+2
|
* whitespace cleanupitojun2002-06-111-2/+2
|
* Get rid of unneeded incomplete definitions of "struct mbuf" and "structguy2002-06-011-4/+1
| | | | | rtentry", and unneded includes of <sys/uio.h>, <sys/file.h>, and <sys/ioctl.h>.
* Make the tag in "rfc1048_print()" a 16-bit variable, as 16-bitguy2002-04-261-18/+19
| | | | | | | | | | 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".
* Eliminate some unused parameters.fenner2001-09-171-18/+17
| | | | | | | | | | | 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.
* Add "$" format, meaning to escape to a special printer (from LBL)fenner2001-07-041-7/+107
| | | | | | 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
* Don't bother using a variable to store a constant format stringfenner2001-04-271-3/+2
| | | | in cmu_print()
* constify/printf audit changes from netbsd.itojun2001-02-211-4/+7
|
* Use EXTRACT_* instead of memcpy() to extract numeric values to handlefenner2000-12-041-7/+11
| | | | byte orders properly.
* Undo spamming of rev 1.50fenner2000-12-031-2/+2
|
* Update for new RFC's and IANA assignments. Many special-format optionsfenner2000-12-031-4/+67
| | | | | are printed as binary strings. Any of these that are in common use can get their own printers.