Commit Graph

2984 Commits

Author SHA1 Message Date
Guy Harris
60f8354159 HP C isn't the only compiler on which we must avoid GCC-style -W flags.
MIPS C and DEC C also can't be made to reliably Just Say No to those
flags, and they don't support those flags, so don't try them with those
compilers either.
2013-05-12 12:30:01 -07:00
fra
0b80d76bdd IANA (www.iana.org/assignments/service-names-port-numbers/
service-names-port-numbers.txt) has assigned an official port for
VXLAN (4789).  tcpdump uses this by default but we keep the -T
vxlan option as well (e.g. Linux is allowing different ports).
2013-05-10 12:06:21 -07:00
Guy Harris
122e1529b7 Support dependency generation with some non-GCC compilers.
Also, if we don't support it with a given compiler, have "make depend"
not run mkdep, as it won't do anything useful.
2013-05-08 00:08:12 -07:00
Guy Harris
b2fd5f862c Get rid of extra blank line. 2013-05-08 00:02:15 -07:00
Guy Harris
e6ffaf8395 Don't try -W flags with HP's C compiler.
HP's C compiler cannot be made to exit with a non-zero exit status when
given an unknown compiler flag, so you can't use that to figure out if a
flag is supported, but it *will* print a warning, which we don't want.

In addition, it doesn't support -W flags for warnings in any case, so
let's not bother with them.
2013-05-07 23:58:51 -07:00
Guy Harris
7d0510cec8 With .devel, use -W flags iff the compiler supports them.
Don't base the question of whether to use a particular -W flag on
whether we're compiling with GCC or not, and on which version of GCC
we're using; some compilers, such as clang, also support many of those
-W flags.  Base it on whether the compiler complains if we use it (which
means, for clang, that we have to force it to exit with a non-zero exit
status if it doesn't like a flag; otherwise, we'll specify it, and clang
will warn about it on every compile).
2013-05-06 23:54:20 -07:00
fxlb
d10641dd39 DHCPv6 decoder update (RFC3646, DNS options)
- Add decoder for option 24 (DOMAIN_LIST)
- Rename option 23 as DNS_SERVERS
- Rename option 24 as DOMAIN_LIST
- In dhcp6opt_print() constify dh6o
2013-05-06 16:14:55 -07:00
fxlb
d95f034af7 DHCPv6 decoder update
- In dhcp6opt_print() constify tp
- Add decoder for option 21 (SIP_SERVER_D - RFC3319)
2013-05-06 15:54:52 -07:00
Guy Harris
debfc3ded8 Fix error in my previous commit. 2013-05-06 15:53:35 -07:00
Wim Torfs
4a44bca21c new test for DLT_IEEE802_11_RADIO w/ext. bitmap
I modified the mac80211 and ath9k kernel module such that extra
information regarding rssi, etc are available, which is why I needed the
extra bitmap. Capturing the packets is simply a matter of using tcpdump
-i wlan0 -w dumpfile.

Test-file-not-changed-due-to-doing-pulls-in-the-wrong-order-by: Guy Harris <guy@alum.mit.edu>
2013-05-06 15:38:33 -07:00
Denis Ovsienko
2f2e35168f fix bug #303 (DLT_IEEE802_11_RADIO ext. bitmaps)
This bug was discovered and pinned down by Wim Torfs.

The code in question handles DLT_IEEE802_11_RADIO datalink type, which
consists of a variable-sized header, a variable number of fields and the
actual 802.11 frame. The integers contained in the fields are aligned,
properly extracting them is exactly the purpose of the existing "cpack"
module. The issue with the current code is that it sets alignment base
for cpack at the end of the variable-sized header, in other words,
64-bit integers would be properly extracted only so long as the header
is 64-bit long, which only happens when the total number of bitmaps in
it is odd (the minimum number of bitmaps is one). Once this condition
isn't met, as is with two bitmaps, decoding becomes incorrect. The
reporter's point that the alignment base must be the beginning of the
variable-sized header is accurate.

This commit adds a new cpack_advance() function to fast-forward the
"c_next" pointer of a cpack_state context by an arbitrary number of
octets. The ieee802_11_radio_print() function now uses it to skip the
header and all its bitmaps, and the alignment base is now the header
start.
2013-05-06 15:00:50 -07:00
Guy Harris
842e10954c Rename a variable to attempt to fix an AIX compile error.
On AIX 5.1, at least when compiling with xlc, the statement

       struct mp_remove_addr *rem_addr = (struct mp_remove_addr *) opt;

gets a complaint "Syntax error: possible missing '{'?"

"/usr/include/sys/xmem.h" #defines rem_addr; I've no idea whether we're
indirectly including that, but maybe we are and maybe that's causing the
problem.
2013-05-05 19:52:14 -07:00
Guy Harris
e4eef539af Not all platforms on which we compile define PRI[doux]16.
So don't use it; it's not necessary on any of the platforms on which we
work.  (The *only* ones that are needed are PRI[doux]64, because
sometimes you need %ll[doux], sometimes you need %l[doux], and with MSVC
you need whatever its run-time library requires.)
2013-05-05 19:47:48 -07:00
fxlb
a8a1373d3e .gitignore: add autom4te.cache/ 2013-05-05 19:00:40 -07:00
fxlb
ea6238710a DHCPv6 decoder update
- Rename option 31 as SNTP_SERVERS (see RFC4075)
- Add decoder for option 56 (NTP_SERVER) from RFC5908
2013-05-05 18:59:40 -07:00
Denis Ovsienko
abdd4e1905 unset executable bit on a few .h and .c files 2013-05-05 18:58:15 -07:00
Denis Ovsienko
b16f6c8099 fix year for 4.3.0 in CHANGES 2013-05-05 18:57:19 -07:00
Denis Ovsienko
16c4dab56d Fix off-by-one error in print-rx.c
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)
2013-05-05 18:56:09 -07:00
Guy Harris
1ea8a8c4a4 Avoid bitfields, unaligned accesses, packed structures, and PRI[ux]{16,32}.
Bitfields are not one of C's shining points.  There is *NO* guarantee in
what order bitfields are put within a structure - it's *NOT* necessarily
the same as the byte order of the machine, and it's *ESPECIALLY* not
guaranteed to be correlated with the value of the LBL_ALIGN definition
(that definition has to do with whether unaligned accesses are supported
by the hardware).  In addition, even if they're declared as unsigned,
that doesn't mean they're guaranteed to *be* unsigned.  Don't use them.

Unaligned accesses are not guaranteed to work, and fields in packets are
not guaranteed to be naturally aligned.  Use the EXTRACT_nBITS() macros.

__attribute((packed))__ is a GCCism, and is not guaranteed to be
supported by all compilers with which tcpdump can be compiled.  Make
integral fields > 1 byte arrays of u_int8_t's (which also lets us avoid
the & in the EXTRACT_nBITS() macros).

Some systems don't define the PRI[doux]16 and PRI[doux]32 macros, and
others define them infelicitously (i.e., for PRI[doux]32, with an "l";
our 32-bit integer types are *not* longs, as we don't care about
16-bit-"int" platforms).
2013-05-05 18:52:54 -07:00
Guy Harris
bf97f9965e Fix some compiler warnings from the previous checkin. 2013-05-05 18:31:48 -07:00
Gregory Detal
3432f69892 Fix MPTCP support
Added:
 * option length check
 * option type and TCP flags check
 * more information printed

Signed-off-by: Gregory Detal <gregory.detal@uclouvain.be>
2013-05-05 18:29:46 -07:00
Guy Harris
902a44da19 Put mptcp.h into the release tarball. 2013-05-05 15:51:57 -07:00
Guy Harris
8e6ada81e6 Point people to the the-tcpdump-group repositories, not the mcr repositories.
We've created a the-tcpdump-group organization on GitHub, and created
repositories for libpcap and tcpdump, owned by them.  Those are now the
"official" GitHub locations for repositories from which to clone or
against which to file issues/pull requests.
2013-04-15 21:09:24 -07:00
Guy Harris
e3591424ed Fix some compiler warnings.
Some of those warnings are real bugs - some routines whose callers
expected them to return values weren't returning values.
2013-04-14 17:21:19 -07:00
Guy Harris
9716f7bd0f Merge branch 'master' of git+ssh://bpf.tcpdump.org/tcpdump/master/git/tcpdump 2013-04-14 16:55:45 -07:00
Alexandra Kossovsky
62e9534650 If we get SIGCHLD, restart whatever system call it interrupted.
When compressing output with -z, we do so by creating a child process to
run gzip and pipe to it, and we catch SIGCHLD to clean up after the
child process.  We don't want the SIGCHLD to show up as an "Interrupted
system call" error, so we specify that SIGCHLD should restart, rather
than interrupting, system calls.
2013-04-14 18:20:26 -04:00
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
a248bf041a use macros for VAT and WB port numbers 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
Denis Ovsienko
fac122dea6 add a test case for native PGM
This commit adds a capture of a few PGM (IP protocol 113) packets
produced with version 2.2.0 of zeromq library built with PGM support
(using the "pgm://" protocol schema). Each of the three ODATA packets in
the capture contains a ZeroMQ datagram in the "Data" (application data)
field. There is a new test case covering the PGM part of the capture.
2013-04-14 18:20:26 -04:00
Denis Ovsienko
267910ecc1 fix two issues with PGM length handling
1. "TSDU Length" comes in network byte order on wire, add missing macro.

2. The (unused) justification of the number of bytes on wire wasn't
correct because one side of the comparison included header size and
another didn't (note the byte order as well). Besides that, the value of
TSDU Length was already output thus far. Don't justify the number of
bytes on wire and change the final printf() to make a use of it.
2013-04-14 18:20:26 -04:00
Denis Ovsienko
5aed2384cb fix two printf format strings 2013-04-14 18:20:26 -04:00
fxlb
fb2bf95085 Change C++ style comments to C style comments 2013-04-14 18:20:26 -04:00
Guy Harris
b2d1b8586b There's another Cisco-private encapsulation of BPDUs.
At least according to the Wireshark STP dissector, SNAP frames with the
Cisco OUI and a PID of 0x010c contain BPDUs, for "VLAN Bridge".
2013-04-14 18:20:26 -04:00
Michael Richardson
871391abc7 added Ruben 2013-04-14 18:13:17 -04:00
Alexandra Kossovsky
02da852383 If we get SIGCHLD, restart whatever system call it interrupted.
When compressing output with -z, we do so by creating a child process to
run gzip and pipe to it, and we catch SIGCHLD to clean up after the
child process.  We don't want the SIGCHLD to show up as an "Interrupted
system call" error, so we specify that SIGCHLD should restart, rather
than interrupting, system calls.
2013-04-14 11:57:56 -07:00
Guy Harris
30ee65f07a There's another Cisco-private encapsulation of BPDUs.
At least according to the Wireshark STP dissector, SNAP frames with the
Cisco OUI and a PID of 0x010c contain BPDUs, for "VLAN Bridge".
2013-04-13 18:45:19 -07:00
Guy Harris
655b53ac19 Note that we fixed the IPv6 check for Solaris. 2013-04-06 14:11:29 -07:00
Guy Harris
318ecd24c5 Check for extra networking libraries before checking for IPv6.
On some platforms, such as SunOS 5.x, building the "do we have IPv6
support?" test program requires the extra networking libraries, so we
need to know what extra networking libraries are required before doing
that test.
2013-04-06 13:03:58 -07:00
Michael Richardson
a554cbf78a Merge pull request #57 from fxlb/master
Fix function 'msnlb_print', unused parameter 'length'
2013-03-28 05:37:19 -07:00
Michael Richardson
3a89234642 Merge pull request #58 from rubenk/master
print-sflow.c: print agent_id instead of number of samples in non-verbose mode
2013-03-28 05:33:37 -07:00
Michael Richardson
e2fd27d104 Merge pull request #60 from wxsBSD/master
Fix SIGINT with multiple file reading.
2013-03-28 05:32:52 -07:00
Wesley Shields
6ab32a4325 Stop reading multiple files properly on cleanup.
Prior to this if pcap_breakloop() is called in cleanup() while reading
multiple files (via -V) the code would fall through and open the next
file in the list. With this change the list is cut short and the program
exits normally.
2013-03-27 22:28:11 -04:00
Guy Harris
1b0c892902 Don't print the SPB stuff in non-verbose mode.
Before the previous change, we didn't print it; restore that behavior.

Also update a comment - DEFAULT_SNAPLEN is now pretty large, so we
should capture the entire packet by default.
2013-03-27 01:18:58 -07:00
Gisle Vanem
a42db1cd0f Get rid of declarations in the middle of code; they're not valid C.
Reviewed-By: Guy Harris <guy@alum.mit.edu>
2013-03-26 10:34:33 -07:00
Guy Harris
4a696ee49a Fix handling of V3 and V4 BPDUs.
Make the offsets and lengths 32-bit, so that they don't overflow.

Pull the handling of V4 fields into its own routine.  Call it only if
the packet's been identified as a V4 packet and the length is sane; call
the routine to handle V3 fields before we do any V4 work.
2013-03-26 02:35:14 -07: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
Guy Harris
56bcff3da9 We don't define PRIu8 or PRIx8 if the C environment doesn't; don't use it.
The right format to use to print 8-bit quantities isn't
implementation-dependent, so no need to use the PRIu8 and PRIx8 macros.

There's also no need for an empty string after PRIu64.  Separate it with
space from the strings with which it's being concatenated, however; we
do that elsewhere.
2013-03-26 02:01:31 -07:00
Guy Harris
bfd4b6b7f5 Add some additional changes. 2013-03-26 01:21:46 -07:00