Commit Graph

4955 Commits

Author SHA1 Message Date
Guy Harris
fe225c5518 Use nd_ types, add host-endian extract routines, clean up signed vs. unsigned.
We now define the structures for Linux USB headers in print-usb.c, so it
doesn't need to include <pcap/usb.h>; don't check for it.
2018-01-11 11:10:21 -08:00
Guy Harris
741edd63b9 Clean up signed vs. unsigned, add more length checks. 2018-01-11 10:58:54 -08:00
Guy Harris
cbe647350e Fix VoIP VLAN request/assignment, clean up signed vs. unsigned.
0x000f is a query for a VoIP VLAN ID, 0x000e is the reply for that.
0x0010 is a power consumption message.

Display 2-byte VoIP VLAN queries.  Treat 2-byte VoIP VLAN replies as
errors; I've seen the former but not the latter.

Don't use unsigned long for values that fit in an unsigned int.
2018-01-10 13:18:47 -08:00
Francois-Xavier Le Bail
0ce779d175 SUNRPC: Remove an unused structure 2018-01-09 16:34:17 +01:00
Francois-Xavier Le Bail
56d8c43b67 Telnet: Use more the EXTRACT_U_1() macro 2018-01-09 14:53:27 +01:00
Francois-Xavier Le Bail
a27bad5370 Fix indentation 2018-01-09 12:15:30 +01:00
Guy Harris
3bc62cd35f Use pcapng as the name of the file format.
At one point, I remember a discussion resulting in the official name of
the next-generation replacement for pcap format being changed to
"pcapng", with no hyphen.

Make tcpdump reflect that.

While we're at it, uppdate to use "macOS" as the name of Apple's
UNIX-for-Macs, as appropriate (don't use it for versions that were still
called Mac OS X or OS X).
2018-01-08 18:50:06 -08:00
Francois-Xavier Le Bail
447060b9fb TCP: Use more ND_TTEST_n() macros 2018-01-08 23:14:56 +01:00
Francois-Xavier Le Bail
245fa19308 RT6: Use more ND_TCHECK_n() macros, add missing bounds checks 2018-01-08 23:09:12 +01:00
Francois-Xavier Le Bail
9eca8c4ed2 Remove unneeded '&' when getting a pointer to an nd_uintN_t type 2018-01-08 19:59:56 +01:00
Francois-Xavier Le Bail
83046fe183 Remove unneeded '&' when getting a pointer to an nd_uintN_t type 2018-01-08 18:40:34 +01:00
Francois-Xavier Le Bail
efe7986983 Remove unneeded '&' when getting a pointer to an nd_uintN_t type
They are arrays.
2018-01-08 16:45:59 +01:00
Francois-Xavier Le Bail
d32eeddb46 ForCES: Remove never used macros 2018-01-08 16:13:25 +01:00
Francois-Xavier Le Bail
e8ff00c320 ICMP: Use more ND_TCHECK_n() macros 2018-01-08 10:17:48 +01:00
Francois-Xavier Le Bail
3ff2b7e8da IP6OPTS: Use more ND_TCHECK_n() macros 2018-01-07 23:46:14 +01:00
Francois-Xavier Le Bail
b3158f9a05 IP: Remove space printing at end of line
Update the output of some tests accordingly.
2018-01-07 23:38:16 +01:00
Francois-Xavier Le Bail
e133c5e197 IP: Use more ND_TCHECK_n() macros 2018-01-07 23:30:37 +01:00
Francois-Xavier Le Bail
ff5693a975 TIPC: Use more ND_TCHECK_n() macros 2018-01-07 21:56:32 +01:00
Francois-Xavier Le Bail
192f726d2a STP: Use more ND_TCHECK_n() macros 2018-01-07 21:51:55 +01:00
Francois-Xavier Le Bail
57b0a999a9 RIPng: Use more ND_TCHECK_n() macros 2018-01-07 21:45:31 +01:00
Francois-Xavier Le Bail
e9e7578870 PIM: Use more ND_TCHECK_n() macros 2018-01-07 21:41:06 +01:00
Francois-Xavier Le Bail
b079a3fa93 NTP: Use more ND_TCHECK_n() macros 2018-01-07 21:25:49 +01:00
Francois-Xavier Le Bail
763aa0b5f1 IPv6 mobility: Use more ND_TTEST_n() macros 2018-01-07 21:20:23 +01:00
Francois-Xavier Le Bail
494c29329f IPX: Use more ND_TCHECK_n() macros 2018-01-07 21:11:43 +01:00
Francois-Xavier Le Bail
c6965fc296 HSRP: Use more ND_TCHECK_n() macros 2018-01-07 21:08:07 +01:00
Francois-Xavier Le Bail
6475b3c8f0 BOOTP: Use more ND_TCHECK_n() macros 2018-01-07 21:01:13 +01:00
Francois-Xavier Le Bail
e2982e7f6f Update ND_PRINT() as a variadic macro 2018-01-07 13:36:41 +01:00
Guy Harris
8ab5c3a4e7 C99 - ask for it by name!
Use AC_PROG_CC_C99, to try to get the appropriate flags to make C99 the
C version for which we compile.  (XXX - should we fail if we don't get
support for C99?)
2018-01-07 01:12:52 -08:00
Guy Harris
39a7d38ee8 Clean up signed vs. unsigned.
Use unsigned for lengths.  Add additional length checks, as we can no
longer cheat and rely on "underflow turns the length negative, so just
check for > 0".

Show most NBT and SMB numerical fields as unsigned, as that's what they
are.  Have "d" and "D" treat the value as signed; add "u" and "U" for
unsigned values.
2018-01-06 22:18:00 -08:00
Francois-Xavier Le Bail
4c09b9584b PPP: Add a missing semicolon 2018-01-06 22:47:34 +01:00
Francois-Xavier Le Bail
9c1556ca28 BOOTP: Fix parentheses errors
These errors were not previously detected because of the use of
the single argument, double parentheses ND_PRINT() macro.
2018-01-06 22:26:06 +01:00
Francois-Xavier Le Bail
f5eb55fa6d BOOTP: Move macro define/undef outsite functions
This avoid some Coccinelle warnings:
CPP-DEFINE: inside function, I treat it as comment
CPP-UNDEF: inside function, I treat it as comment

This also makes the code a bit clearer.
2018-01-04 17:20:19 +01:00
Francois-Xavier Le Bail
ff1c209392 Fix some Coccinelle warnings "a \ character appears outside of a #define" 2018-01-04 13:26:39 +01:00
Francois-Xavier Le Bail
4a28df231d Use ND_TTEST_SIZE()/ND_TCHECK_SIZE() macros (2/n) 2018-01-03 22:23:30 +01:00
Francois-Xavier Le Bail
d526e47658 Use ND_TTEST_SIZE()/ND_TCHECK_SIZE() macros (1/n) 2018-01-03 21:32:07 +01:00
Francois-Xavier Le Bail
6e8e14d7fa Add ND_TTEST_SIZE() and ND_TCHECK_SIZE() macros
To replace in next steps:
ND_TTEST(var) -> ND_TTEST_SIZE(p)
ND_TCHECK(var) -> ND_TCHECK_SIZE(p)

Moreover:
Add a comment
2018-01-03 21:06:54 +01:00
Francois-Xavier Le Bail
1ac29c4be4 Use 'u_char *' type for input buffer pointer like in most similar cases 2018-01-03 13:47:25 +01:00
Francois-Xavier Le Bail
f9da547426 IPNET: Use nd_ types, add EXTRACT_ calls, tstr[] and bounds checks 2018-01-02 21:11:16 +01:00
Francois-Xavier Le Bail
b3171b9a9f Use 'u_char *' type for input buffer pointer like in most similar cases 2018-01-02 19:21:03 +01:00
Francois-Xavier Le Bail
b01a3f26ef Use 'u_char *' type for input buffer pointer like in most similar cases 2018-01-02 19:08:01 +01:00
Francois-Xavier Le Bail
8382e04eec DNS: Coding style update 2018-01-02 16:57:13 +01:00
Francois-Xavier Le Bail
c6a0c10533 Use more the ND_TCHECK_1() macro 2018-01-02 16:17:21 +01:00
Guy Harris
1eae026e55 Use nd_ types, add EXTRACT_ calls, clean up signed vs. unsigned. 2017-12-31 11:12:12 -08:00
Guy Harris
1755cb3e65 Split typesource into type and source fields.
This makes the dissection a bit clearer, and makes the dissecction of
extended and non-extended structures more similar.
2017-12-31 02:04:12 -08:00
Guy Harris
1e6066151a Get rid of collision between type name and variable name. 2017-12-31 01:51:26 -08:00
Guy Harris
57ad83491a Don't treat going past the end of the buffer in check_add_path() as an error.
It's just a heuristic test to try to guess whether the NLRI information
has path IDs or not.  If we run past the end of the packet data, just
stop processing before we try to fetch data past the end, don't return
an error.

This keeps us from showing truncation in non-truncated packets.

Update tests to reflect that change.
2017-12-31 01:49:47 -08:00
Guy Harris
b0ed96d8b4 Use nd_ types, add EXTRACT_ calls, clean up signs vs. unsigned. 2017-12-30 18:48:36 -08:00
Guy Harris
5045cf5cb8 Use nd_ types, add EXTRACT_ calls. 2017-12-30 18:47:08 -08:00
Guy Harris
42be9a39fb Use nd_ types, add EXTRACT_ calls. 2017-12-30 18:44:32 -08:00
Guy Harris
d1b18d5ad1 Use nd_ types. 2017-12-30 18:42:03 -08:00