Commit Graph

223 Commits

Author SHA1 Message Date
Gregory Detal
578dd316f3 Multipath TCP (RFC 6824) support
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.
2013-04-14 18:20:26 -04:00
Denis Ovsienko
0e2f72760d improve ZeroMQ support (ZMTP/1.0 inside PGM/EPGM)
This change adds new code to decode ZeroMQ datagrams, couples it with
the PGM decoder and extends the -T option to make all this work.

There are two new test cases based on existing captures of ZMTP/1.0
inside [E]PGM to decode the ZMTP/1.0 part of these.

This functionality enables decoding of the traffic zeromq library
produces for "pgm://" and "epgm://" protocol schemas.
2013-04-14 18:20:26 -04:00
Denis Ovsienko
b10f46c2d6 use existing PGM decoder for UDP-encapsulated PGM
The original PGM uses its own IP protocol number. "EPGM" or "PGM/UDP"
stands for UDP-encapsulated PGM, which has no assigned UDP port number
and can be decoded only by means of -T option, which now accepts "pgm"
protocol type for this purpose. There is also a sample capture of EPGM
now (similar to the one of native PGM, but produced using the "epgm://"
protocol schema) and a respective test case.
2013-04-14 18:20:26 -04:00
Guy Harris
949a22064d Declare vxlan_print() and otv_print() in interface.h, and fix its definition.
They doesn't use their third argument, and they aren't being passed a
third argument, so get rid of that argument.
2013-03-26 02:03:32 -07:00
Francesco Fondelli
8eb218c755 - Add support for OTV (draft-hasmit-otv-04).
- Use the packettype infrastructure (-T vxlan) for VXLAN parsing (waiting for a well known dest port)
2013-02-26 13:44:11 +01:00
Denis Ovsienko
ad7171ca02 ZeroMQ initial support (ZMTP/1.0 framing)
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.
2013-02-11 15:16:35 +04:00
Denis Ovsienko
3f6402745f fix some PT_* macros indentation with tabs 2013-02-11 15:15:46 +04:00
Guy Harris
42ab2e753f Add "radius" as an option for -T.
This allows tcpdump to handle RADIUS running on non-standard ports.

Submitted-By: ssb@sourceforge.net

Man page also updated by me.
2012-06-30 15:59:18 -07:00
Denis Ovsienko
8c31bfcebe add DNSSL (RFC6106) support
The most notable difference between RFC5006 and RFC6106 is the addition
of DNSSL RA option. This commit adds DNSSL handling code to make tcpdump
fully RFC6106-aware. This code has been tested against RA packets
generated by Quagga and radvd.
2012-04-13 16:32:40 +04:00
Guy Harris
2886b89df6 Back out DLT_PFSYNC support.
Unfortunately, the DLT_PFSYNC support depends on header files included
from the pfctl command's source tree, and trying to arrange to find that
would be too much trouble.
2012-02-29 21:14:50 -08:00
Guy Harris
0d2d222ffb Add DLT_PFSYNC support.
From FreeBSD PR bin/124825: tcpdump(8) does not support pfsync(4) data,
which in turn was ported over from OpenBSD.  We already have CARP
support, so we did not port that part over.
2012-02-29 01:51:27 -08:00
George Neville-Neil
5d52dbf4c7 Add a CARP dissector and a command-line option to dissect proto 112 as CARP.
CARP and VRRP both use IP protocol number 112, so there needs to be a -T
flag to specify that protocol 112 be dissected as CARP rather than VRRP.

Also update the man page.
2011-11-23 11:53:13 -08:00
Guy Harris
4cc892cbff Use "-H", not "-h", for the 802.11s option, and improve error reporting.
I was rudely surprised to find that "tcpdump -h" wasn't printing a usage
message, and I'm the person who *added* the "-h" option.  Make it "-H",
and add an explicit "-h" option to print a usage message, so nobody else
makes the same mistake.  Also, don't clear opterr, so that if you give
an illegal command-line option, you get an explanatory error message.
2011-06-21 18:15:50 -07:00
Hannes Gredler
917f5f341f add support for the RPKI/Router Protocol as per draft-ietf-sidr-rpki-rtr-12 2011-06-16 17:17:20 +02:00
Guy Harris
94a4b46080 Go with Wireshark's Internet checksum routine.
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.
2011-06-13 14:08:51 -07:00
Guy Harris
017bac571b Don't use "struct netdissect_options" in interface.h.
Use it in netdissect.h, where it's defined; otherwise, we get a bunch of
warnings when compiling modules that include interface.h but don't yet
include netdissect.h.
2011-05-05 02:25:42 -07:00
Michael Richardson
5b0329a9e7 From: Darren Reed <darren.reed@oracle.com>
To: tcpdump-workers@lists.tcpdump.org
Date: Sat, 09 Apr 2011 12:51:14 +1000
Subject: [tcpdump-workers] Printing PPI packets

Printing PPI packets with tcpdump does not turn out
to be that hard.

My simple tests have produced the output as below.

It would be worthwhile having some changes made into
the tcpdump code base that were similar to the attached
that print them out.
2011-05-03 18:58:32 -04:00
Juliusz Chroboczek
12b169509d Add printer for the Babel routing protocol (RFC 6126).
This version includes a couple of fixes from Wireshark.
2011-04-27 15:27:20 -04:00
Guy Harris
a91d20cc84 Convert the IPv6 printer to use netdissect. 2010-11-07 12:50:16 -08:00
Michael Richardson
1cead823ec reworked print-ether to use netdissect 2010-10-07 14:40:50 -04:00
Guy Harris
53412397f6 Mark various IPv4 and IPv6 headers as unaligned.
This prevents GCC on SPARC from generating code that assumes those
structures are aligned naturally, which they are not guaranteed to be.

Move some #defines from interface.h to tcpdump-stdinc.h to make them
available to code that doesn't include interface.h.

Move the declaration of nextproto6_cksum() to ip6.h, so that only files
that use it get it declared, and thus so that you don't need to define
"struct ip6_hdr" in everything that includes interface.h.  Don't include
ip6.h in tcpdump-stdinc.h.
2010-08-31 10:03:47 -07:00
Guy Harris
a20a6126fc Add support for setting the time stamp type for a capture.
Based on a patch from Scott Mcmillan <scott.a.mcmillan@intel.com>.

While we're at it, make some error messages a bit less geeky.
2010-08-22 17:32:26 -07:00
Guy Harris
eeabdc9b78 Prevent GCC from doing some alignment-unsafe optimizations on SPARC.
At least some versions of GCC will, on SPARC, generate code for

	if (bp->bp_htype == 1 && bp->bp_hlen == 6 && bp->bp_op == BOOTPREQUEST) {

where bp is a pointer to a struct bootp, that loads the first 4-byte
word in that structure, masks out the field in that structure that's not
being compared, and compares against a word with the appropriate values
in the other fields.  That won't work, because there's no guarantee that
bp points to a value aligned on a 4-byte boundary.

Declaring "struct bootp" to be packed appears to keep at least GCC 4.2.4
from performing that optimization; we define an "UNALIGNED" tag to apply
to structures to prevent that optimization, and apply that tag to the
structures in bootp.h.  (We'll apply it to other structures as we
discover the need for it.)
2010-08-14 17:31:04 -07:00
Guy Harris
fe209f3b17 Add a -h flag, and only attempt to recognize 802.11s mesh headers if it's set.
I give up.  I have no access to the 802.11s drafts, I can't find
anything that suggests whether a heuristic check for an 802.11s header
should check for To DS and From DS both being set or either being set or
unset, or whether it should check for a QoS frame type (the examples in
all the documentation I can find have To DS and From DS set, and have a
QoS field, in the 802.11 header, but that might just be an example
802.11 header showing all the fields), so I'm just adding a -h
command-line flag; you need to specify it to get tcpdump to try to guess
whether a frame has a mesh header or not.  I'll leave it up to somebody
else to figure out what the best heuristic for detecting the presence of
mesh headers is (note that tcpdump and Wireshark have different
heuristics, both of which can probably get false positives, especially
with encrypted frames where the first payload byte just *happens* not to
have any of the reserved bits in the mesh header flags set).
2010-05-27 23:58:01 -07:00
Michael Richardson
1ace87d57b moved ieee802.15.4 to NDO system 2010-05-13 14:30:59 -04:00
Dmitry Eremin-Solenikov
ec799d60f6 Merge remote branch 'origin/master' 2010-03-09 17:36:58 +03:00
Guy Harris
ea5736c8c6 Process VLAN frames and Alteon jumbo frames in the Ethernet printer.
Instead of having the Ethernet-type handler process the VLAN and Alteon
jumbo frame Ethernet type values, process them in the Ethernet (and
Linux cooked-mode) dissectors.  This makes it easier for the right MAC
addresses to be printed for those packets.

As part of that, rename ether_encap_print() to ethertype_print() - it
doesn't print encapsulated Ethernet frames, it prints payloads whose
packet type is indicated by an Ethernet type field value - and remove
the no-longer-needed "extracted Ethernet type" argument.  That also lets
us eliminate it from the SNAP print routine.

Make ether_print() take a function, and an argument to pass to that
function, as parameters, so that, for example, the ATM LANE printer can
use it and put the LEC ID into the link-layer headeer printout.
2010-02-21 12:44:53 -08:00
Guy Harris
071cdba2b3 Handle the 48-byte and 64-byte Linux USB headers differently; for now,
the difference isn't major, but it might be more important later.
2010-01-25 15:25:33 -08:00
Guy Harris
6003dc5285 Get rid of BIG_ENDIAN and LITTLE_ENDIAN definitions.
The configure script doesn't define BYTE_ORDER, so they can't validly be
compared against BYTE_ORDER; don't leave them around for people to think
they can.
2010-01-10 18:00:08 -08:00
Michael Richardson
d0e01819c0 IETF FORCES protocol printer, from Jamal Hadi Salim <hadi at cyberus.ca. 2010-01-10 14:49:46 -05:00
Guy Harris
5f947ac9b4 XXX_if_print() routines are not passed a "struct netdissect_options *",
so ipnet_if_print() can't expect one.

ipnet_print() isn't called from outside print-ipnet.c, so make it static.
2009-11-26 14:57:38 -08:00
Michael Richardson
052094d865 updated print-ipnet.c to use netdissect options structure 2009-11-24 21:31:04 -05:00
Darren Reed
b116cd9ac4 The patches attached to this email are required to get a fully working tcpdump
on OpenSolaris, or Solaris Express Community Edition, build 125 and later.

The attached patch introduces support for printing out the IPNET headers used
for packet capture inside of zones that share their networking with the global
zone and for packets "transmitted" between zones.

tcpdump 4.0.0 will ship with builds 129 and later of OpenSolaris/SXCE and
when run as root with the '-L' option, should behave as below to indicate that
the system is fully functional:

Data link types (use option -y to set):
 DOCSIS (DOCSIS) (printing not supported)
 IPNET (Solaris IPNET)
 EN10MB (Ethernet)

Cheers,
Darren
2009-11-24 21:20:25 -05:00
Michael Richardson
27e7cefadd netdisect converted icmp6_print() 2009-11-14 21:36:05 -05:00
Guy Harris
f26c9ae48e Fix typo. 2009-10-12 16:58:56 -07:00
Hannes Gredler
a0275861d3 modularize ip6 nextlayer checksum generation and
change tcp6 and pim6 to use it.
2009-10-12 10:16:58 +02:00
Dmitry Eremin-Solenikov
2158a39074 Add support for IEEE 802.15.4 packets
Add a dummy printer for ieee 802.15.4 pakets.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
2009-08-09 18:06:27 +04:00
Florian Forster
289e0aed7d print-olsr: Add basic IPv6 support.
Unfortunately OLSR uses the same IDs for IPv4 and IPv6 packets, even
though the size of "messages" differ. The version of the internet protocol
is therefore handed to the "olsr_print" function.

The code isn't very nice, due to a high density of #ifdef INET6'es. If
IPv6-support really should be optional, I'm afraid this is inevitable.
Both, compilation with and without IPv6 support has been tested.

The patch addresses fixes other issues, too. The length given in the packet
was used for pointer arithmetic without checking if the value was in a
reasonable range first in several places. It should now be possible to
decode more than one "namespace message" within a single packet. Other
changes remove trailing whitespace or fix lines indented with tabs (the
majority of the file is indented using spaces).

Signed-off-by: Florian Forster <octo@leeloo.lan.home.verplant.org>
2009-05-21 10:38:40 -07:00
Florian Forster
127b352b40 util.c: Add the `mask62plen' utility function.
The function does the same as `mask2plen' but for IPv6.

Signed-off-by: Florian Forster <octo@leeloo.lan.home.verplant.org>
2009-05-21 10:29:24 -07:00
Guy Harris
2c28d8f466 From Bert Vermeulen: add a USB printer, and fix the error message
printed when trying to print packets for a DLT_ for which we don't have
a printer to indicate that you can still save to a capture file in that
case.  (Slightly changed not to require DLT_USB_LINUX_MMAPPED to be
defined, for older libpcaps that only define DLT_USB_LINUX.)
2009-04-04 12:30:27 -07:00
Guy Harris
8c63baec6f Make the default snapshot length the maximum; add a #define for the
maximum.

Get rid of redundant definition of DEFAULT_SNAPLEN in interface.h.

Update the documentation.
2009-03-05 01:01:29 -08:00
Hannes Gredler
56a0f0167c from Anantharamu Suryanarayana: add 4-byte AS support to the BGP printer 2009-01-20 21:40:22 +01:00
hannes
3d3c70fbe9 add infrastructure for verifiying the HMAC-MD5 digest in routing protocols.
The shared secret is passed using the already existing -M option which is
used for TCP-MD5 checking.

add initial supoort for RSVP Integrity object verification.
2008-08-16 11:36:20 +00:00
guy
bca64a2755 Use the new libpcap API's if available; that means we can support "-B"
on all platforms in that case.  Also, add a "-I" flag to turn on monitor
mode.
2008-04-04 19:42:11 +00:00
guy
d342f456e4 Fix signature of bpf_dump() to match that of libpcap's version. 2008-02-14 20:53:49 +00:00
guy
efb80785aa Support DLT_IEEE802_11_RADIO_AVS.
Update a comment (we now parse the radiotap header).
2007-12-20 08:13:35 +00:00
guy
a11ed8914e SMB-over-TCP (port 445) support. 2007-12-09 00:30:47 +00:00
guy
3a34763284 From Paolo Abeni: print some basic Bluetooth information.
Update CREDITS, FILES, and INSTALL appropriately; clean up changes to
Makefile.in to keep the file names in order.
2007-09-24 23:46:26 +00:00
mcr
f6833293ae fully convert print-isakmp.c to NETDISSECT. 2007-08-29 12:31:00 +00:00
hannes
e7dc0250ec from Carles Kishimoto <carles.kishimoto@gmail.com>: add support for the SFLOW protocol 2007-08-08 17:20:58 +00:00