summaryrefslogtreecommitdiff
path: root/print-ipx.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove many (761) redundant ND_TCHECK_n() callstest-rcFrancois-Xavier Le Bail2020-09-051-8/+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.
* Remove more old-compiler compensation.Guy Harris2019-08-081-1/+1
| | | | | | | | | | | | We require an environment with a C99-compatible snprintf(), so we don't need to work around older implementations. Make the configuration process fail if we don't have snprintf() and vsnprintf(). We require at least VS 2015, so we don't have to check for _MSC_VER >= 1400. Make the build fail if we don't have at least VS 2015. We apparently do, however, have to use __inline, as the VS 2015 documentation doesn't meaning plain old "inline". Update a comment.
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-18/+18
| | | | | | | 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-5/+5
| | | | This parameter will be needed at the next step.
* IPX: Add a length checkFrancois-Xavier Le Bail2019-03-111-0/+5
| | | | | | | | | | This fix an undefined behavior at runtime. The error was: print-ipx.c:93:43: runtime error: unsigned integer overflow: 29 - 30 cannot be represented in type 'unsigned int' Add a test case.
* Add more nd_print_trunc() callsFrancois-Xavier Le Bail2018-05-171-1/+1
| | | | Update the output of some tests accordingly.
* Add more nd_print_trunc() callsFrancois-Xavier Le Bail2018-05-101-2/+2
| | | | | | | Update the output of some tests accordingly. Moreover: Add a ndo_protocol field assignment.
* Rename the fn_printX() functions to nd_printX()Francois-Xavier Le Bail2018-04-301-1/+1
| | | | | | | 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.
* IPX: Use more ND_TCHECK_n() macrosFrancois-Xavier Le Bail2018-02-121-3/+3
|
* IPX: Use more the nd_uint32_t typeFrancois-Xavier Le Bail2018-01-301-2/+2
| | | | | | | | | | | | | In 'struct ipxHdr'. This avoid some 'undefined-behavior' warnings with clang and option -fsanitize=undefined enabled. print-ipx.c:79:2: runtime error: member access within misaligned address 0x61d00001ea91 for type 'const struct ipxHdr', which requires 2 byte alignment 0x61d00001ea91: note: pointer points here 54 e0 e0 03 ff ff 00 50 00 14 00 00 00 00 ff ff ff ff ff ff 04 55 a8 f8 79 67 00 00 00 00 00 01 ^ SUMMARY: AddressSanitizer: undefined-behavior print-ipx.c:79:2 in
* Add nd_{v}snprintf() routines/wrappers.Guy Harris2018-01-291-1/+1
| | | | | | | | Some versions of the MSVC runtime library have a non-C99-compliant vsnprintf(), which we want to avoid. On Windows, use snprintf() and vsnprintf() for VS 2015 and later, where they both exist in C99-compliant forms, and wrap _{v}snprintf_s() otherwise (they're guaranteed to do the null termination that we want).
* 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
|
* IPX: 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-32/+32
|
* Use nd_ types, clean up signed vs. unsigned.Guy Harris2017-12-301-20/+20
|
* 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-4/+4
| | | | | ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
* Use a byte pointer in the IPX SAP and RIP printers.Guy Harris2017-12-031-28/+57
| | | | | | That makes it like every other printer. Add some checks against the on-the-network length while we're at it.
* Use more the EXTRACT_U_1() macro (39/n)Francois-Xavier Le Bail2017-12-011-1/+3
| | | | In some macros and functions call, p[n]
* Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-15/+15
| | | | | | | | | | | | | | | | 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 pointer expressions like in most similar casesFrancois-Xavier Le Bail2017-11-201-7/+7
|
* Rename EXTRACT_nBITS() macros to EXTRACT_BE_nBITS()Francois-Xavier Le Bail2017-11-181-15/+15
| | | | | It indicates clearly that these macros are used to extract big-endian integral values.
* Add a summary comment in all other printersFrancois-Xavier Le Bail2016-08-151-1/+0
| | | | | | | Moreover: Remove some redundant comments Update some summary comments Update the specification URL for ATA over Ethernet (AoE) protocol
* 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
* Get rid of "TCPDUMP" in some libnetdissect codesFrancois-Xavier Le Bail2015-10-081-2/+2
|
* 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
|
* Functions in libnetdissect must use ndo_error() functionFrancois-Xavier Le Bail2015-09-051-2/+2
|
* Fix a bunch of de-constifications.Guy Harris2015-04-261-5/+5
|
* 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.
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-12/+12
| | | | | | | | | 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 the rest of util.cDenis Ovsienko2014-04-141-1/+1
|
* NDOize SMB decoderDenis Ovsienko2014-04-021-2/+2
|
* NDOize EIGRP, ICMP, L2TP, STP and UDP decodersDenis Ovsienko2014-03-151-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-56/+54
| | | | | 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.
* Commit more changes from the previous two.Guy Harris2013-12-301-1/+24
|
* Print IPX network numbers as 8 hex digits, as we do elsewhere.Guy Harris2010-08-171-2/+2
|
* Bounds-check the individual components of a SAP reply.guy2005-05-061-2/+3
| | | | | Make "fn_printzp()" return 0 if we don't run past the end of the packet and we don't find any padding NULs.
* Add an "fn_printzp()" routine for printing null-padded strings (stringsguy2005-05-061-2/+5
| | | | | | | | | | | | | | | with a maximum length, where a string shorter than that length is padded with NULs), as "fn_print()" won't handle the maximum length *and* the snapshot length and "fn_printn()" won't stop on a null string. Use it where appropriate. Always pass "snapend" to "fn_print()" and "fn_printn()" if they're passed a pointer into the packet data; only pass NULL if they're being handed a pointer into a buffer that's not part of the packet data. Always check the return value of "fn_print()", "fn_printn()", and "fn_printzp()" if they're passed "snapend", and do the appropriate string termination and "packet truncated" indication if they return 1.
* From Steinar Haug <sthaug@nethelp.no>: put declarations inside aguy2004-05-261-5/+5
| | | | | | function before all executable statements. Clean up white space.
* display cosmetics to better indicate that we are dissecting IPX frameshannes2004-05-011-1/+4
|
* display cosmeticshannes2004-04-301-7/+7
|
* -add baseline support for dissecting EIGRP-IP and EIGRP-IPX messageshannes2004-04-301-2/+2
| | | | | -FIXME: complete TLV dissection (today we just show the TLV name and hexdump the TLV value)
* 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".
* Added support for Win32, based on WinPcap.risso2002-08-011-6/+2
|