summaryrefslogtreecommitdiff
path: root/print-cdp.c
Commit message (Collapse)AuthorAgeFilesLines
* Use HTTPS in an URLFrancois-Xavier Le Bail2020-02-061-1/+1
|
* 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-2/+2
| | | | | | | | | | | | | | 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.
* Squelch more warnings.Guy Harris2019-04-171-4/+6
|
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-28/+34
| | | | | | | 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.
* Add the ndo parameter to some functionsFrancois-Xavier Le Bail2019-03-261-3/+4
| | | | This parameter will be needed at the next step.
* CDP: Fix two loops for undefined behavior at runtimeFrancois-Xavier Le Bail2019-03-171-2/+4
| | | | | | | | The errors were: print-cdp.c:363:13: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'u_int' (aka 'unsigned int') print-cdp.c:375:13: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'u_int' (aka 'unsigned int')
* Print truncations with nd_print_trunc() instead of tstr[] stringsFrancois-Xavier Le Bail2018-05-041-3/+2
| | | | | | | | Remove the tstr[] strings. Update the output of some tests accordingly. Moreover: Add or update some ndo_protocol fields.
* Rename the fn_printX() functions to nd_printX()Francois-Xavier Le Bail2018-04-301-6/+6
| | | | | | | The functions are: nd_print, nd_printztn, nd_printn and nd_printzp. Trying to make it clearer that they currently have to be used only on part of the packet buffer. Update some comments.
* 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.
* 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
|
* Fix VoIP VLAN request/assignment, clean up signed vs. unsigned.Guy Harris2018-01-101-21/+38
| | | | | | | | | | 0x000f is a query for a VoIP VLAN ID, 0x000e is the reply for that. 0x0010 is a power consumption message. Display 2-byte VoIP VLAN queries. Treat 2-byte VoIP VLAN replies as errors; I've seen the former but not the latter. Don't use unsigned long for values that fit in an unsigned int.
* Update ND_PRINT() as a variadic macroFrancois-Xavier Le Bail2018-01-071-46/+46
|
* Replace ND_TTEST2()/ND_TCHECK2() macros by macros using pointers (1/n)Francois-Xavier Le Bail2017-12-111-6/+6
| | | | | ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
* Use more the EXTRACT_U_1() macro (52/n)Francois-Xavier Le Bail2017-12-091-2/+2
| | | | Assignment, p[n]
* Use more the EXTRACT_U_1() macro (51/n)Francois-Xavier Le Bail2017-12-091-1/+2
| | | | Moreover: Use more the ND_ISPRINT() macro.
* Use more the EXTRACT_U_1() macro (31/n)Francois-Xavier Le Bail2017-11-271-4/+4
| | | | | | In ND_PRINT() macro call(s) (step 9). *(p)
* Use more the EXTRACT_U_1() macro (29/n)Francois-Xavier Le Bail2017-11-261-1/+1
| | | | | | In ND_PRINT() macro call(s) (step 8). *(p + e)
* Use more the EXTRACT_U_1() macro (28/n)Francois-Xavier Le Bail2017-11-261-1/+3
| | | | | | In ND_PRINT() macro call(s) (step 7). p[n] ...
* Use more ND_TCHECK_n()/ND_TTEST_n() macrosFrancois-Xavier Le Bail2017-11-241-5/+5
|
* Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-16/+16
| | | | | | | | | | | | | | | | 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 (22/n)Francois-Xavier Le Bail2017-11-221-4/+8
| | | | | | In ND_PRINT() macro calls, *p++. Partial list.
* Use more the EXTRACT_8BITS() macro to fetch a one-byte value (20/n)Francois-Xavier Le Bail2017-11-221-1/+1
| | | | | | e op *p Partial list.
* Use more the EXTRACT_8BITS() macro to fetch a one-byte value (18/n)Francois-Xavier Le Bail2017-11-211-1/+1
| | | | | | Assignment, *(p op e) Partial list.
* Use pointer expressions like in most similar casesFrancois-Xavier Le Bail2017-11-201-1/+1
|
* Use more the EXTRACT_8BITS() macro to fetch a one-byte value (12/n)Francois-Xavier Le Bail2017-11-201-3/+3
| | | | In ND_PRINT() macro calls.
* Rename EXTRACT_nBITS() macros to EXTRACT_BE_nBITS()Francois-Xavier Le Bail2017-11-181-10/+10
| | | | | It indicates clearly that these macros are used to extract big-endian integral values.
* CDP: Remove a useless lineFrancois-Xavier Le Bail2017-11-171-1/+0
| | | | | The value was fetched before: al = EXTRACT_16BITS(&p[pl]); /* address length */
* Move the printer summaries from INSTALL.txt to each printerFrancois-Xavier Le Bail2016-08-141-0/+2
| | | | | | | | with the tag '\summary:' for greping. Remark: Currently some printers have no summary line. Moreover: Summarize all printers with a single line in INSTALL.txt
* CDP: Filter out non-printable charactersFrancois-Xavier Le Bail2015-11-091-3/+5
| | | | Add a fn_print_char() to do filtering.
* Don't require IPv6 library support in order to support IPv6 addresses.Guy Harris2015-09-171-4/+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
* Remove obsolete commentsFrancois-Xavier Le Bail2015-09-071-1/+1
|
* 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.
* Fix some typosFrancois-Xavier Le Bail2014-12-171-1/+1
|
* CDP: fix "Unchecked return value" found by CoverityFrancois-Xavier Le Bail2014-12-081-6/+6
| | | | | | The bounds check is already done before by ND_TCHECK2(*tptr, len). So we are deliberately ignoring the return values of fn_printn with last argument NULL (no bounds check).
* Update a URL.Guy Harris2014-08-151-1/+1
|
* More #defines for CDP lengths and offsets.Guy Harris2014-08-151-10/+17
|
* Add TLV length checks, fix another length check.Guy Harris2014-08-151-1/+19
|
* Use tabs consistently.Guy Harris2014-08-151-85/+85
|
* Qualify "length" when printing it.Guy Harris2014-08-141-2/+2
| | | | | | | In the "the TLV length is too short" message, we're printing the length of the entire TLV; report it as "TLV length". If we pass that test, we've subtracted out the lengths of the T and the L, leaving only the length of the V, so report it as "value length".
* Merge git://github.com/the-tcpdump-group/tcpdumpGuy Harris2014-08-141-10/+11
|\
| * Print checksum in hex, and print the actual checksum, plus cleanupJamie Bainbridge2014-08-141-9/+10
| |
* | Check for TLV length too small.Guy Harris2014-08-141-3/+13
|/ | | | | | | | The TLV length includes the T and the L, so it must be at least 4. This means we don't need the "avoid infinite loop" check later; that check was wrong, as per GitHub issue #401 and #402; this fixes #402, which has a different patch for that bug.
* don't reinvent ND_TCHECK2()Denis Ovsienko2014-06-121-7/+3
|
* NDOize the rest of util.cDenis Ovsienko2014-04-141-6/+6
|
* Netdissectify the to-name resolution routines.Guy Harris2014-04-041-2/+2
| | | | | | | | 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 AppleTalk, CDP and Kerberos decodersDenis Ovsienko2014-03-281-74/+71
|