Commit Graph

31 Commits

Author SHA1 Message Date
Francois-Xavier Le Bail
99c91c3aec Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'
Get the full log via: git log --follow netdissect-stdinc.h
2015-09-10 08:50:40 +02:00
Francois-Xavier Le Bail
3fb4560e1e Rename cstr[] to istr[] like invalid string
Moreover:
Hamonise the output for error messages
Add istr[] in print-babel.c
2015-09-06 20:47:42 +02:00
Francois-Xavier Le Bail
7ea344d76a Use the word 'invalid' for 'malformed' or 'corrupted' packets
An invalid packet could be:
1) built malformed originally by the sender or a fuzz tester,
2) became corrupted in transit.
2015-09-06 13:44:54 +02:00
Francois-Xavier Le Bail
c1c3c77463 Printers must include 'netdissect.h', not 'interface.h' 2015-09-05 23:35:58 +02:00
Denis Ovsienko
4f54e9eadf Babel: address a couple compiler warnings
677:31: warning: variable ‘router_id’ set but not used
676:72: warning: variable ‘hopc’ set but not used
2015-08-13 21:40:49 +01:00
Matthieu Boutier
918a034032 Babel: add decoder for source-specific extension. 2015-08-13 21:25:38 +01:00
Denis Ovsienko
38700c7f24 dismiss NETDISSECT_REWORKED macro
The purpose of this macro was to enable the file-by-file switch to NDO,
after which only tcpdump.c had a use of it and the definitions guarded
by it. Update tcpdump.c not to require them any more and dismiss the
unused definitions.
2015-03-22 10:06:15 +00:00
Denis Ovsienko
60a835d80f clean K&R style up in function declarations a bit
The function body should have its opening brace on the next line.
2015-03-05 10:35:03 +00:00
Baptiste Jonglez
8bdce11109 Babel: parse sub-TLVs even when they are larger than expected.
We can imagine appending additional data to sub-TLVs in the future: be
more forgiving when parsing them.
2014-06-20 09:46:00 +09:00
Baptiste Jonglez
fb5522bee2 remove stale comment 2014-06-03 12:21:22 +04:00
Denis Ovsienko
3b4c7e32e5 Babel: rewrite w/o print buffer rotation 2014-06-02 15:19:09 +04:00
Baptiste Jonglez
633441a08a Add a decoder for the babel-rtt extension
Also add a simple testcase.
2014-06-01 17:29:31 +09:00
Guy Harris
ed85e20e4d u_intN_t is dead, long live uintN_t.
And, as we require at least autoconf 2.61, and as autoconf 2.61 and
later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to
define the uintN_t and intN_t macros if the system doesn't define them
for us.

This lets us get rid of bitypes.h as well.
2014-04-23 00:20:40 -07:00
Guy Harris
1cde6435df Netdissectify the to-name resolution routines.
Have them take a netdissect_options * argument, and get the "no name
resolution" flag from it.

Move the declaration of dnaddr_string to addrtoname.h, along with the
other XXX-to-string routines.
2014-04-04 00:43:46 -07:00
Denis Ovsienko
0d28726d0a NDOize Babel decoder 2014-04-03 12:33:53 +04:00
Matthieu Boutier
c454410750 print-babel: don't parse two times the same field. 2014-03-24 16:25:49 +04:00
Baptiste Jonglez
1fc130d880 Fix commit 833425ab: babel uses 1/100th of seconds, not 1/10th
Also update affected testcases.
2014-03-05 13:19:58 +01:00
Denis Ovsienko
d8acd8f5d0 make consistent use of the "tstr" idiom
For each decoder that has more than one instance of truncation signaling
and prints the same string in each instance make sure that the string is
declared as "static const char tstr[]" right after the initial includes
block. Where necessary, replace fputs(s, stdout) with equivalent
printf("%s", s).
2013-12-26 18:19:50 +04:00
Denis Ovsienko
833425ab80 Babel: improve printing of time intervals
All Babel intervals are encoded in centiseconds and must not be 0. In an
Update TLV the interval value 0xFFFF means infinity (RFC6126 Section
4.4.9). Update the test cases.
2013-10-18 09:24:37 +04:00
Denis Ovsienko
39c95ea6e9 Babel: sub-TLV 2 is Diversity, not ChanInfo 2013-08-28 19:55:00 +04:00
Guy Harris
620fd514f5 Squelch a signed vs. unsigned comparison warning.
(At that point, we've already checked whether rc is < 0, so we know it's
not.)
2013-06-22 15:02:42 -07:00
Denis Ovsienko
cac189b9e3 initial support for Babel sub-TLVs decoding
Babel sub-TLVs are a work in progress, a backward-compatible extension
to Babel version 2 protocol encoding. This update implements encoding
explained by Juliusz Chroboczek to decode ChanInfo sub-TLV of the Update
TLV.
2013-05-29 13:03:23 +04:00
Denis Ovsienko
d0b48b5108 fix iteration over Babel Pad1 TLVs
The Pad1 TLV consists only of the Type field (RFC6126 Section 4.4.1),
thus the check for Pad1 type must be done before the Length field is
consumed, if ever. This change brings tcpdump decoder into line with the
spec and Babel implementation's own TLV iterator.
2013-05-29 13:03:23 +04:00
Guy Harris
a9845baa3d If we don't have IPv6 address support, don't try to print IPv6 addresses. 2012-12-24 03:13:23 -08:00
Denis Ovsienko
91830ddd6c update for current Babel auth spec
This change updates Babel decoder output format to match terminology of
draft-ovsienko-babel-hmac-authentication-00 and reverts recent addition
of DLen field to TLV type 12.
2012-08-21 18:36:56 +04:00
Denis Ovsienko
13223554b8 update Babel decoder for DLen in HD TLV
This change reflects a new Digest Length field added to Hash Digest TLV
in the current draft of Babel authentication spec. babel_print_v2() is
updated to fetch and validate the new field. Test files too.
2012-06-29 22:29:04 +04:00
Denis Ovsienko
4279f79e8e fix Babel type 11 TLV length check
RFC6126 4.3. TLV Format: "If the body is longer than the expected length
of a given type of TLV, any extra data MUST be silently ignored."
2012-06-13 13:06:32 +04:00
Guy Harris
185abcdbbd Fix an error and a warning.
Use a separate variable to index through the hash digest, not the
variable used to index through the packet.

Make some variables holding one-byte quantities u_int rather than u_char
while we're at it - not much use in *requiring* them to fit into 8 bits
(the code might be better if we don't, and that eliminates a warning).
2012-06-07 22:24:04 -07:00
Denis Ovsienko
78a8be4700 add decoding of Babel authentication TLVs
This change extends existing Babel protocol decoder to recognise
experimental authentication TLVs (types 11 and 12) and includes
a respective test case for the new code.
2012-06-06 17:57:20 +04:00
Guy Harris
938becee00 Add length checks, use EXTRACT_16BITS().
Use EXTRACT_16BITS() rather than a hand-rolled macro to extract
big-endian 16-bit quantities from the packet.

When processing the message, check against the body length *and* the UDP
payload length, as well as against the raw frame length.
2011-12-18 16:05:05 -08:00
Juliusz Chroboczek
12b169509d Add printer for the Babel routing protocol (RFC 6126).
This version includes a couple of fixes from Wireshark.
2011-04-27 15:27:20 -04:00