summaryrefslogtreecommitdiff
path: root/print-lspping.c
Commit message (Collapse)AuthorAgeFilesLines
* More bounds checking when fetching addresses and converting to strings.Guy Harris2020-01-191-21/+21
| | | | | | | | | | | | | | 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-48/+48
| | | | | | | 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.
* 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-78/+78
|
* Fix some Coccinelle warnings "a \ character appears outside of a #define"Francois-Xavier Le Bail2018-01-041-27/+27
|
* 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-112/+117
|
* 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-12/+18
| | | | | 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-34/+34
| | | | | | | | | | | | | | | | 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
* Rename EXTRACT_nBITS() macros to EXTRACT_BE_nBITS()Francois-Xavier Le Bail2017-11-181-34/+34
| | | | | It indicates clearly that these macros are used to extract big-endian integral values.
* 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-12900/Properly terminate all struct tok arrays.Guy Harris2017-09-131-0/+1
| | | | | | | This fixes a buffer over-read discovered by Forcepoint's security researchers Otto Airamo & Antti Levomäki. Add tests using the capture files supplied by the reporter(s).
* zero change: update Hannes Gredler's emailHannes Gredler2017-07-281-1/+1
|
* Redo TLV bounds checking.Guy Harris2017-01-181-13/+24
| | | | | | If the L of the V of the TLV isn't large enough for everything it's supposed to contain, just quit processing the TLV, print its contents in hex, and process the next TLV.
* Updates for RFC 4379, bug fixes, and additional bounds checks.Guy Harris2017-01-181-210/+403
| | | | | | | | | | | | | | | | print-lspping.c was written to one of the draft-ietf-mpls-lsp-ping-13 drafts; incorporate subsequent changes that are in RFC 4379. Not all LV and subTLV types from that RFC are currently dissected. Apparently, the IANA has two separate but similar registries, the BGP Layer 2 Encapsulation Types registry and the MPLS Pseudowire Types registry. Have two separate tables for them, and use the tables as appropriate. Update them to match the current state of the registries. 11 is not the subTLV code for "BGP labeled IPv4 prefix" (and never was, from what I can tell from looking at the I-Ds), 12 is. Do more bounds checking.
* 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
* 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.
* Fix a typoFrancois-Xavier Le Bail2014-12-111-1/+1
|
* don't reinvent ND_TCHECK2()Denis Ovsienko2014-06-121-10/+5
|
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-69/+69
| | | | | | | | | 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-22/+22
| | | | | | | | 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 some generic codeDenis Ovsienko2014-04-031-2/+2
|
* NDOize ForCES, MPLS LSP ping and OLSR decodersDenis Ovsienko2014-03-271-75/+73
|
* NDOize BGP decoderDenis Ovsienko2014-03-261-4/+3
|
* 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-3/+9
|
* whitespace changesMichael Richardson2014-01-011-16/+16
|
* 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>
* change codepoints per rfc 4379 / add support for the vendor enterprise TLVhannes2008-01-281-4/+26
|
* bugfix: do proper padding calculation for LSPINGhannes2008-01-281-3/+10
|
* remove redundant TRUE|FALSE defshannes2006-06-231-3/+1
|
* courtesy rick cheng (rcheng AT juniper dot net):hannes2006-02-031-2/+3
| | | | | | improve code readability: - LDP_TLV_ADDRESS_LIST printer - BFD_DISCRIMINATOR printer
* add support for the BFD Discriminator TLVhannes2006-02-011-1/+9
|
* change vendor private codepointhannes2005-05-031-2/+2
|
* backout redundant Sequence # printinghannes2005-04-191-3/+2
|
* bugfix: don't forget to increment the tlv header size, misc. display cosmeticshannes2005-04-191-5/+7
|
* from Hannes Viertel <hviertel@juniper.net>: fix ipv6 #ifdefshannes2004-11-111-3/+4
|
* add a crippled version of the downstream map TLVhannes2004-10-201-2/+130
|
* make use of ts_print() for printing the lspping timestampshannes2004-06-161-8/+17
|
* - there is meanwhile router code for two version of thehannes2004-06-161-6/+40
| | | | | | | | | | | | | | TLV_TARGETFEC_SUBTLV_L2VPN_VCID in the field. subTLV w/ codepoint 9 does not contain the sender field subTLV w/ codepoint 10 does contain an additional sender field add support for codepoint 10 which describes the new format - ripple through the proposed codepoints for labeled BGP to 11 and 12 - bugfix [copy & pase error] from the l2vpn_enpt code only access vcid data structures