summaryrefslogtreecommitdiff
path: root/print-mpls.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix spaces before tabs in indentationFrancois-Xavier Le Bail2023-02-151-1/+1
|
* MPLS: rename the "exp" field to "tc"Bill Fenner2021-01-061-1/+1
| | | | | | RFC5462 (https://tools.ietf.org/html/rfc5462) renamed the MPLS "EXP" field to "Traffic Class" in 2009. Use "tc" as an abbreviation for this field name.
* MPLS: Modernize packet parsing style.Denis Ovsienko2020-12-151-49/+12
| | | | | | | Enable ND_LONGJMP_FROM_TCHECK. Remove both ND_TCHECK*() instances because they are redundant. Report invalid packets as invalid, not truncated. Test whether the invalid packet is entirely in the buffer. Replace a long switch block with a ternary assignment.
* MPLS: Rework some testsFrancois-Xavier Le Bail2020-07-161-8/+6
| | | | | | This should address a warning with some AppVeyor builds (VS 16 2019): warning C4061: enumerator 'PT_UNKNOWN' in switch of enum 'mpls_packet_type' is not explicitly handled by a case label
* Use nd_print_protocol_caps() to print the protocol nameFrancois-Xavier Le Bail2019-06-171-1/+1
|
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-2/+2
| | | | | | | 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-171-4/+2
| | | | Update the output of some tests accordingly.
* Add more nd_print_trunc() callsFrancois-Xavier Le Bail2018-05-061-1/+1
| | | | Update the output of some tests accordingly.
* Remove useless commentsFrancois-Xavier Le Bail2018-03-191-8/+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-10/+10
|
* Replace ND_TTEST2()/ND_TCHECK2() macros by macros using pointers (1/n)Francois-Xavier Le Bail2017-12-111-1/+1
| | | | | ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
* Use more the ND_TCHECK_1() macroFrancois-Xavier Le Bail2017-12-041-1/+1
|
* Use more the EXTRACT_U_1() macro (41/n)Francois-Xavier Le Bail2017-12-011-1/+1
| | | | In: switch (... *(p) ...) ...
* 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-12897/ISO CLNS: Use ND_TTEST() for the bounds checks in ↵Guy Harris2017-09-131-1/+1
| | | | | | | | | | | isoclns_print(). This fixes a buffer over-read discovered by Kamil Frankowicz. Don't pass the remaining caplen - that's too hard to get right, and we were getting it wrong in at least one case; just use ND_TTEST(). Add a test using the capture file supplied by the reporter(s).
* "length" is now the *remaining* packet length.Guy Harris2017-01-181-4/+4
| | | | | | The loop that processes MPLS labels decrements the length for each label, so it's the remaining length; don't subtract the total length of the MPLS labels from it before handing it to packet printers.
* CVE-2016-7931/Add bounds and length checks.Guy Harris2017-01-181-0/+10
| | | | Fixes a heap overflow found with American Fuzzy Lop by Hanno Böck.
* 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
* 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.
* Leave it up to ip6_print() to handle non-IPv6-capable systems.Guy Harris2014-10-011-4/+0
| | | | | | | | | | | | Always define and declare ip6_print(), always compile print-ip6.c, and always call it if we recognize a payload as IPv6. If INET6 isn't defined, ip6_print() will just print the length and note that printing isn't supported. That way, we don't do weird dissection of IPv6 packets on systems without IPv6 support, due to, for example, ethertype_print() returning 0 ("not dissected") for IPv6 packets on those systems (IPv6-over-Frame Relay was dissected weirdly due to this).
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-2/+2
| | | | | | | | | 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.
* NDOize ISO CLNS decoderDenis Ovsienko2014-03-281-1/+1
|
* make use of ND_DEFAULTPRINT()Denis Ovsienko2014-03-261-1/+1
|
* make use of NETDISSECT_REWORKEDDenis Ovsienko2014-03-151-0/+1
| | | | | 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-25/+18
| | | | | This change converts ZeroMQ, IPX, MPLS, IPv6 options, PPPoE, RIPng, PFLOG and Sun RPC decoders.
* don't include addrtoname.h needlesslyDenis Ovsienko2014-02-251-1/+0
|
* 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.
* whitespace changesMichael Richardson2014-01-011-1/+1
|
* Convert the IPv6 printer to use netdissect.Guy Harris2010-11-071-1/+1
|
* The draft in question has nothing to do with MPLS; clarify that.Guy Harris2010-03-191-54/+65
| | | | | | | | | | | Presumably the idea is that the technique is generally applicable as long as the traffic being carried is either IPv4, IPv6, OSI CLNP, ES-IS, or IS-IS. Also, by the time we get there, we know we've reached the bottom of the MPLS stack (the do loop either fails by running past the end of the packet and going to trunc, or by terminating because we find a label entry with the BOS bit set); there's no need to check for that.
* Print the MPLS-encapsulated packet regardless of whether -v wasGuy Harris2010-03-191-81/+108
| | | | | | | specified. Even with multiple layers in the stack, print on one line unless -v was specified.
* -code cosmetics: improve readability by replacing "v" by "label_entry"hannes2005-07-051-19/+28
| | | | | -do multiline formatting for label-stacks deeper than 1 -hide the IPv4/IPv6 printer under the vflag for explicit NULL labels
* refactored ip_print() so that chained header parser (ESP/AH) canmcr2005-04-061-3/+11
| | | | more easily call the inner parts.
* make MPLS label handling macros available to the outside worldhannes2004-06-141-15/+2
|
* add baseline LSP-PING support per draft-ietf-mpls-lsp-ping-05hannes2004-06-061-12/+1
|
* 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".
* don't pass on src & dst MAC adresses to the isoclns decoder as MAC adresseshannes2003-05-221-2/+2
| | | | should be really printed in ether_print() using the eflag
* basic preparations for mpls lsp ping decodinghannes2003-05-081-1/+11
|
* keep the one-line rule for vflag<1, display exp value always, indicate ↵hannes2003-02-041-10/+20
| | | | payload type (IP,IPv6,OSI) in vflag<1 mode
* Generally there's no indication of protocol in MPLS labelhannes2002-08-081-9/+66
| | | | | | | | | | | | encoding, however draft-hsmit-isis-aal5mux-00.txt describes a technique that looks at the first payload byte if the BOS (bottom of stack) bit is set and tries to determine the network layer protocol 0x45-0x4f is IPv4 0x60-0x6f is IPv6 0x83 is IS-IS this technique is sometimes known as NULL encapsulation and decoding is particularly useful for control-plane traffic [BGP] which cisco by default sends MPLS encapsulated
* Added support for Win32, based on WinPcap.risso2002-08-011-7/+2
|
* Print the whole MPLS label stack.fenner2002-05-071-17/+18
| | | | Submitted by: Kaarthik Sivakumar <kaarthik@torrentnet.com>