| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Moreover:
Remove a now useless comment.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enable ND_LONGJMP_FROM_TCHECK. Lose a local variable, instead modify the
provided pointer and length in sync and always fetch one field at a time.
When the packet is declard too short, report it as invalid, not truncated
(it may turn out truncated soon thereafter though). Use a named constant.
When not decoding the packet completely (whether invalid or not), still
check that it is fully within the snapshot.
When decoding it completely, add checks at the beginng of the iteration
to test that both the TL and the V fit into the remaining part of the
declared packet. Move an ND_TCHECK_LEN() into the default case to let the
string printing functions guard the snapshot end. Do not declare the
remainder of the packet invalid on TLV type 0, as RFC 5171 Section 6
says: "If an implementation does not understand a Type value, it should
skip over it using the length field."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bittok2str_internal() used to match on a single walking 1, so a bitmap
token that had more than one bit set would never "match all" or "match
any". Replace the bit-walking loop with a single bitwise test, that's
faster and it provides "match all" for multiple-bit tokens if required.
Also a 0 token would always match a 0 value, which makes no sense in
bitmaps, so fix a 0 token to never match. Update the comment and fixup
some indentation.
This change had immediately chased a bug out of print-udld.c, where the
tokens were wrong in udld_flags_values[]. Fix that, list the MBZ bits and
rename the array for clarity. Update output for two tests.
In the course of this debugging it became clear that in print-aoe.c I got
both the tokens and the labels wrong in aoev1_aflag_str[]. Fix that,
rename the listed MBZ bits for brevity and rename the array for clarity.
Update output for one test.
|
|
|
|
|
|
|
| |
Remove a number of instances that do not match common patterns and have
the only substantial effect on the code flow that a truncated packet
triggers "goto trunc" instead of longjmp(). (In a few cases this change
can increase the number of fields printed before giving up.)
|
|
|
|
|
|
|
| |
The exceptions are currently:
Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer.
An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer
pointer.
|
|
|
|
|
|
|
| |
It prints " (invalid)", used for malformed or corrupted packets.
Moreover:
Update CONTRIBUTING.
|
| |
|
|
|
|
|
|
|
|
| |
Remove the tstr[] strings.
Update the output of some tests accordingly.
Moreover:
Add or update some ndo_protocol fields.
|
|
|
|
|
|
|
| |
The functions are: nd_print, nd_printztn, nd_printn and nd_printzp.
Trying to make it clearer that they currently have to be used only on part
of the packet buffer.
Update some comments.
|
| |
|
|
|
|
|
| |
Update this field in printer entry functions.
It will be used for some printings.
|
|
|
|
|
|
|
|
| |
This can prevent bizarre failures if, for example, you've done a
configuration in the top-level source directory, leaving behind one
config.h file, and then do an out-of-tree build in another directory,
with different configuration options. This way, we always pick up the
same config.h, in the build directory.
|
| |
|
| |
|
|
|
|
|
| |
ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l)
ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
|
|
|
|
|
|
| |
In ND_PRINT() macro call(s) (step 9).
*(p)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now all the macros have a name meaning a count in bytes.
With _S_: signed, _U_: unsigned
e.g.:
EXTRACT_BE_32BITS -> EXTRACT_BE_U_4
EXTRACT_LE_32BITS -> EXTRACT_LE_U_4
...
EXTRACT_BE_INT32 -> EXTRACT_BE_S_4
and have:
EXTRACT_8BITS -> EXTRACT_U_1
EXTRACT_INT8 -> EXTRACT_S_1
|
|
|
|
| |
In ND_PRINT() macro calls.
|
|
|
|
| |
In bittok2str() calls.
|
|
|
|
|
| |
It indicates clearly that these macros are used to extract big-endian
integral values.
|
|
|
|
|
|
|
| |
Moreover:
Remove some redundant comments
Update some summary comments
Update the specification URL for ATA over Ethernet (AoE) protocol
|
| |
|
|
|
|
|
|
| |
The bounds check is already done before by ND_TCHECK2(*tptr, len).
So we are deliberately ignoring the return value of fn_printn with last
argument NULL (no bounds check).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moreover:
Update reference from draft to RFC5171.
Add bounds and length checks.
Fix TLV length printout. It is the length of the type, length, and value
fields.
Filter out non-printable characters.
Print the Echo TLV with fn_printn(). Note: The format of this list of ID
pairs is not documented in the RFC.
Update the output of a test accordingly.
Add and use istr[] and tstr[] strings.
Comment on the TLV format.
Update some comments.
|
|
|
|
| |
Get the full log via: git log --follow netdissect-stdinc.h
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Update the already converted decoders to define the macro and to include
interface.h instead of netdissect.h. Fix incurred compile errors.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Make sure all of them are declared const and most of them -- static.
Proper declaration of token arrays is a common review point for new code
that is based on existing decoders. Thus fix the issue at its root.
|
|
add support for unidirectional link detection as per
http://www.ietf.org/internet-drafts/draft-foschiano-udld-02.txt
|