summaryrefslogtreecommitdiff
path: root/print-udp.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Use ND_TTEST_SIZE()/ND_TCHECK_SIZE() macros (1/n)Francois-Xavier Le Bail2018-01-031-3/+3
| | |
| * | Use 'u_char *' type for input buffer pointer like in most similar casesFrancois-Xavier Le Bail2018-01-021-2/+2
| | |
| * | Use nd_ types in AppleTalk structures, and add EXTRACT_ calls.Guy Harris2017-12-141-1/+1
| | |
| * | Remove all storage class specifier 'register'Francois-Xavier Le Bail2017-12-131-14/+14
| | | | | | | | | | | | | | | | | | Let the compiler do the optimizations (or not) based on build options. Avoid 'value has been optimized out' messages in gdb using '-O0'.
| * | Use nd_ types in the IPv6 structures.Guy Harris2017-12-111-1/+1
| | | | | | | | | | | | | | | | | | And add the EXTRACT_U_1() calls as needed. Change some other EXTRACT_ calls that no longer need an & operator.
| * | Replace ND_TTEST2()/ND_TCHECK2() macros by macros using pointers (1/n)Francois-Xavier Le Bail2017-12-111-2/+2
| | | | | | | | | | | | | | | ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
| * | Clean up white space.Guy Harris2017-12-111-1/+1
| | |
| * | More nd_ification of structures.Guy Harris2017-12-111-41/+41
| | | | | | | | | | | | | | | We don't need to use & to get a pointer to an nd_uintN_t/nd_intN_t type, as they're arrays.
| * | Make nd_uint8_t and nd_int8_t arrays, to catch direct references.Guy Harris2017-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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-38/+38
| | | | | | | | | | | | | | | It indicates clearly that these macros are used to extract big-endian integral values.
| * | NFS: Rename two printer functionsFrancois-Xavier Le Bail2017-11-161-2/+2
| | | | | | | | | | | | Their names must end with '_print'
| * | SUNRPC: Rename entry functionFrancois-Xavier Le Bail2017-11-161-2/+2
| | | | | | | | | | | | | | | | | | | | | Most printer entry functions are based on the file name (without print-). Do the same for SUNRPC (sunrpcrequest_print -> sunrpc_print). This change allows easier update by script.
| * | DNS: Rename entry functionFrancois-Xavier Le Bail2017-11-161-2/+2
| | | | | | | | | | | | | | | | | | | | | Most printer entry functions are based on the file name (without print-). Do the same for DNS (ns_print -> domain_print) This change allows easier update by script.
| * | Remove useless #if 1Francois-Xavier Le Bail2017-09-211-2/+0
| |/
* | Don't print "bad length" for fragmented UDP packetsMartin Buck2017-05-161-2/+2
|/ | | | | | | In case of fragmentation, it's perfectly OK for the total UDP length to be larger than the length of the first packet, so don't raise a false alert. Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
* Use ND_TCHECK_32BITS() before EXTRACT_32BITS().Guy Harris2017-01-181-3/+3
| | | | It makes it a bit clearer what's being done.
* CVE-2016-7934,7935,7937/RTP: Fix two segmentation faultsFrancois-Xavier Le Bail2017-01-181-25/+55
| | | | | | | | | | Add two test files for these fixes. Add more bounds checks in VAT, RTP and RTCP printers. Moreover: Add and use *_tstr[] strings. Update the output of a test accordingly. Remove spaces before tabs.
* Check against the packet length first.Guy Harris2017-01-181-4/+4
| | | | | That way, if the packet is inherently too short, rather than just having been cut short by the snapshot length, we'll report that properly.
* CVE-2016-7936/Add a bounds check.Guy Harris2017-01-181-0/+5
| | | | Fixes a heap overflow found with American Fuzzy Lop by Hanno Böck.
* Fetch RTP option and extension data using EXTRACT_32BITS().Guy Harris2017-01-141-5/+5
| | | | | | | | | | | Do not assume that you're on a big-endian processor that can dereference unaligned pointers - all the world's not a m68k. :-) Most of the world is little-endian these days by CPU count (especially on personal computers), and one of the popular big-endian processor families, SPARC, traps when dereferencing unaligned pointers. While we're at it, note the last I-D that described RTPv1 and the current RFC for RTPv2.
* 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
* Printer for HNCP (RFCs 7787 and 7788).Jean-Raphaël GAGLIONE2016-07-281-1/+2
| | | | This is joint work with Antonin Décimo.
* Add printing function for Generic Protocol Extension for VXLANbugyo2016-03-221-0/+2
| | | | | | | | | and Network Service Header. This code stands for following internet drafts: - VXLAN GPE: draft-ietf-nvo3-vxlan-gpe-01 - NSH: draft-ietf-sfc-nsh-01
* Don't overwrite the destination IPv6 address for routing headers.Guy Harris2016-02-121-5/+5
| | | | | | | | | | | If we have a routing header, instead of overwriting the packet's IPv6 destination address in the packet with the final destination, so that the next protocol's checksum routine can use it, we do as we do for IPv4, and, in the "next protocol checksum" routine, scan the headers looking for a routing header and, if we find one, copy the final destination from it. While we're at it, clean up a few things.
* Don't do the DDP-over-UDP heuristic check up front.Guy Harris2016-01-111-9/+7
| | | | | | | | | There's probably less DDP-over-UDP traffic passing through tcpdump these days than, for example, SNMP v2 traffic from a low source port longer than 512 bytes, so move the latter heuristic check after all the other checks. Fixes GitHub tcpdump issue #499.
* Translate UDP/1700 as RADIUSHerwin Weststrate2015-12-151-0/+1
| | | | Used for Cisco CoA/Disconnect, as shown on https://supportforums.cisco.com/discussion/11719766/ise-112-change-authorization-avaya-switches-5520. The RFC says port 3799, but Cisco does this otherwise, which means this is not an officially reserved port for RADIUS.
* Harmonize TCP source or destination ports tests with UDP onesFrancois-Xavier Le Bail2015-12-141-43/+41
|
* Get rid of "TCPDUMP" in some libnetdissect codesFrancois-Xavier Le Bail2015-10-081-1/+1
|
* Initial commit for support of Type 3 and Type 4 LISP packets.ritsz2015-10-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixing Travis CI build for LISP commit Adding testcases for lisp notify and register Fixing build warnings Added ND_TCHECK for relevant headers Fixing ND_TCHECK2 issues Adding support for multiple LOC records for same EID entry Fixing review issues, adding detailed tests Adding support for verbose outputs Adding RFC information for UDP PORT defination Removing Spaces in type names Print EID record related flags in verbose mode Using tok2str Fixing -Wpedantic issues Negative testcases, Packet structure comments, verbose mode flag printing Printing Map Version Print auth_data, decouple type and xtr_present extraction, handle malformed packets correctly Tests for latest code changes Printing useful info incase not built with IPv6 support
* Don't require IPv6 library support in order to support IPv6 addresses.Guy Harris2015-09-171-28/+1
| | | | | | | | | | | | | 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
|
* Functions in libnetdissect must use ndo_error() functionFrancois-Xavier Le Bail2015-09-051-8/+8
|
* refine use of nameser.hDenis Ovsienko2015-07-131-1/+0
| | | | | | Move the port number #define's to the TCP and UDP files such that they don't require nameser.h anymore. Update the TCP printer to disregard the multicast DNS port as it is UDP-only.
* Fix a bunch of de-constifications.Guy Harris2015-04-261-40/+40
|
* Fix heuristic not to be byte-order-dependent.Guy Harris2015-04-261-1/+1
| | | | | | | | | | I'm *guessing* that the item being fetched is big-endian; the "vt" protocol might be old enough that they developed it on (non-Sun386i) Sun workstations, assuming they didn't just say "this is an Internet protocol, hence fields are big-endian"). That also prevents problems on platforms that don't support unaligned accesses.
* 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.
* Merge git://github.com/the-tcpdump-group/tcpdumpGuy Harris2014-11-101-0/+2
|\
| * Add support for Generic Network Virtualization Encapsulation (Geneve).Jesse Gross2014-11-051-0/+2
| | | | | | | | Defined in http://tools.ietf.org/html/draft-gross-geneve-02
* | Use ND_TCHECK() to do bounds checking.Guy Harris2014-11-091-1/+1
|/ | | | | | | | While we're at it, just use the record count to when iterating over records; the ND_TCHECK()s will make sure we don't run past the end of the captured data. Also get rid of an unused argument to cnfp_print().
* Don't subtract the UDP header size from the length twice.Guy Harris2014-10-201-4/+2
|
* Use the length field in the UDP header.Guy Harris2014-10-191-10/+24
| | | | | | If it's less than the length of the IP payload, use it as the size of the UDP packet. If it's greater than the length of the IP payload, and we're not dissecting the payload, report the length as bad.
* Added support for RADIUS Change of Authorization messagesHerwin Weststrate2014-10-101-1/+2
| | | | Defined in RFC 5176
* merge bootp.h into print-bootp.cDenis Ovsienko2014-08-131-2/+1
|
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-28/+28
| | | | | | | | | 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-8/+8
| | | | | | | | 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.
* NDOize timed decoderDenis Ovsienko2014-04-031-1/+1
|
* NDOize Babel decoderDenis Ovsienko2014-04-031-1/+1
|