summaryrefslogtreecommitdiff
path: root/print-lmp.c
Commit message (Collapse)AuthorAgeFilesLines
* LMP: Modernize packet parsing style.Denis Ovsienko2020-12-031-8/+3
| | | | | Enable ND_LONGJMP_FROM_TCHECK. Remove a redundant ND_TCHECK_LEN() instance. Reduce scope for a variable.
* Use the Wayback Machine for some removed documentsFrancois-Xavier Le Bail2020-02-061-1/+1
|
* More bounds checking when fetching addresses and converting to strings.Guy Harris2020-01-191-16/+16
| | | | | | | | | | | | | | Replace more calls to ipaddr_string()/ip6addr_string() with calls to GET_IPADDR_STRING()/GET_IP6ADDR_STRING() macros performing bounds checking. Add similar bounds-checking inline functions and macros to wrap linkaddr_string(), etheraddr_string(), and isonsap_string() and convert calls to them to use the macros as well. Shuffle the inline functions in addrtoname.h around a bit, so that the inline functions, external declarations, and macros are all in the same order.
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-115/+115
| | | | | | | The exceptions are currently: Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer. An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer pointer.
* LMP: Fix a loop for undefined behavior at runtimeFrancois-Xavier Le Bail2019-03-201-0/+5
| | | | | | | | The error was: print-lmp.c:1132:13: runtime error: unsigned integer overflow: 249 - 516 cannot be represented in type 'unsigned int' Update the output of a test accordingly.
* LMP: Rename a variableFrancois-Xavier Le Bail2019-03-201-4/+4
| | | | Use 'length' as in most similar cases.
* Fix spacesFrancois-Xavier Le Bail2018-09-031-1/+1
|
* Print truncations with nd_print_trunc() instead of tstr[] stringsFrancois-Xavier Le Bail2018-05-041-2/+1
| | | | | | | | Remove the tstr[] strings. Update the output of some tests accordingly. Moreover: Add or update some ndo_protocol fields.
* Remove useless commentsFrancois-Xavier Le Bail2018-03-191-6/+0
|
* Add the ndo_protocol field in the netdissect_options structureFrancois-Xavier Le Bail2018-03-161-0/+1
| | | | | Update this field in printer entry functions. It will be used for some printings.
* Add and use tstr[]Francois-Xavier Le Bail2018-02-131-1/+3
| | | | Update the output of some tests accordingly.
* Always include <config.h> rather than "config.h".Guy Harris2018-01-211-1/+1
| | | | | | | | This can prevent bizarre failures if, for example, you've done a configuration in the top-level source directory, leaving behind one config.h file, and then do an out-of-tree build in another directory, with different configuration options. This way, we always pick up the same config.h, in the build directory.
* Use quoted include netdissect-stdinc.h instead of angle-bracketed oneFrancois-Xavier Le Bail2018-01-211-1/+1
|
* Update ND_PRINT() as a variadic macroFrancois-Xavier Le Bail2018-01-071-175/+175
|
* Use ND_TTEST_SIZE()/ND_TCHECK_SIZE() macros (1/n)Francois-Xavier Le Bail2018-01-031-1/+1
|
* Use nd_ types, add EXTRACT_ calls.Guy Harris2017-12-301-23/+25
|
* Remove all storage class specifier 'register'Francois-Xavier Le Bail2017-12-131-1/+1
| | | | | | Let the compiler do the optimizations (or not) based on build options. Avoid 'value has been optimized out' messages in gdb using '-O0'.
* Replace ND_TTEST2()/ND_TCHECK2() macros by macros using pointers (1/n)Francois-Xavier Le Bail2017-12-111-2/+2
| | | | | ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
* Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-105/+105
| | | | | | | | | | | | | | | | Now all the macros have a name meaning a count in bytes. With _S_: signed, _U_: unsigned e.g.: EXTRACT_BE_32BITS -> EXTRACT_BE_U_4 EXTRACT_LE_32BITS -> EXTRACT_LE_U_4 ... EXTRACT_BE_INT32 -> EXTRACT_BE_S_4 and have: EXTRACT_8BITS -> EXTRACT_U_1 EXTRACT_INT8 -> EXTRACT_S_1
* Use more the EXTRACT_8BITS() macro to fetch a one-byte value (2/n)Francois-Xavier Le Bail2017-11-191-1/+1
| | | | In tok2str() calls.
* Rename EXTRACT_nBITS() macros to EXTRACT_BE_nBITS()Francois-Xavier Le Bail2017-11-181-87/+87
| | | | | It indicates clearly that these macros are used to extract big-endian integral values.
* Fix spacesFrancois-Xavier Le Bail2017-11-171-15/+15
|
* Don't specify struct as "const" within sizeof().Denis Ovsienko2017-09-131-3/+3
| | | | | The only difference the const qualifier makes in this context is visual, make it consistent with the rest of the source code.
* CVE-2017-13003/Clean up the LMP dissector.Guy Harris2017-09-131-82/+350
| | | | | | | | | | | | | | | | | | | | | Do a lot more bounds and length checks. Add a EXTRACT_8BITS() macro, for completeness, and so as not to confuse people into thinking that, to fetch a 1-byte value from a packet, they need to use EXTRACT_16BITS() to fetch a 2-byte value and then use shifting and masking to extract the desired byte. Use that rather than using EXTRACT_16BITS() to fetch a 2-byte value and then shifting and masking to extract the desired byte. Don't treat IPv4 addresses and unnumbered interface IDs the same; the first should be printed as an IPv4 address but the latter should just be printed as numbers. Handle IPv6 addresses in more object types while we're at it. This fixes a buffer over-read discovered by Forcepoint's security researchers Otto Airamo & Antti Levomäki. Add a test using the capture file supplied by the reporter(s).
* zero change: update Hannes Gredler's emailHannes Gredler2017-07-281-1/+1
|
* Remove unnecessary semicolonsFrancois-Xavier Le Bail2016-08-291-1/+1
| | | | Using Coccinelle script semicolon.cocci
* Add a summary comment in all other printersFrancois-Xavier Le Bail2016-08-151-2/+4
| | | | | | | Moreover: Remove some redundant comments Update some summary comments Update the specification URL for ATA over Ethernet (AoE) protocol
* Don't require IPv6 library support in order to support IPv6 addresses.Guy Harris2015-09-171-10/+0
| | | | | | | | | | | | | Have our own routines to convert between IPv4/IPv6 addresses and strings; that helps if, for example, we want to build binary versions of tcpdump for Windows that can run both on NT 5 (W2K/WXP), which doesn't have inet_ntop() or inet_pton(), and NT 6 (Vista/7/8/10), which do. It also means that we don't require IPv6 library support on UN*X to print addresses (if somebody wants to build tcpdump for older UN*Xes lacking IPv6 support in the system library or in add-on libraries). Get rid of files in the missing directory that we don't need, and various no-longer-necessary autoconf tests.
* Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'Francois-Xavier Le Bail2015-09-101-1/+1
| | | | Get the full log via: git log --follow netdissect-stdinc.h
* Printers must include 'netdissect.h', not 'interface.h'Francois-Xavier Le Bail2015-09-051-1/+1
|
* dismiss NETDISSECT_REWORKED macroDenis Ovsienko2015-03-221-1/+0
| | | | | | | The purpose of this macro was to enable the file-by-file switch to NDO, after which only tcpdump.c had a use of it and the definitions guarded by it. Update tcpdump.c not to require them any more and dismiss the unused definitions.
* clean K&R style up in function declarations a bitDenis Ovsienko2015-03-051-2/+2
| | | | The function body should have its opening brace on the next line.
* don't reinvent ND_TCHECK2()Denis Ovsienko2014-06-121-4/+2
|
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-9/+9
| | | | | | | | | 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.
* Netdissectify the to-name resolution routines.Guy Harris2014-04-041-10/+10
| | | | | | | | 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.
* NDOize Frame Relay, LMP and RADIUS decodersDenis Ovsienko2014-03-181-121/+119
|
* remove tcpdump's own CVS keywordsDenis Ovsienko2014-01-031-5/+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-2/+8
|
* whitespace changesMichael Richardson2014-01-011-71/+71
|
* LMP: fix some minor output issuesDenis Ovsienko2013-09-091-8/+8
| | | | Fix a typo and suppress trailing spaces/tabs in a few cases.
* Fix a bunch of "sizeof(sizeof(XXX))".Sascha Wildner2011-12-071-1/+1
| | | | | | | | In some places, there was one too many levels of sizeof() - sizeof(sizeof(XXX)) is sizeof(size_t), but we wanted the size of type XXX. Reviewed-By: Guy Harris <guy@alum.mit.edu>
* add a reference to rfc 4204hannes2007-08-021-1/+3
|
* remove redundant TRUE|FALSE defshannes2006-06-231-4/+1
|
* remove formatting from errorvalues token table, refactor Hello printer to ↵hannes2006-03-281-13/+13
| | | | single-line output
* bugfix: correct display of bandwitdh valueshannes2006-03-281-4/+4
|
* bugfix lmp header CC down definition, fix idendationhannes2006-03-281-7/+7
|
* From Manu Pathak: add support for LMP Service Discovery extensionsguy2005-05-191-2/+173
| | | | (defined in the UNI 1.0 spec).
* from Carles Kishimoto <ckishimo@ac.upc.es>: complete DATALINKs subobject ↵hannes2004-04-271-3/+44
| | | | dissector
* print bandwidth related infos in Mbps rather than hexhannes2004-04-261-4/+9
|
* from Carles Kishimoto <ckishimo@ac.upc.es>: complete the outstanding objects ↵hannes2004-04-261-12/+175
| | | | as per draft-ietf-ccamp-lmp-10