summaryrefslogtreecommitdiff
path: root/print-rx.c
Commit message (Collapse)AuthorAgeFilesLines
* Use quoted include netdissect-stdinc.h instead of angle-bracketed oneFrancois-Xavier Le Bail2018-01-211-1/+1
|
* Clean up signed vs. unsigned.Guy Harris2018-01-111-1/+1
|
* Update ND_PRINT() as a variadic macroFrancois-Xavier Le Bail2018-01-071-318/+318
|
* Remove all storage class specifier 'register'Francois-Xavier Le Bail2017-12-131-19/+19
| | | | | | 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-19/+19
| | | | | ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
* Make nd_uint8_t and nd_int8_t arrays, to catch direct references.Guy Harris2017-12-101-64/+82
| | | | | | | | | | This catches direct references, so we can change them to use EXTRACT_U_1 or EXTRACT_S_1. Also, change some structures to use the nd_ types that weren't already using them. Then make the appropriate EXTRACT_{U,S}_1() changes.
* Use more ND_TCHECK_n()/ND_TTEST_n() macrosFrancois-Xavier Le Bail2017-11-241-1/+1
|
* Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-72/+72
| | | | | | | | | | | | | | | | 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-38/+38
| | | | | | | | 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
* Clean up RX dissector.Guy Harris2017-11-211-281/+262
| | | | | | | | | | | | | | | | Use uintN_t and intN_t types rather than u_short and u_int. Use uint32_t rather than unsigned long, as that's what's intended. Most fields in RX are unsigned, according to the OpenAFS source; make it so. Use EXTRACT_BE_INT32() to extract the one field that isn't. The length and port numbers passed in from the UDP dissector are unsigned; make the arguments unsigned. Use ND_TTEST2 rather than a hand-rolled test. Use ND_TCHECK_nBITS() rather than ND_TCHECK2() in some cases.
* Rename EXTRACT_nBITS() macros to EXTRACT_BE_nBITS()Francois-Xavier Le Bail2017-11-181-72/+72
| | | | | It indicates clearly that these macros are used to extract big-endian integral values.
* Rx: Fix alignment issue on Solaris 10 SPARCFrancois-Xavier Le Bail2017-09-131-15/+15
| | | | | Fix the 'Segmentation fault' issue with the 'rx_ubik-oobr' test in 'rx_cache_insert' function with the method described in commit 1376682.
* Rx: add a missing bounds check for callbacksDenis Ovsienko2017-09-131-0/+5
| | | | | | | | Add a bounds check to cb_print(), this likely makes the same type of bugfix as the previous commit but comes without a test case as the problem was identified through code review. Add a comment about bounds check to ubik_print().
* CVE-2017-13049/Rx: add a missing bounds check for UbikDenis Ovsienko2017-09-131-0/+1
| | | | | | | | | | | One of the case blocks in ubik_print() didn't check bounds before fetching 32 bits of packet data and could overread past the captured packet data by that amount. This fixes a buffer over-read discovered by Henri Salo from Nixu Corporation. Add a test using the capture file supplied by the reporter(s).
* spell ASCII in uppercaseDenis Ovsienko2017-08-101-1/+1
|
* Remove unnecessary semicolonsFrancois-Xavier Le Bail2016-08-291-1/+1
| | | | Using Coccinelle script semicolon.cocci
* Move the printer summaries from INSTALL.txt to each printerFrancois-Xavier Le Bail2016-08-141-0/+3
| | | | | | | | 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
* Use the nd_uintN_t types more.Guy Harris2015-10-071-4/+7
| | | | | | | | | | | | | | Define them in netdissect.h. Use them in ip.h, and *don't* mark the structures as UNALIGNED; that should no longer be necessary. Add a new nd_ipv4 type to use as an IPv4 address; it represents the 4 bytes of IPv4 address as an array of unsigned chars, so that its natural alignment is only on a byte boundary. Those changes found some places where we weren't using UNALIGNED_MEMCPY() to extract IPv4 addresses from packets; use it.
* 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 warnings as "ISO C90 does not support the '%T' gnu_strftime format"Francois-Xavier Le Bail2015-08-181-1/+1
| | | | | The complete warnings were: ISO C90 does not support the '%T' gnu_strftime format [-Wformat=]
* RX: Fix 168 warnings as "declaration of 'x' shadows a previous local"Francois-Xavier Le Bail2015-07-121-30/+28
| | | | | | | | | | | | | | An example of these warnings is: ./print-rx.c: In function 'fs_print': ./print-rx.c:774:35: warning: declaration of 'i' shadows a previous local [-Wshadow] #define UINTOUT() { unsigned long i; \ ^ ./print-rx.c:916:4: note: in expansion of macro 'UINTOUT' UINTOUT(); ^ ./print-rx.c:883:16: warning: shadowed declaration is here [-Wshadow] unsigned long i; ^
* Fix a bunch of de-constifications.Guy Harris2015-04-261-25/+25
|
* 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-35/+35
| | | | | | | | | 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-4/+4
|
* fix a couple typosDenis Ovsienko2014-04-061-1/+1
|
* squelch compiler warnings after previous commitDenis Ovsienko2014-03-301-0/+1
| | | | | It was OK with GCC but Clang wants <stdlib.h> back because of malloc() and free() that shouldn't be declared implicitly.
* NDOize RX decoderDenis Ovsienko2014-03-301-462/+474
|
* refine the previous changeDenis Ovsienko2014-02-261-1/+1
| | | | | | | This time eliminate a few instances of the code initializing struct tok with negative values and squelch the warnings like below: warning: initializer will be sign-extended: -1
* 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.
* Merge branch 'master' of git+ssh://bpf.tcpdump.org/tcpdump/master/git/tcpdumpMichael Richardson2014-01-011-2/+80
|\ | | | | | | | | Conflicts: enc.h
| * Pull a bunch of headers into the only source file that includes them.Guy Harris2013-12-301-2/+80
| | | | | | | | | | | | 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.
* | whitespace changesMichael Richardson2014-01-011-1/+1
|/
* make more array declarations static/constDenis Ovsienko2013-12-191-1/+1
|
* justify declarations of struct tok arraysDenis Ovsienko2013-09-241-13/+13
| | | | | | Make sure all of them are declared const and most of them -- static. Proper declaration of token arrays is a common review point for new code that is based on existing decoders. Thus fix the issue at its root.
* Fix off-by-one error in print-rx.cDenis Ovsienko2013-04-191-1/+1
| | | | | | | | Avoid dereferencing rx_cache[RX_CACHE_SIZE], which is one past the last valid element. (This fixes SF bug 3599633 / GH bug 287. I could not identify the name or email address of the original contributor. -- Denis)
* Fix use of PRIu64.guy2008-07-011-2/+2
|
* Use PRIu64 rather than %llu - %llu might be wrong, if u_int64_t is justguy2008-07-011-2/+2
| | | | "unsigned long int", or if this is Windows with Microsoft's C compiler.
* From Michael A. Meffie III:guy2008-05-121-12/+320
| | | | | | | Update decoding of rx packets used by AFS. Add missing RPC opcodes for fileserver, cache manager, volume server, and ubik (database elections). Add missing decoding of volume server RPC arguments and reply data.
* Pick up from NetBSD a change to use a maximum string length on the scanfguy2007-06-151-3/+6
| | | | format used to parse ACL entries.
* Extract "firstPacket" into a variable with EXTRACT_32BITS(), and useguy2006-04-071-10/+12
| | | | | that whenever we print its value, so that we always get it in the right byte order.
* 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".
* From an anonymous SourceForge user: get rid of "ack_print()" in favor ofguy2003-01-251-74/+3
| | | | "rx_ack_print()", and add a new ack reason "idle".
* Get rid of the "-Wno-unused" flag, and fix up most of theguy2002-09-051-10/+9
| | | | | | | | | | | | | | | unused-parameter problems reported by GCC. Add an _U_ tag to label parameters as unused if the function is called through a pointer (so that you can't change its signature by removing parameters) or if there are unused parameters only because the function isn't complete. Add some additional bounds checks the necessity for which was revealed while cleaning up unused-parameter problems. Make some routines static. "lcp_print()", defined in "print-lcp.c", isn't called anywhere - "print-ppp.c" has the code to dissect LCP. Get rid of "print-lcp.c".
* Add a few more GCC warnings on GCC >= 2 for ".devel" builds.guy2002-09-051-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Neil T. Spring: fixes for many of those warnings: addrtoname.c, configure.in: Linux needs netinet/ether.h for ether_ntohost print-*.c: change char *foo = "bar" to const char *foo = "bar" to appease -Wwrite-strings; should affect no run-time behavior. print-*.c: make some variables unsigned. print-bgp.c: plen ('prefix len') is unsigned, no reason to validate by comparing to zero. print-cnfp.c, print-rx.c: use intoa, provided by addrtoname, instead of inet_ntoa. print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to be false, so check for (u_int)-1, which represents failure, explicitly. print-isakmp.c: complete initialization of attrmap objects. print-lwres.c: "if(x); print foo;" seemed much more likely to be intended to be "if(x) { print foo; }". print-smb.c: complete initialization of some structures. In addition, add some fixes for the signed vs. unsigned comparison warnings: extract.h: cast the result of the byte-extraction-and-combining, as, at least for the 16-bit version, C's integral promotions will turn "u_int16_t" into "int" if there are other "int"s nearby. print-*.c: make some more variables unsigned, or add casts to an unsigned type of signed values known not to be negative, or add casts to "int" of unsigned values known to fit in an "int", and make other changes needed to handle the aforementioned variables now being unsigned. print-isakmp.c: clean up the handling of error/status indicators in notify messages. print-ppp.c: get rid of a check that an unsigned quantity is >= 0. print-radius.c: clean up some of the bounds checking. print-smb.c: extract the word count into a "u_int" to avoid the aforementioned problems with C's integral promotions. print-snmp.c: change a check that an unsigned variable is >= 0 to a check that it's != 0. Also, fix some formats to use "%u" rather than "%d" for unsigned quantities.
* Get rid of some unnecessary includes (<time.h>, <netdb.h>, and <ctype.h>guy2002-08-061-4/+1
| | | | | are included by <tcpdump-stdinc.h>, so we don't have to include them explicitly; <errno.h> isn't needed by print routines).
* Added support for Win32, based on WinPcap.risso2002-08-011-7/+2
|
* whitespace cleanupitojun2002-06-111-37/+37
|