Commit Graph

446 Commits

Author SHA1 Message Date
Francois-Xavier Le Bail
8630bd5e79 Rename two pcapng test files to .pcapng 2022-03-08 16:37:42 +01:00
Donatas Abraitis
58f86cd1ac bgp: Shutdown message can be up to 255 bytes length according to rfc9003
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-02-12 16:37:37 +00:00
Francois-Xavier Le Bail
255c1cbcf3 BGP: Fix parsing the AIGP attribute
There was an invalid ND_TCHECK_LEN(), thus the AIGP metric attribute
at the end of an update message was incorrectly shown as truncated.

Remove it because the data fetching is secured by GET_BE_U_8 and
print_unknown_data.

Add a test file with AIGP attribute at the end of an update message.

This should fix GitHub issue #975.

Remark:
This code need more updates on length checks to change some 'truncated'
process to 'invalid' process.
2022-02-09 14:28:54 +01:00
Donatas Abraitis
2262e71e68 bgp: Parse rfc9072 (Extended Optional Parameters Length for BGP OPEN Message)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-02-02 10:21:58 +00:00
Francois-Xavier Le Bail
b7fac5e13d Rename two pcapng test files to .pcapng 2022-01-23 12:28:42 +01:00
Donatas Abraitis
e3384c7242 bgp: Print enhanced route refresh message subtype
Add a test to check if we print subtype for enhanced route refresh msg.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-23 10:01:42 +00:00
Donatas Abraitis
9af0029d97 bgp: Check if Enhanced route-refresh capability is printed properly
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-23 10:01:42 +00:00
Francois-Xavier Le Bail
8310fab73c Rename a pcapng test file to .pcapng 2022-01-17 22:56:44 +01:00
Nathan O'Sullivan
63b104dc5b Add --print-sampling option to print every Nth packet
New option `--print-sampling=NTH` will parse and print every NTH packet,
with all other packets producing no output. This option enables
`--print` and `-S` flags.

Print sampling is useful for real-time inspection of an interface with
a high packet rate, or initial inspection of large capture files.
2022-01-17 19:43:59 +00:00
Denis Ovsienko
beddcbb4ea OpenFlow: Refine more length checks.
In print-openflow-1.0.c and print-openflow-1.3.c replace the remaining
"goto invalid" checks with ND_ICHECK_U() and ND_ICHECKMSG_U().  Redo the
changes from commit 1ce16ea: use the same order of arguments and the
same comparison operators as before the change and lose the unsigned
compensation, which is no longer required.  Add another test case using
a malformed packet from Francois-Xavier.
2022-01-05 22:57:45 +00:00
Denis Ovsienko
1ce16ea577 OpenFlow 1.0: Improve handling of some lengths.
For OFPT_PACKET_OUT print "actions_len", as it is a part of the message
and should appear in its decoding (in other message types it is derived
from the message length).

ND_ICHECK_*() in of10_actions_print(), of10_flow_stats_reply_print() and
of10_packet_out_print() after printing at least some of the output.
This, compared to just "(invalid) (invalid)", makes it much easier to
understand  where and why the packet data was not fully decoded.  Define
OF_ACTION_MINLEN unsigned to squelch the induced compiler warnings.  A
number of similar checks still remain to be converted the same way.
2021-12-29 21:27:58 +00:00
Donatas Abraitis
052ed329c1 tests: Add a pcap test for BGP extended message capability
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-12-16 18:27:49 +00:00
Rui Paulo
b0b726f497 Add a test case for QUIC retry packets. 2021-11-10 12:29:31 +00:00
Rui Paulo
8ce37b54ed Initial support to parse QUIC packets. 2021-11-09 09:11:34 +01:00
Francois-Xavier Le Bail
390c5b70aa Rename a pcapng test file to .pcapng 2021-10-27 22:16:11 +02:00
Donatas Abraitis
c998848b4b tests: Add a pcap test for BGP link-bandwidth extended community
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-09 17:19:58 +01:00
Tobias Waldekranz
dde10e0366 DSA: Correctly determine VID
The 4 MSBs of the VID is stored in the lower nibble of the tag's third
byte.

Previously the priority bits where folded into the VID space, e.g. a
packet with VID=1 and priority 6 was printed as having a VID of
1537 (0x601).

Add DSA test PCAPs with packets containing a high VID and non-zero
FPri values to make sure we catch any future regressions.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
2021-10-05 22:52:00 +02:00
Francois-Xavier Le Bail
fd409921d9 lwres: Fix a length check
This fix some inconsistent outputs clang versus gcc in 32 bits mode.

Add a test file.
2021-09-27 16:10:31 +02:00
Gokul Sivakumar
34f0181eed IEEE 802.11: Add a test to check the 802.11s Mesh ID in management frames
The newly added pcap file contains a Mesh Beacon frame, a Wildcard Probe
Request and a Mesh Probe Response. The test case checks if the "Mesh ID"
field is properly parsed by the IEEE 802.11 printer.
2021-08-22 11:08:57 +05:30
Denis Ovsienko
fbd44158e0 Mend "make check" on Solaris 9 (Autoconf only).
Sun C 5.9 does not support C99. GCC 4.6.4 recognizes -std=gnu99, but
does not support the z length modifier in printf(3). In either case 18
tests fail in the following manner:

<     [...]: domain [length 0 < 12] (invalid)
---
>     [...]: domain [length 0 < zu] (invalid)

Make these tests conditional and disable them when HAVE_NO_PRINTF_Z is
defined. Modify the Autoconf leg of the build process to define the
macro when printf() does not handle %zu as expected. The CMake leg looks
broken on Solaris 9 with 2.8.9 now, so leave it be for now.
2021-07-25 14:44:03 +01:00
ishaangandhi
dbf0433fef Add dissector for ICMP Interface Identification Object 2021-07-13 19:02:32 +00:00
Davide Caratti
1ac47641c5 mptcp: add support for MP_TCPRST
dissect the MP_TCPRST sub-option in accordance to RFC8684 §3.6.

Link: https://github.com/multipath-tcp/mptcp_net-next/issues/189
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
2021-07-12 10:51:58 +02:00
Francois-Xavier Le Bail
e4adb4b6e1 Rename a test. It's about the AppleTalk protocol 2021-07-10 20:57:07 +02:00
Neelabh
7b4e6191a7 Add support for IPv6 agent in sFlow. 2021-05-17 14:52:12 +00:00
Denis Ovsienko
0f19351efd Don't try to run the DLT_RAW test on OpenBSD.
With this change tcpdump passes "make check" on OpenBSD 6.8 AMD64.
2021-03-17 11:55:17 +00:00
Bill Fenner
6c002d33c0 BFD: add SBFD support (RFC7880 and RFC7881)
Add support for SBFD on UDP port 7784.  SBFD is different
in that packets from the reflector will be sent with *source*
port 7784; in all other BFD mechanisms, it is only the
destination port that matters.  For SBFD print-udp.c has to
check both source and destination port.
2021-02-14 15:08:33 +00:00
ckishimo
c86534460a ospf: add support bit Nt RFC3101 2021-01-23 13:55:31 +00:00
Francois-Xavier Le Bail
d4fe5e32fd TCP: Add a test with data in the RST segment, truncated example 2021-01-19 18:25:15 +01:00
Francois-Xavier Le Bail
383670e8f3 TCP: Add a test with data in the RST segment 2021-01-18 14:06:26 +01:00
Francois-Xavier Le Bail
ab150a17ea Add tests for more code coverage in timestamp printing functions
Use a TCP 3-Way Handshake test, nano precision.

Display micro outputs and nano outputs (with -q).
2021-01-05 17:19:23 +01:00
Francois-Xavier Le Bail
dd5c8e6776 Remove '-t' option for MACsec tests
like all the other tests.
2021-01-05 15:20:52 +01:00
Francois-Xavier Le Bail
192db0a116 SMB: Disable the printer by default
Like in 4.9.3 version.
This printer needs rework.

Move the tests with SMB packets in tests/smb.tests.
Add outputs files for the disabled case.
2020-12-19 12:16:50 +01:00
Denis Ovsienko
b402a7dc84 IGRP: Fix an OOBR introduced in the prev. change
Add missing GET_U_1() wrappers to cover struct igrprte properly again,
also deduplicate some code.

This fixes a buffer over-read introduced in a recent commit 09b9aad and
discovered by Hardik Shah.

Add a test using the capture file supplied by the reporter.
2020-12-05 23:43:17 +00:00
Guy Harris
92d636a906 dns: add some additional error checks.
If the upper 2 bits of a label/pointer value are 10, treat that as an
error.

If a name is longer than 255 characters, treat that as an error.

This prevents some long loops with malformed packets, as found by Hardik
Shah.
2020-11-14 20:34:25 -08:00
Francois-Xavier Le Bail
39fb6815e5 IPNET: Add a test case with '-e' option 2020-11-12 20:26:27 +01:00
Francois-Xavier Le Bail
3354431e89 PPTP: Add two tests
With and without '-v' option.

The capture file comes from the Wireshark menagerie (pptp.cap).
2020-10-31 11:46:12 +01:00
Davide Caratti
19b771391a mptcp: add support for ADD_ADDR "echo bit"
print "v1-echo" if the echo bit is set in the ADD_ADDR suboption (see
RFC8684 §3.4.1). While at it, dissect the 4 bits after the MPTCP option
subtype when the value is "ADD_ADDR" (0x3), according to protocol v0 and
v1. Add a selftest with a capture taken from a recent Linux kernel
implementation, and fix printout of add-addr in the existing selftests.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
2020-10-03 16:41:20 +01:00
Denis Ovsienko
bdac249ee0 OpenFlow 1.3: Add initial partial support.
This code processes only the simplest message types (9 out of the 30
defined).

Add a test from [1], which comes from [2], which comes from a
contributor in Ericsson (Zoltán Lajos Kis).

1: https://wiki.wireshark.org/SampleCaptures#OpenFlow
2: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9283
2020-09-28 13:58:12 +01:00
Bill Fenner
fab90c5c95 Update for messages and TLVs defined in RFC4388 2020-09-23 10:17:30 +00:00
Bill Fenner
f58e26a369 Update LSP ping: timestamps are NTP int+fraction
During development of LSP ping, the embedded timestamps were
changed from struct timeval to NTP time, so update the printer
to match the RFC.

(Cherry-picked from GH #874.)
2020-09-20 16:33:02 +01:00
Francois-Xavier Le Bail
09e8265641 Remove now unused 'tests/TESTonce'
Update a comment.
2020-09-06 21:36:33 +02:00
Herwin Weststrate
26f04f1f16 RADIUS: Add attributes from RFC5580. (GH #706) 2020-08-27 13:39:18 +01:00
Francois-Xavier Le Bail
4482e16802 SRv6: Add a test output without '-e'
This is a follow-up to commit 1103418a18.
2020-08-07 20:31:29 +02:00
Ahmed Abdelsalam
1103418a18 Add support for ethernet IP protocol
The SRv6 network programming defines a new IP protocol number [1].

The new protocol number is used in the Next Header field of an IPv6 header
or any extension header indicates that the payload is an Ethernet.

IANA has assigned 143 as the protocol number of ethernet [2].

The SRv6 packet has the following format:
IPv6 HDR + SRH + Ethernet HDR + IPv4/IPv6 packet

This patch allows TCPDUMP to dissect such SRv6 packets.

[1] https://tools.ietf.org/html/draft-ietf-spring-srv6-network-programming-16#section-9.1
[2] https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

Signed-off-by: Ahmed Abdelsalam <ahabdels@gmail.com>
2020-08-07 16:11:20 +00:00
Francois-Xavier Le Bail
4a390644ce EAP: Add verbose output for the test case eapon1.pcap 2020-07-20 09:58:35 +02:00
Moses Devadason
1f9d3d622e LLDP 8021 link aggregation TLV support
As per IEEE std 802.1-AB-2009, 802.3 link aggregation TLV has been
deprecated and link aggregation TLV has been added as an 802.1
TLV. Support for this is given.
2020-06-30 20:12:31 +00:00
Francois-Xavier Le Bail
95e4db107c Add two test files for the unsupported link-layer protocols printer
This is a follow-up to commit 25687e1a31.

These files come from the Wireshark menagerie:
0031419.pcap (link type 160) and 5632-Raw_D-BUS.cap (first two packets).
2020-06-13 11:12:15 +02:00
Francois-Xavier Le Bail
403ae5774b DNS: Add two test files (over TCP and over UDP) 2020-06-10 11:50:32 +02:00
Guy Harris
7885cfa165
Merge branch 'master' into macsec 2020-05-27 17:01:23 -07:00
ckishimo
586e9b7720 IS-IS: Add LAN Adjacency Segment Identifier subTLV
Adapted from GitHub pull request #798.

Print " (invalid)" when combinations of V-Flag and L-Flag are invalid.

Update comments (draft -> RFC).

Remove some ND_TCHECK_LEN because GET_ use.

Update the output of isis_sid test because commit
b09710dfcd updated the output format
of the IS-IS dissector.
2020-05-25 16:43:42 +02:00