Commit Graph

5617 Commits

Author SHA1 Message Date
Francois-Xavier Le Bail
818169971c Add more nd_print_trunc() calls 2018-09-13 21:05:16 +02:00
Francois-Xavier Le Bail
c6a5cc1bb4 SLL: Remove two useless tests
Because packet length (length) >= capture length (caplen).

(see the sanity checks in print.c, pretty_print_packet() function)
2018-09-13 19:24:27 +02:00
Francois-Xavier Le Bail
8d316a9ae0 Fix style 2018-09-13 14:52:42 +02:00
Francois-Xavier Le Bail
8aa4617181 Ethernet: Remove two useless tests
Because packet length (len) >= capture length (caplen).

(see the sanity checks in print.c, pretty_print_packet() function)
2018-09-13 14:24:23 +02:00
Francois-Xavier Le Bail
b7fff70582 Ethernet: Remove two useless tests
Because packet length (length) >= capture length (caplen), when
caplen >= ETHER_HDRLEN, length >= caplen cannot be < ETHER_HDRLEN.

Same for the other test (length < 4).

(see the sanity checks in print.c, pretty_print_packet() function)

Moreover:
Clean up indentation.
2018-09-12 19:52:08 +02:00
Francois-Xavier Le Bail
77a49fcb6e Add the nd_print_invalid() function
It prints " (invalid)", used for malformed or corrupted packets.

Moreover:
Update CONTRIBUTING.
2018-09-11 13:09:05 +02:00
Francois-Xavier Le Bail
e2293be847 Make the invalid snaplen message clearer 2018-09-10 16:26:57 +02:00
Francois-Xavier Le Bail
d5ca317dbd More status exit codes for a program using libnetdissect
It can now use status exit codes 0 to 10.
2018-09-09 14:29:06 +02:00
Francois-Xavier Le Bail
0906b438b6 Update a comment with the new macros names 2018-09-09 13:57:25 +02:00
Francois-Xavier Le Bail
6a9b0468b6 Add the debug macro ND_DEBUG 2018-09-06 11:01:56 +02:00
Guy Harris
e0a88590e7 Don't assume ARM supports unaligned accesses.
Prior to ARMv6, it didn't support it.  ARMv6 supports it, if the "don't
act like ARMv5" bit isn't set in the system control register, but has
another bit in the system control register to cause unaligned accesses
to fault rather than succeed.  ARMv7 and later don't have "act like
ARMv5" mode, but still has the "fault on unaligned access" bit.

At least some OSes might set the "fault on unaligned access" bit; if
your OS *doesn't* set it, feel free to modify the #if to check for your
OS and for ARM.
2018-09-05 20:26:39 -07:00
Guy Harris
75953aee36 Clean up white space. 2018-09-05 12:51:24 -07:00
Guy Harris
37e60848a8 Fix test output files to match Juniper dissector changes. 2018-09-05 12:40:35 -07:00
Guy Harris
86c678c6cb Clean up indentation. 2018-09-05 12:05:35 -07:00
Guy Harris
6cc57670fe Remove trailing "_if" from protocol names.
"_if", in function names, is just a convention used for the top-level
routine for a given DLT_ value; it's not part of the protocol name for
the link-layer type.
2018-09-05 12:04:03 -07:00
Viral Mehta
8b9f7d9d76 add test for nfs write verf cookie
test results:
[vmehta@centos72_base tcpdump]# make check | grep nfs
    unaligned-nfs-1                    : passed
    nfs-attr-oobr                      : passed
    hoobr_nfs_printfh                  : passed
    hoobr_nfs_xid_map_enter            : passed
    nfs-seg-fault-1                    : passed
    nfs-write-verf-cookie              : passed <- new test
2018-09-05 10:55:08 +01:00
Viral Mehta
955e4a763b print verifier cookie for write and commit operation 2018-09-05 10:55:08 +01:00
Guy Harris
e12bc85871 Fix the fix. 2018-09-04 14:19:20 -07:00
Guy Harris
1060146448 Fix the no-SSL-library version of that test. 2018-09-04 14:10:24 -07:00
Guy Harris
2f85b72156 Fix tests for BGP changes. 2018-09-04 11:34:41 -07:00
Guy Harris
12f570c35c Fix dissection of RFC 4684 routing information.
RFC 4684, sadly, doesn't do a very good job of describing what a "route
target" is.  In practice, it appears to be a Route Target extended
community, as per RFC 4360 section 4 "Route Target Community".  Those do
*not* have the same format as an RFC 4364 Route Descriptor.

So just take the code to dissect an extended community, put it in a
subroutine, change it to directly print information rather than filling
in a static string buffer (C support for strings is spectacularly bad -
large variable-length objects are hard, let's go shopping!), and call
that routine when dissecting RFC 4684 routing information.
2018-09-04 11:09:41 -07:00
Francois-Xavier Le Bail
46efa1bc47 Fix spaces 2018-09-03 15:18:19 +02:00
Francois-Xavier Le Bail
72b94e239a Travis CI: Reduce git clone depth 2018-08-31 16:03:51 +02:00
Guy Harris
086b0ee14b Squelch a warning on some platforms.
Some platforms define the old V7 routine index() (renamed to strchr() in
System V; the latter name is what's used in ANSI C), and you get
"declaration of 'index' shadows a global declaration" warnings.

Call the variable if_index instead.
2018-08-30 23:42:53 -07:00
Denis Ovsienko
d7f8d95977 RADIUS: constify a couple static arrays
[skip ci]
2018-08-30 15:25:59 +01:00
Francois-Xavier Le Bail
f479513398 Fix spaces 2018-08-28 17:15:50 +02:00
Francois-Xavier Le Bail
7f1d172968 CONTRIBUTING: Update about bounds checking 2018-08-23 15:49:51 +02:00
Francois-Xavier Le Bail
180fae3dc2 Use more the nd_print_trunc() call
Update the output of some tests accordingly.
2018-08-20 16:37:08 +02:00
Denis Ovsienko
6bda3d1515 EAP: Fixup the check for Code value.
Code value 0 is not assigned, and the code block guarded by the if() is
specific to Request (1) and Response (2) only. This change prevents the
printer from decoding some invalid EAP messages as if they were valid.

[skip ci]
2018-08-18 19:00:36 +01:00
Denis Ovsienko
c5e03b4a0f RADIUS: Deduplicate some printing code. 2018-08-18 12:36:25 +01:00
Denis Ovsienko
ecc344f328 EAP: simplify an if()
[skip ci]
2018-08-17 08:54:15 +01:00
Francois-Xavier Le Bail
e031e72985 Travis CI: Create .devel for both autotools and CMake
That way, we do development builds for CMake as well, and get the
warnings turned up.
2018-08-14 23:00:39 +02:00
Francois-Xavier Le Bail
bd75f60b83 Travis CI: Fold the 'cmake' output
This change allows to see better the possible warnings.
2018-08-14 22:57:40 +02:00
Francois-Xavier Le Bail
23dd961b08 Travis CI: Fix folding the 'configure' output 2018-08-14 22:55:10 +02:00
Francois-Xavier Le Bail
6ba5c764b2 Travis CI: Simplify the script section 2018-08-14 22:52:02 +02:00
Francois-Xavier Le Bail
dc8ce203b3 NTP: Fix UTC/GMT timestamps printing according to RFC3339
Add the "Z" suffix for UTC.

According to the RFC3339:
      Z           A suffix which, when applied to a time, denotes a UTC
                  offset of 00:00; often spoken "Zulu" from the ICAO
                  phonetic alphabet representation of the letter "Z".

Update the output of some tests accordingly.
2018-08-14 14:12:56 +02:00
fxlb
7399fb8c8b Travis CI: Fix the openssl support in OSX build
A directory name has changed.

Add OSX_SSL_DIR variable to track it.
2018-08-11 14:32:23 +02:00
Francois-Xavier Le Bail
1d881d77df Report 32-bit timestamps with uppermost bit set as "Error converting time"
This is an update to packet header timestamps printing based on
Guy Harris's proposal.

Theses timestamps are outside the 1970-2038 range; This happens on some
fuzzed captures.

This will allow to have the same printing on Windows and UN*X.

Update needed before 2038.
2018-08-10 23:22:21 +02:00
Guy Harris
c6ca8a7171 Update.
-# is used to indicate which packets differ in how they're dissected,
not to ensure the reproducibility of the output.

We also set TZ to GMT0 to do all time-stamp printing in UTC.
2018-08-10 13:56:15 -07:00
Francois-Xavier Le Bail
e76125515c Update CONTRIBUTING and TESTLIST according to a recent change
It's a follow-up to 018b2b8c96.

Thanks to Gisle Vanem to spot one of the inconsistencies.

Moreover:
Remove a useless '-#' option in TESTLIST.
2018-08-09 20:56:54 +02:00
Francois-Xavier Le Bail
cc190c1b58 Refactor printing the time fractional part ({micro|nano}seconds)
Add the ts_frac_print() function.

Avoid almost duplicate code.
2018-08-09 14:14:25 +02:00
Francois-Xavier Le Bail
018b2b8c96 Use UTC/GMT time when building/checking tests files
This will avoid some differences when checking in different time zones.

We now run the tests without the '-t' option. This will allow to get
problems/changes in time printing functions.

Update the output of the tests accordingly.

Moreover:
Add the '-#' option to better identify a packet when there is a difference
in output.
2018-08-09 09:23:07 +02:00
Guy Harris
cf99f0bc83 Explicitly check to make sure the header length isn't too short. 2018-08-08 13:41:44 -07:00
Francois-Xavier Le Bail
009bd798b5 Add '-Wunreachable-code-return' warning option in devel mode for cmake 2018-08-07 23:46:16 +02:00
Francois-Xavier Le Bail
7920225334 Sort the tested compiler warning options for cmake 2018-08-07 23:36:44 +02:00
Francois-Xavier Le Bail
34b59a8011 Remove the no more used gmt2local() function 2018-08-07 20:27:46 +02:00
Francois-Xavier Le Bail
d77ac851c7 Fix local time printing
Using seconds offset from GMT to local time to compute local time give
errors when printing times outside the same daylight saving time period.

Use the localtime() function for default and -tttt cases.
Use the gmtime() function for -ttt and -ttttt cases.

Rename ts_hmsfrac_print() to ts_date_hmsfrac_print().
Remove some variables now useless.
Update some comments.
2018-08-07 17:37:36 +02:00
Denis Ovsienko
7df3ddfdcd RADIUS: Decode more MIP6-Feature-Vector bits.
Add more allocations from and a link to the Mobility Capability registry.
2018-08-06 14:59:08 +00:00
Francois-Xavier Le Bail
a8abce5c5e Fix spaces 2018-08-06 16:12:32 +02:00
Denis Ovsienko
2e5d3e43be Add a test for the RX/AFS protocol.
The .pcap file is from https://wiki.wireshark.org/SampleCaptures, as
suggested on the openafs-devel mailing list.
2018-08-03 22:12:28 +01:00