summaryrefslogtreecommitdiff
path: root/print-ripng.c
Commit message (Collapse)AuthorAgeFilesLines
* RIPng: Print the protocol name when the version is invalidFrancois-Xavier Le Bail2023-02-161-1/+2
| | | | Update the output of a test accordingly.
* Fix spaces before tabs in indentationFrancois-Xavier Le Bail2023-02-151-1/+1
|
* RIPng: Modernize packet parsing style.Denis Ovsienko2020-10-111-30/+28
| | | | | | | | | | Lose the unused trace file props in struct rip6. Make rip6_entry_print() void as its return value was discarded anyway; always fetch all fields of RTE. In ripng_print() just tell rip6_entry_print() whether to print the metric or not instead of fetching it; validate the version before decoding the command, not after; consider an unknown command invalid; add and use a standard invalid label. Lose all ND_TCHECK*() instances as they are excess now. Update a test.
* Remove useless 'return' at end of void functions (style)Francois-Xavier Le Bail2020-09-281-1/+0
|
* Remove many (762) now redundant ND_TCHECK_n() callsFrancois-Xavier Le Bail2020-09-061-2/+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-1/+1
| | | | | | | | | | | | | | 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 a "const object should be initialized" warning.Guy Harris2019-04-171-1/+1
| | | | | | | | MSVC says a const object should be initialized, so initialize it. Use nd_ipv6 as the type, while we're at it (it shouldn't make a difference, but this means we know the type - array of 16 octets - so we can just initialize it with { 0 }).
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-7/+7
| | | | | | | 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 more nd_print_trunc() callsFrancois-Xavier Le Bail2018-05-101-1/+1
| | | | | | | Update the output of some tests accordingly. Moreover: Add a ndo_protocol field assignment.
* 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.
* Avoid a name collision.Guy Harris2018-02-131-2/+2
| | | | | <netinet/in.h> or <netinet/in6.h> might define inaddr_any, so use a different name for it.
* Remove unneeded '&' when getting a pointer to a nd_ipv6 typeFrancois-Xavier Le Bail2018-01-311-1/+2
|
* Use nd_ipv6 rather than struct in6_addr in packet-layout structures.Guy Harris2018-01-301-5/+3
| | | | Also, use it, and nd_ipv4, in sizeof() operations.
* RIPng: Use more ND_TCHECK_SIZE() macrosFrancois-Xavier Le Bail2018-01-241-1/+1
|
* 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
|
* RIPng: Use more ND_TCHECK_n() macrosFrancois-Xavier Le Bail2018-01-071-2/+2
|
* Update ND_PRINT() as a variadic macroFrancois-Xavier Le Bail2018-01-071-15/+15
|
* Use ND_TTEST_SIZE()/ND_TCHECK_SIZE() macros (1/n)Francois-Xavier Le Bail2018-01-031-2/+2
|
* Use nd_ types, add EXTRACT_ calls.Guy Harris2017-12-301-20/+25
|
* Remove all storage class specifier 'register'Francois-Xavier Le Bail2017-12-131-3/+3
| | | | | | Let the compiler do the optimizations (or not) based on build options. Avoid 'value has been optimized out' messages in gdb using '-O0'.
* Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-1/+1
| | | | | | | | | | | | | | | | 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-1/+1
| | | | | It indicates clearly that these macros are used to extract big-endian integral values.
* CVE-2017-12992/RIPng: Clean up bounds checking.Guy Harris2017-09-131-31/+40
| | | | | | | | | | | | Do bounds checking as we access items. Scan the list of netinfo6 entries based on the supplied packet length, without taking the captured length into account; let the aforementioned bounds checking handle that. This fixes a buffer over-read discovered by Kamil Frankowicz. Add a test using the capture file supplied by the reporter(s).
* 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-3/+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-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.
* More fixes for uint8_t being shorter than u_int8_t.Guy Harris2014-04-231-5/+5
| | | | Fix a typo while we're at it.
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-6/+6
| | | | | | | | | 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-1/+1
| | | | | | | | 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.
* 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 8 more small decodersDenis Ovsienko2014-03-131-27/+24
| | | | | This change converts ZeroMQ, IPX, MPLS, IPv6 options, PPPoE, RIPng, PFLOG and Sun RPC decoders.
* 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.
* Pull a bunch of headers into the only source file that includes them.Guy Harris2013-12-301-1/+56
| | | | | | For headers included in only one source file, put the header contents in the source file in question, and get rid of a bunch of stuff from the header not used in the source file.
* From Gisle Vanem: don't do the IN6_IS_ADDR_UNSPECIFIED stuff unless it'sguy2005-01-041-17/+9
| | | | | | | not defined, and, if it isn't and _MSC_VER also isn't defined, just define a IN6_IS_ADDR_UNSPECIFIED() function, rather than, on MinGW, defining an IN6_ADDR_EQUAL() function and defining IN6_IS_ADDR_UNSPECIFIED() in terms of it.
* 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 up some errors from the previous checkin.guy2002-12-111-7/+13
| | | | | | | Fix up some const and unsigned issues. Make static some routines unused outside the file in which they're defined.
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 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).
* Small fix to reflect the change in the ip6_misc.h file of libpcaprisso2002-08-021-1/+6
|
* Added support for Win32, based on WinPcap.risso2002-08-011-6/+11
|
* clarify some signedness mixupitojun2001-11-161-5/+5
|
* print [|ripng], not [|rip], on truncation.itojun2001-11-161-2/+2
|
* Don't print multiple lines for a single packet unless -vvfenner2001-05-101-3/+3
|
* no need to include ip6.hitojun2000-10-071-3/+1
|
* Get rid of includes of <netinet/in_systm.h>, and replace "n_short",guy2000-09-291-2/+1
| | | | "n_long", and "n_time", defined in that file, with other types.