summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* NTP: Remove three redundant tests with -vv optionFrancois-Xavier Le Bail2023-05-104-123/+0
| | | | | -vv does not give more printed data than -v for the NTP protocol. The only differences were about UDP checksums in IPv4 encapsulation.
* NTP: Remove three redundant tests with -vvv optionFrancois-Xavier Le Bail2023-05-104-123/+0
| | | | -vvv does not give more printed data than -vv.
* lwres: Fix an undefined behavior in pointer arithmeticBill Fenner2023-05-023-0/+2
| | | | | | | | | | | Check for truncation before doing pointer arithmetic to point to the end of the packet. print-lwres.c:294:10: runtime error: addition of unsigned offset to 0xf3b032be overflowed to 0x9652d560 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior print-lwres.c:294:10 [Part of the PR #1012]
* PPP: Check if there is some data to hexdumpFrancois-Xavier Le Bail2023-04-273-0/+22
| | | | | | | | This may avoid this error: Dissector error: print_unknown_data() called with pointer past end of packet Add a test file showing the problem.
* RIP: Check if there is some data to hexdumpFrancois-Xavier Le Bail2023-04-273-0/+7
| | | | | | This may avoid this error: Dissector error: print_unknown_data() called with pointer past end of packet
* nhrp: fix infinite loop on malformed packets.Guy Harris2023-04-253-0/+3
| | | | | | | | If a CIE doesn't fit in the remainder of the mandatory part, return the length of that remainder, so that the loop processing the CIE terminates. Add capture that produced the infinite loop.
* SNMP: Fix two undefined behaviorsBill Fenner2023-04-195-0/+6
| | | | | | | | | | | | | | | | | | | When converting an integer from ASN.1, use an unsigned value for the partial result and assign it to the integer part of the union at the end, to avoid shifting a negative number left. print-snmp.c:545:19: runtime error: left shift of negative value -1 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior print-snmp.c:545:19 OID elements are unsigned; a large-enough oid value could result in the undefined behavior of shifting a signed integer left through the sign bit, so simply store them as unsigned. print-snmp.c:751:11: runtime error: left shift of 268435455 by 7 places cannot be represented in type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior print-snmp.c:751:11 [Part of the PR #1012]
* rt6: parse TLVgiulio-sido2023-04-187-0/+8
| | | | | | | | | Parse Type Length Values (TLV) in IPv6 Routing Header as specified by RFC 8754 [1]. [1] https://datatracker.ietf.org/doc/html/rfc8754 Signed-off-by: Giulio Sidoretti <giulio.sidoretti@uniroma2.it>
* nhrp: handle draft-detienne-dmvpn-01, improve indication decoding.Guy Harris2023-04-121-1/+1
| | | | | | | | | | Handle the I-D draft-detienne-dmvpn-01 traffic indication packet. Print the error code in an error indication symbolically if it's a known code. Print the address fields in the mandatory part of the header for error and traffic indication packets.
* Add support for dissecting RFC 2332 NHRP.Guy Harris2023-04-1111-0/+115
| | | | This is from the OpenBSD tcpdump.
* cdp: show the TLV type as a 4-digit hex number.Guy Harris2023-04-103-128/+128
| | | | It's 2 bytes long.
* cdp: support CDP TLV 0x001a.Guy Harris2023-04-102-14/+7
| | | | Based on the way it's dissected in Wireshark.
* bootp/dhcp6: DHCPv4/v6 ZTP and SZTP option supportEamon Doyle2023-04-103-0/+79
| | | | | | | | DHCPv4: RFC8572 specifies the SZTP redirect tag. DHCPv6: RFC5970 specifies the boot file URL, used for ZTP, and RFC8572 specifies the SZTP redirect tag The base DHCPv6 RFC3315 specifies the user class option.
* gre: support CDP over GRE.Guy Harris2023-04-101-2/+30
| | | | Taken from the OpenBSD version of tcpdump.
* tests: wccp_redirect_gre.pcap contains SMB, so it needs two tests.Guy Harris2023-04-104-4/+22
| | | | | Have separate .out files for dissection of wccp_redirect_gre.pcap with, and without, SMB dissection enabled in tcpdump.
* GRE: Refine the WCCP header commit. [skip ci]Denis Ovsienko2023-04-091-1/+2
| | | | | | | | Fixup the comment and have the case block actually fall through consistently with the comment and the OpenBSD implementation. Update the test case, which now has the IPv4 packet after the WCCP header. The indentation does not represent the header nesting, but the same stands for the OpenBSD implementation.
* gre: add support for WCCP redirects over GRE.Guy Harris2023-04-085-0/+315
| | | | | | | Add a test capture for it - and for GRE keepalives. Both this and the previous GRE keepalive changes are based on OpenBSD code.
* Rename a test. The protocol is IEEE 802.11Francois-Xavier Le Bail2023-02-273-1/+1
|
* Require a proof of suitable snprintf(3) implementation.Denis Ovsienko2023-02-162-159/+19
| | | | | | | | | | | My earlier commit fbd4415 did a wrong thing because it caused a failure to fail in "make check" on Solaris 9, whereas the right thing to do when printf() does not work as expected would be to fail the build with a useful error message. Implement that by testing snprintf() in Autoconf and CMake (assume that in a given libc implementation all functions in the printf() family have the same level of support for conversion specifications). Return 18 tests from the conditional space back into TESTLIST.
* RIPng: Print the protocol name when the version is invalidFrancois-Xavier Le Bail2023-02-161-1/+1
| | | | Update the output of a test accordingly.
* Fix spaces before tabs in indentationFrancois-Xavier Le Bail2023-02-151-3/+3
|
* arista: update test pcap with hwinfo valuesBill Fenner2023-01-044-12/+12
|
* PTP: use the proper values for the control fieldDavid Mirabito2023-01-023-177/+177
|
* TESTLIST: Update some comments (.sh -> .tests)Francois-Xavier Le Bail2022-12-191-5/+5
|
* bgp: Add support for BGP Role capabilty and OTC attributeDonatas Abraitis2022-12-083-0/+126
| | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* Rename the suffix of a pcapng test file to .pcapngFrancois-Xavier Le Bail2022-10-162-1/+1
|
* PTP: fix printing of the correction fieldsCharles (Chas) Williams2022-10-143-0/+4
| | | | | The nanosecond part of the correction field is 48 bits and the sub-nanosecond part is 16 bits.
* bgp: Add Origin Validation State extended communityDonatas Abraitis2022-10-073-0/+43
| | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* BGP: add dissector for BGPsec capability and pathColin Sames2022-10-033-0/+779
| | | | | | | BGPsec is specified in RFC8205. It adds a path attribute to BGP update messages and a capability to BGP open messages. tests: add pcap for BGPsec test
* ICMPv6: Fix the Node Information flagsNicholas Reilly2022-09-133-0/+6
| | | | | | | Don't use htons() when defining the constants because the flags field is already eventually swapped by fetching with GET_BE_U_2(). Remove unused flags NI_SUPTYPE_FLAG_COMPRESS and NI_FQDN_FLAG_VALIDTTL. Add a test file with various NI_NODEADDR_FLAG* flags.
* ICMPv6: Fix output for Router Renumbering messagesFrancois-Xavier Le Bail2022-09-114-0/+14
| | | | | | | | | | | In icmp6_rrenum_print() function. From: router renumberingrouter renum: command To: router renumbering, command Add a test file from the Wireshark menagerie (5691-icmpv6-RFC2894-RR.pcap).
* Rename the suffix of a pcapng test file to .pcapngFrancois-Xavier Le Bail2022-09-092-1/+1
|
* bgp: Handle ORF in Route-Refresh messagesDonatas Abraitis2022-09-073-0/+8
| | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* GeoNet: Update a test to use the current EthertypeFrancois-Xavier Le Bail2022-09-041-0/+0
| | | | | | From 0x0707 (ETHERTYPE_GEONET_OLD) to 0x8947 (ETHERTYPE_GEONET). (Use -e option to see the changes)
* GeoNet: Rename a test to specify the versionFrancois-Xavier Le Bail2022-09-043-1/+1
| | | | | | 'geonet_v0_and_calm_fast' for GeoNetworking version 0. [skip ci]
* Add support for Hard Reset notification and GR N flagBill Fenner2022-08-279-10/+49
| | | | | Add support for the Hard Reset notifications and the corresponding N flag in Graceful Restart capability advertisement, per RFC8538.
* Add support for BFD cease subcodeBill Fenner2022-08-223-0/+4
| | | | | Add the BFD cease notification subcode assigned by IANA. This value is an early assignment for an in-progress standard.
* IPv6: Add a Jumbogram test fileFrancois-Xavier Le Bail2022-08-133-0/+2
|
* juniper: don't treat known DLT_ types as "Unknown".Guy Harris2022-07-261-1/+1
| | | | | A bunch of DLT_JUNIPER_ values were not being handled in the "DLT_ specific parsing" switch statement; add (empty) cases for them.
* PPP: Add tests to avoid incorrectly re-entering ppp_hdlc()Francois-Xavier Le Bail2022-06-061-8/+1
|
* Arista: Refine the output format and print HwInfo.Denis Ovsienko2022-04-143-48/+48
| | | | | | | | | | | | | See pull request GH#955. Add a comment with the Timestamp packet diagram. Define ARISTA_SUBTYPE_TIMESTAMP as a two-byte integer, same as it is on the wire. Break the version field into three fields and add printing of HwInfo. Lose an unused variable and a few named constants. When carrying whole seconds over from nanoseconds, use a large enough type for seconds and do not forget to correct nanoseconds afterwards. Print all fields using tok2str() and DHCP-like format. Update the associated tests.
* Add pcap file to exercise corner cases for BGP shutdown message printerBill Fenner2022-04-053-0/+12
| | | | | | | | This pcap file contains 3 corner cases: 1. A packet with more data than the length provides for 2. A packet that has a shutdown message with zero data 3. A packet whose shutdown message length is longer than the remaining data in the notification
* Remove a trailing spaceFrancois-Xavier Le Bail2022-04-031-1/+1
|
* Geneve: update format_opt_classDror Eiger2022-04-033-0/+5
| | | | | Per https://www.iana.org/assignments/nvo3/nvo3.xhtml Also add test for GCP
* Have routines that set the snapend take a buffer pointer and length as args.Guy Harris2022-03-313-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Have nd_push_buffer() take a snapshot length, not a snapshot end, as its last argument. Replace nd_push_snapend() and nd_change_snapend() with nd_push_snaplen() and nd_change_snaplen(), both of which take a pointer into the packet buffer and snapshot length relative to that pointer as arguments. Have those routines check the snapshot length to make sure it's not bigger than the number of bytes in the packet past the pointer, and silently ignore the requst if it is. Using a length rather than a pointer avoids the possibility of the calculation of the snapshot end overflowing and resulting in a snapshot end *before* the point in the buffer. Add a test for this, with a capture file containing an IPv6 packet with an extremely large "jumbo" packet size. Revert the "Make sure we don't set the snapend before the beginning of the packet." changes, as they no longer apply with this change (which also makes sure we don't set the snapend before the beginning of the packet).
* Remove four test filesFrancois-Xavier Le Bail2022-03-3013-16/+0
| | | | | These pcap(ng) files were not tcpdump test files but libpcap test files. They are now in the libpcap tests directory.
* Kerberos: Print the protocol nameFrancois-Xavier Le Bail2022-03-253-100/+100
| | | | Update the output of three tests accordingly.
* Rename two pcapng test files to .pcapngFrancois-Xavier Le Bail2022-03-083-2/+2
|
* Revert "Clean a bunch of fuzzed files not to fuzz the container."Guy Harris2022-03-0476-0/+0
| | | | | | | This reverts commit a02c2faeec982d233a32b6db4df20ce817dd1563. That zeroed out bits in the non-reserved portion of the field; the reserved portion was already zero.
* Clean a bunch of fuzzed files not to fuzz the container.Guy Harris2022-03-0476-0/+0
| | | | | | | | | | For some reason pcap fuzzers just *love* to fuzz the "link-layer type plus other stuff" part of the pcap file header. That can produce a file that has non-zero values in reserved fields, which means it can get rejected well before being handed to anything for dissection. Clear out one of the reserved parts of that field, as we'll be changing libpcap to check for non-zero values and reporting an error.