summaryrefslogtreecommitdiff
path: root/print-rpki-rtr.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove many (761) redundant ND_TCHECK_n() callstest-rcFrancois-Xavier Le Bail2020-09-051-1/+0
| | | | | | | | | | | ND_TCHECK_n(e), n in { 1, 2, 3, 4, 8 }. They are redundant because they are followed by a GET_.*_n(e) call, same n, same e, which do the bounds check. Remove unused 'trunc' labels and most associated codes. Update the outputs of some tests accordingly.
* 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.
* Use nd_ types - and use GET_U_1() for 1-byte integral values.Guy Harris2019-12-251-24/+24
|
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-11/+11
| | | | | | | 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.
* Remove a space (style)Francois-Xavier Le Bail2018-10-271-2/+2
| | | | | Moreover: Fix indentation.
* Add the nd_print_invalid() functionFrancois-Xavier Le Bail2018-09-111-1/+1
| | | | | | | It prints " (invalid)", used for malformed or corrupted packets. Moreover: Update CONTRIBUTING.
* 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.
* Rename the fn_printX() functions to nd_printX()Francois-Xavier Le Bail2018-04-301-2/+2
| | | | | | | 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.
* Remove useless commentsFrancois-Xavier Le Bail2018-03-191-7/+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.
* 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-19/+19
|
* 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-9/+9
| | | | | 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 (47/n)Francois-Xavier Le Bail2017-12-051-1/+1
| | | | In: if (... *(p) ...) ...
* Use more the EXTRACT_U_1() macro (31/n)Francois-Xavier Le Bail2017-11-271-1/+1
| | | | | | In ND_PRINT() macro call(s) (step 9). *(p)
* Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-9/+9
| | | | | | | | | | | | | | | | 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 ND_TCHECK_/ND_TTEST_ macrosFrancois-Xavier Le Bail2017-11-221-1/+1
| | | | | | | | Now all the macros have a name meaning a count in bytes. e.g.: ND_TCHECK_32BITS -> ND_TCHECK_4 ND_TTEST_32BITS -> ND_TTEST_4
* Rename EXTRACT_nBITS() macros to EXTRACT_BE_nBITS()Francois-Xavier Le Bail2017-11-181-9/+9
| | | | | It indicates clearly that these macros are used to extract big-endian integral values.
* RPKI-Router: Remove an unused macro.Denis Ovsienko2017-09-131-1/+0
|
* CVE-2017-13050/RPKI-Router: fix a few bugsDenis Ovsienko2017-09-131-66/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The decoder didn't properly check that the PDU length stored in the PDU header is correct. The only check in place was in rpki_rtr_print() and it tested whether the length is zero but that is not sufficient. Make all necessary length and bounds checks, both generic and type-specific, in rpki_rtr_pdu_print() and reduce rpki_rtr_print() to a simple loop. This also fixes a minor bug and PDU type 0 (Serial Notify from RFC 6810 Section 5.2) is valid again. In rpki_rtr_pdu_print() any protocol version was considered version 0, fix it to skip the rest of input if the PDU protocol version is unknown. Ibid, the PDU type 10 (Error Report from RFC 6810 Section 5.10) case block didn't consider the "Length of Error Text" data element mandatory, put it right. Ibid, when printing an encapsulated PDU, give itself (via recursion) respective buffer length to make it possible to tell whether the encapsulated PDU fits. Do not recurse deeper than 2nd level. Update prior RPKI-Router test cases that now stop to decode earlier because of the stricter checks. This fixes a buffer over-read discovered by Bhargava Shastry, SecT/TU Berlin. Add a test using the capture file supplied by the reporter(s).
* zero change: update Hannes Gredler's emailHannes Gredler2017-07-281-1/+1
|
* RPKI-RTR: Remove printing when truncated condition already detectedFrancois-Xavier Le Bail2016-08-181-9/+12
| | | | | | | Moreover: Remove redundant 'truncated' messages. Add and use tstr[]. Update output of some tests accordingly.
* 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
* RPKI/Router: Add a return value check for "fn_printn" callFrancois-Xavier Le Bail2016-07-191-1/+2
|
* Don't require IPv6 library support in order to support IPv6 addresses.Guy Harris2015-09-171-2/+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
|
* Fix a bunch of de-constifications.Guy Harris2015-04-261-8/+8
|
* We're not copying the string to buf, so print the string, not buf.Guy Harris2015-04-081-2/+1
| | | | Get rid of the now-unused buf array while we're at it.
* Print strings with fn_printn().Guy Harris2015-04-081-3/+2
| | | | That filters out non-printable characters.
* 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.
* RPKI to Router Protocol: Fix Segmentation Faults and other problemsFrancois-Xavier Le Bail2015-03-131-4/+5
| | | | | | -Fix/add ND_TCHECK2 tests, -Fix a buffer overflow, -Remove a debug printf
* some patches to deal with kday pcap filesMichael Richardson2015-03-101-0/+7
| | | | Author: Michael Richardson <mcr@sandelman.ca>
* 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 some typosFrancois-Xavier Le Bail2014-12-171-1/+1
|
* 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.
* justify MIN()/min() further (complements dbfdf97)Denis Ovsienko2014-03-151-1/+1
|
* make use of NETDISSECT_REWORKEDDenis Ovsienko2014-03-151-1/+2
| | | | | Update the already converted decoders to define the macro and to include interface.h instead of netdissect.h. Fix incurred compile errors.
* NDOize DCCP, Linux socket and RPKI-Router decodersDenis Ovsienko2014-03-141-28/+26
|
* 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-1/+1
|
* whitespace changesMichael Richardson2014-01-011-2/+2
|
* Update to the final draft of RPKI-Router Protocol (RFC6810)Alexis La Goutte2013-02-041-8/+8
| | | | | | * Cache_nonce => session_id Remove some whitespaces
* Get rid of another zero-length array.Guy Harris2011-08-141-1/+0
|
* Get rid of GCCisms.Guy Harris2011-08-141-10/+11
| | | | | Not all C compilers support anonymous unions in structures, zero-length array members of structures, or __attribute__.
* Fix some warnings.Guy Harris2011-06-171-2/+2
|
* add support for the RPKI/Router Protocol as per draft-ietf-sidr-rpki-rtr-12Hannes Gredler2011-06-161-0/+368