summaryrefslogtreecommitdiff
path: root/print-tcp.c
Commit message (Collapse)AuthorAgeFilesLines
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-11/+11
| | | | | | | | | 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.
* fix runaway ND_PRINT() parenthesesGisle Vanem2014-04-151-2/+2
|
* Netdissectify the to-name resolution routines.Guy Harris2014-04-041-6/+6
| | | | | | | | 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 DECnet, OSPF and TCP decodersDenis Ovsienko2014-04-021-131/+134
|
* NDOize SMB decoderDenis Ovsienko2014-04-021-2/+2
|
* NDOize safeputs() and safeputchar()Denis Ovsienko2014-04-011-1/+1
|
* NDOize NFS decoderDenis Ovsienko2014-04-011-2/+2
|
* NDOize BGP decoderDenis Ovsienko2014-03-261-1/+1
|
* NDOize AODV, IPv4 and SCTP decodersDenis Ovsienko2014-03-261-1/+1
|
* OpenFlow: add IANA-allocated TCP portDenis Ovsienko2014-03-251-1/+2
| | | | | | OF specifications 1.0.2 and 1.3.3 use a different port number. That said, the old port is still likely to be seen in the wild after 4 years of deployment. Let tcpdump recognize both for a while.
* NDOize BOOTP, DHCPv6, DNS, PIM and sFlow decodersDenis Ovsienko2014-03-251-1/+1
| | | | Also add/remove tabs in a few involved functions to justify indentation.
* NDOize ATM, MPTCP, NTP, VTP & Whiteboard decodersDenis Ovsienko2014-03-201-1/+1
|
* NDOize 7 bigger decodersDenis Ovsienko2014-03-191-2/+2
| | | | | This change converts IGMP, IPv6 mobility options, LDP, Lightweight Access Point, PGM, PPTP and RIP decoders.
* NDOize OpenFlow, IEEE slow and telnet decodersDenis Ovsienko2014-03-171-2/+2
|
* NDOize DCCP, Linux socket and RPKI-Router decodersDenis Ovsienko2014-03-141-1/+1
|
* NDOize 8 more small decodersDenis Ovsienko2014-03-131-1/+1
| | | | | This change converts ZeroMQ, IPX, MPLS, IPv6 options, PPPoE, RIPng, PFLOG and Sun RPC decoders.
* NDOize IP mobile, MSDP and NULL decodersDenis Ovsienko2014-03-061-1/+1
|
* NDOize AH, BEEP and DTP decodersDenis Ovsienko2014-02-271-1/+1
| | | | Also remove some unnecessary passages.
* fix partial checksum errors in DCCP decoder, IPv6 caseFrancois-Xavier Le Bail2014-02-161-1/+2
|
* fix partial checksum errors in DCCP decoder, IPv4 caseFrancois-Xavier Le Bail2014-02-151-2/+2
|
* More UNALIGNED_MEM{CPY,CMP} on IP addresses.Guy Harris2014-01-181-5/+5
|
* Only do the unaligned_mem{cpy,cmp} hack if necessary.Guy Harris2014-01-171-5/+5
| | | | If the processor does unaligned accesses, it's not necessary.
* Revert print-tcp memcpy() changes, and use unaligned_memcpy() instead.Guy Harris2014-01-151-14/+8
| | | | | | | That should prevent optimizing the memcpy into code that assumes alignment. Add unaligned_memcmp(), and use it, as well.
* Point to IP addresses with "void *"s.Guy Harris2014-01-151-3/+9
| | | | | | This keeps GCC from assuming the IP addresses are aligned and generating 32-bit load/store pairs on SPARC; those require alignment and cause tcpdump to crash.
* remove tcpdump's own CVS keywordsDenis Ovsienko2014-01-031-2/+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
|
* print-tcp: add some NFS printing finishDenis Ovsienko2013-11-071-2/+2
| | | | | Add printing of direction and restore printing of the transaction ID, which print_nfsaddr() used to output in a way.
* print-tcp: move nfs specific dispacting to after the tcp header decodingLonginus002013-11-071-36/+30
|
* fix printing of unknown TCP optionsDenis Ovsienko2013-10-261-1/+3
| | | | | | | | | | TCP options decoder would mix decimal and hexadecimal digits when printing an unknown option. For example, the pre-TFO revision would print TFO as follows: [Unknown Option 254f989090909090000] Refine output format to print the same data as follows: [unknown-254 0xf989090909090000]
* print-tcp: separate tcp_seq_hash into ipv4 and ipv6 versionsLonginus002013-10-181-77/+90
| | | | | This cleans up and removes some duplicate code. The ipv4 and ipv6 versions of the codepath are virtually identical now save for the variable types.
* adopt MacOS deprecation workaround from FreeRADIUSDenis Ovsienko2013-10-181-0/+2
| | | | | | | | | | A MacOS build of tcpdump used to produce deprecation warnings on OpenSSL function calls. Alan DeKok explained that this is the effect of Apple's modifications to OpenSSL and that the very same problem has already been solved in FreeRADIUS server source code with pre-processor macros. Copy the macros into tcpdump header file and make use of them around the functions that call OpenSSL functions.
* merge 'threv' and 'rev' variables in print-tcp into just 'rev'Longinus002013-10-051-5/+3
|
* add a acomment to tcp_print()Denis Ovsienko2013-10-031-0/+1
|
* add support for experimental tcp fast open and parsing experimental optionsLonginus002013-10-031-0/+36
|
* justify declarations of struct tok arraysDenis Ovsienko2013-09-241-2/+2
| | | | | | 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.
* add minimal OpenFlow decoding frameworkDenis Ovsienko2013-05-291-0/+2
| | | | | | | This change registers OpenFlow TCP port number and adds processing of respective packets with openflow_print(), a new function that understands the minimal OpenFlow header format and can iterate over messages within a snapshot that starts with the header.
* Fix MPTCP supportGregory Detal2013-04-191-2/+3
| | | | | | | | | Added: * option length check * option type and TCP flags check * more information printed Signed-off-by: Gregory Detal <gregory.detal@uclouvain.be>
* Multipath TCP (RFC 6824) supportGregory Detal2013-04-141-0/+7
| | | | | | | | | This commit adds the support of Multipath TCP (MPTCP). MPTCP is a new extension to TCP standardized at the IETF. MPTCP allows to use several IP addresses at the same time by distributing data across several subflows (TCP connections) while still presenting the standard TCP socket API to the application. Its benefits are better resource utilization, better throughput and smoother reaction to failures.
* ZeroMQ initial support (ZMTP/1.0 framing)Denis Ovsienko2013-02-111-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | This change adds support for ZMTP/1.0 (ZeroMQ Message Transport Protocol 1.0) framing in TCP packets, as defined in http://rfc.zeromq.org/spec:13 and implemented in zeromq library. Since there is no assigned port number for ZeroMQ, the user is left responsible for making only the related TCP packets captured and enforcing ZMTP/1.0 decoding through the "-T zmtp1" option. Each ZMTP/1.0 frame of a packet will produce a single additional line of output. The "-v" flag will add up to 8 lines (128 bytes) worth of hex+ASCII dump of the frame body, and "-vv" and higher will dump the full frame body, however long. Beware that this code handles neither IP fragmentation nor TCP segmentation and will incorrectly decode segments not starting at a frame boundary. The included sample capture stands for a short ZeroMQ session between a REQ/REP socket pair doing 3 anonymous 2-way exchanges. It was produced using version 2.1.9 of zeromq library patched to fix its bug #293, so that all MBZ bits of the flags field are set to 0.
* Add a routine to do the "checksum with pseudo-header" stuff for IPv4.Guy Harris2011-06-171-24/+2
| | | | Clean up some other stuff while we're at it.
* Use nextproto6_cksum() for XXX-over-IPv6 checksums.Guy Harris2011-06-171-1/+1
| | | | Get rid of duplicated checksums with IPv6 pseudo-headers.
* Clean up the checksum checking.Guy Harris2011-06-161-19/+25
| | | | | | Check -v and -K, and the fragmented flag, up front; then check the IP version etc.. Don't check for IPv6 if we already know it's IPv4. Fetch the checksum field only once.
* add support for the RPKI/Router Protocol as per draft-ietf-sidr-rpki-rtr-12Hannes Gredler2011-06-161-0/+2
|
* Go with Wireshark's Internet checksum routine.Guy Harris2011-06-131-20/+19
| | | | | | | | | | | | | The Wireshark routine is based on the BSD in-kernel portable checksum routine (thus BSD-licensed); it takes a vector of pointers and lengths and checksums the concatenation of the buffers in question (just as the BSD in-kernel routine checksums a chain of mbufs). This simplifies the "with a pseudo-header" checksums; hopefully it'll fix up the problems being seen on some big-endian platforms, which might be due to hand-calculating some or all of the checksum and doing so incorrectly. It also gets rid of some code that might be dereferencing unaligned pointers.
* Fix a comment, and note a potential issue.Guy Harris2011-03-011-1/+9
|
* Don't clear stuff we'll be overwriting in its entirety.Guy Harris2011-03-011-1/+13
| | | | | | | | | We only need to clear out the tha structure if we support IPv6, so that the addresses are IPv6 addresses, but we only have IPv4 addresses, so that the rest of the address bytes need to be set somehow. Also, explain what we're doing, so people don't ask why we're not zeroing it if we don't support IPv6.
* Don't directly fetch multi-byte integers from packets.Guy Harris2010-02-211-1/+1
| | | | | | | | Use the EXTRACT_ macros to extract multi-byte integral values from packets, rather than just dereferencing pointers into the packet; there is no guarantee that the packet data will be aligned on the right boundary, and there is no guarantee that, if they're not, a direct access will work correctly.
* modularize ip6 nextlayer checksum generation andHannes Gredler2009-10-121-32/+1
| | | | change tcp6 and pim6 to use it.
* Don't use "uint"; it's not guaranteed to be defined.Guy Harris2009-09-211-1/+2
| | | | | Don't define a variable in the middle of a block; not all C compilers support that.
* From Fang Wang:Guy Harris2009-08-181-0/+13
| | | | | | | | RFC 5482 specifies a new TCP option -- the TCP User Timeout Option (UTO) -- that allows one end of a TCP connection to advertise its current user timeout value. The Kind of UTO option is 28 and the Length is 4. The tcpdump currently does not recognize UTO option.