Commit Graph

5529 Commits

Author SHA1 Message Date
Francois-Xavier Le Bail
e85072ad1d Fix a typo 2019-03-07 14:31:19 +01:00
Francois-Xavier Le Bail
c97c3571a0 TCP: Fix an undefined behavior at runtime
The error was:
print-tcp.c:831:22: runtime error: unsigned integer overflow: 0 - 1
cannot be represented in type 'u_int' (aka 'unsigned int')
2019-03-06 14:52:14 +01:00
Guy Harris
457a4acb89
Merge pull request #734 from jkcko/master
Support DLT_IEEE802_15_4_TAP.
2019-02-28 09:58:25 -08:00
Francois-Xavier Le Bail
0f9808547c Clean up whitespaces/indentation 2019-02-27 21:24:12 +01:00
Francois-Xavier Le Bail
bcbe2cd035 ISAKMP: Simplify an expression 2019-02-27 20:31:02 +01:00
Francois-Xavier Le Bail
b9ac2f3feb Clean up whitespaces 2019-02-27 20:13:59 +01:00
Francois-Xavier Le Bail
61857ddd22 Add two ndo_protocol reassignments after xxx_print() calls 2019-02-27 12:26:10 +01:00
Francois-Xavier Le Bail
cc734973ea Clean up whitespaces/indentation 2019-02-27 12:12:34 +01:00
Francois-Xavier Le Bail
a67cf88e5d IS-IS: Replace some ND_TTEST_*() calls with ND_TCHECK_*() calls 2019-02-25 17:40:02 +01:00
Francois-Xavier Le Bail
91b0ee0a59 IEEE 802.11: Replace some ND_TTEST_*() calls with ND_TCHECK_*() calls
Moreover:
Use 'goto trunc' in some length tests.
2019-02-24 10:55:12 +01:00
Francois-Xavier Le Bail
6d855c7007 Clean up whitespaces/indentation 2019-02-24 09:44:14 +01:00
Francois-Xavier Le Bail
7ceb3ae2a6 RSVP: Replace a ND_TTEST_*() call with ND_TCHECK_*() call 2019-02-23 22:31:06 +01:00
Francois-Xavier Le Bail
5b8c5e94fe GeoNet: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls
Moreover:
Add two comments
2019-02-23 19:56:00 +01:00
Francois-Xavier Le Bail
57d187a391 Clean up whitespaces 2019-02-23 19:51:59 +01:00
Francois-Xavier Le Bail
a14faa6873 OLSR: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls 2019-02-23 19:27:37 +01:00
Francois-Xavier Le Bail
a9c8816ff0 GRE: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls 2019-02-23 18:05:36 +01:00
Francois-Xavier Le Bail
77fa97a8d7 Clean up whitespaces/indentation 2019-02-23 17:31:48 +01:00
James Ko
5cf83c2fce Handle DLT_IEEE802_15_4_TAP.
https://github.com/jkcko/ieee802.15.4-tap
2019-02-20 09:08:03 -08:00
Francois-Xavier Le Bail
b4101b5314 Add a test for NFS write verifier cookie in TESTLIST
This is a followup to commit 8b9f7d9d76.

Moreover:
Rename the .pcap file to .pcapng.
2019-02-07 12:53:55 +01:00
Francois-Xavier Le Bail
a5211097d0 Remove some useless spaces 2019-02-01 13:59:45 +01:00
Francois-Xavier Le Bail
8102102345 Remove a useless space 2019-01-29 21:39:41 +01:00
Francois-Xavier Le Bail
d1e386ca6a Change some pcap tests to test the printers again
The added sanity check was: packet length >= capture length.

Thus update packet length to be capture length if lower.

This change is a followup to commit 9e6ba479d8.
2019-01-29 14:27:06 +01:00
Guy Harris
16add3e4ca
Merge pull request #722 from aieri/issue/695
Amend documentation about the use of the -C -G and -W switches.
2019-01-28 18:29:37 -08:00
Guy Harris
c0af6af301
Merge pull request #703 from nmap/update-gitignore
Add files generated by CMake on Windows to .gitignore
2019-01-28 18:27:48 -08:00
Guy Harris
dc81f22b9b
Merge pull request #728 from ffainelli/brcm-tag
Add support for dissecting Broadcom tags
2019-01-28 16:11:13 -08:00
Florian Fainelli
3d1bade63b Add Broadcom tags tests
Add 3 tests to test that we can properly dissect Broadcom tags. Two are
for DSA_TAG_BRCM where the tag is between Ethernet MAC SA and
Type/Length and one for DSA_TAG_BRCM_PREPEND where the tag is
encapsulating the Ethernet frame (thus requires -e to be shown).
2019-01-28 10:56:18 -08:00
Florian Fainelli
6eaebfe992 Add support for decoding Broadcom Ethernet switches tags
This adds support for decoding the Broadcom Ethernet switches tags which
are are 4byte in length and are located between the Ethernet MAC SA and
the Type/Length field (DSA_TAG_BRCM) as well as the pre-pended Broadcom
tag (DSA_TAG_BRCM_PREPEND) which are located in front of the standard
Ethernet header.

This makes use of the recently introduced ether_print_hdr_len() to allow
specifying the non-standard Ethernet header length of 12 + 4 + 2 bytes.
2019-01-28 10:56:18 -08:00
Francois-Xavier Le Bail
e9439e9b71 Report 32-bit timestamps with uppermost bit set as "Error converting time"
In the ts_unix_print() function.

This change is a followup to commit 8e9fb1eb02.
2019-01-27 15:51:07 +01:00
Florian Fainelli
48e290d807 Ethernet: Allow specifying non-standard Ethernet header length
A fair number of proprietary Ethernet switch tagging protocols, such as
Broadcom tags for instance, will place their tag between the MAC SA and
the Type/Length field.

Move the body of ether_print() into ether_print_hdr_len() and specify
the Ethernet header length as an argument to that function.
ether_print() calls ether_print_hdr_len() with a standard Ethernet
header lenght of 14 bytes, while other callers could specify an
arbitrary length. We still assume that the first Length/Type field to
parse is located 2 bytes before the end of that Ethernet header length.

This will be used in a subsequent commit to parse Broadcom tags.
2019-01-25 17:00:24 -08:00
Antonin Décimo
0b3880c91e Fix small misspellings 2019-01-23 17:28:14 +01:00
Matt Eaton
98ef5b24a3
Update print-lldp.c
Small typo fix for `EVB Station` in Link Layer Discovery Protocol (LLDP) printer - `print-lldp.c`
2019-01-22 05:53:19 -06:00
Guy Harris
0db65c2521 Do AppVeyor builds on all branches. 2019-01-09 10:12:12 -08:00
Guy Harris
2e1a098242 Build the tcpdump-4.9 branch as well. 2019-01-09 01:24:29 -08:00
Guy Harris
0f24a43a7e Handle rpcaps:// URLs as well, for rpcap-over-TLS. 2019-01-06 18:30:59 -08:00
Andrea Ieri
362304dd68 Amend the documentation about the use of the -C -G and -W switches.
When using all three switches (-C -G and -W), the behavior is
practically identical to only using -C and -G, as the -W flag will only
affect the filename suffix.

Fixes #695
2018-12-19 10:17:31 +01:00
Guy Harris
e6fc07a516 Squelch a narrowing warning.
Use a u_char variable for characters in the RST string; no need for it
to be an int.
2018-12-11 01:15:12 -08:00
Guy Harris
2de3a27ab7 Have all Internet-checksum computing routines return a uint16_t.
Those checksums are 16-bit; change the return types of those routines
appropriately.
2018-12-11 00:50:15 -08:00
Guy Harris
d8bf24c874 Squelch some narrowing warnings.
Mostly, we just throw in casts of values already known to be in the
range of values supported by the lvalue's type to that type.

Also, for the IPX SAP table, we make the SAP value a uint16_t, as SAP
values are 16-bit.

Make a hash table index unsigned, Just Because.
2018-12-10 23:44:50 -08:00
Guy Harris
0259ae79db Umm, wrong. 2018-12-10 23:26:25 -08:00
Guy Harris
7df90fa2a2 Add, and use, macros to do locale-independent case mapping.
This means we get the same behavior in Turkish locales (where, if we
aren't in the C locale, we might get lower-case "i" mapped to upper-case
"I with dot" and upper-case "I" mapped to lower-case "i without dot),
and may also suppress some shortening warnings from MSVC.
2018-12-10 23:16:45 -08:00
Guy Harris
877753b5c8 Revert "Try to squelch a warning about non-constant format strings."
This reverts commit 76ed0bb392.

It doesn't help.

We may just want to suppress the warning, as in "trust us, we know what
we're doing", although it'd be nice if the format string passed to those
functions could be checked to make sure it is one that takes exactly one
integer argument.
2018-12-10 22:01:39 -08:00
Guy Harris
76ed0bb392 Try to squelch a warning about non-constant format strings.
Declare the format-string argument to tok2strbuf(), tok2str(),
bittok2str(), and bittok2str_nosep() as such, to see whether that gets
MSVC not to complain - or if it just gets upset because there's no "..."
argument list for it.
2018-12-10 21:53:58 -08:00
Guy Harris
19fff15898 Type and size cleanups.
Make the count of 2-octet values to dump an unsigned value.

Make the variables into which we fetch those octets unsigned as well.

Cast the result of the "is the character printable ASCII?  If so, it's
the character, otherwise it's '.'" to char, to squelch narrowing
warnings.
2018-12-10 21:23:21 -08:00
Guy Harris
8bf7a9197c Squelch a warning.
We're returning the calculated checksum result modulo 65536, given that
Internet checksums are 16-bit; throw in a cast to let MSVC know that
this is intended.
2018-12-10 20:14:57 -08:00
Guy Harris
1af79d4adf Try to squelch another annoying repeated warning. 2018-12-10 19:57:54 -08:00
Guy Harris
54772a2567 Build with the Npcap SDK as well as the WinPcap SDK. 2018-12-10 19:22:39 -08:00
Guy Harris
17aa4279ac Change tests/hoobr_bfd_print.pcap to test the BFD printer again.
Clamp the on-the-wire length values of the packets at 262144, so that we
hand the packets to the BFD printer, rather than just bailing out before
we ever get there.
2018-11-21 15:09:39 -08:00
Francois-Xavier Le Bail
01017da63c Revert "Ethernet: Remove two useless tests"
This reverts commit b7fff70582 (partially)

The sanity check in print.c/pretty_print_packet() function, packet length
(length) >= capture length (caplen), apply when the ether_print()
function is called by ether_if_print(), netanalyzer_if_print() or
netanalyzer_transparent_if_print().

But the ether_print() function is called in some other cases, thus not
sure length always >= caplen.
2018-11-19 16:02:40 +01:00
Guy Harris
9edeb14252 Handle radiotap+802.11 for DLT_LINUX_SLL2 as well. 2018-11-12 22:56:24 -08:00
Guy Harris
83e419c628 Fix printing of Linux cooked captures with monitor-mode packets.
Apparently, if you have an interface in monitor mode, capturing on the
"any" device can get packets that have a SLL hatype of 803, which is the
ARPHRD_ value for radiotap, and with the payload containing a radiotap
header, followed by an 802.11 header, followed by the 802.11 payload.
Handle that.
2018-11-12 22:03:49 -08:00