]> The Tcpdump Group git mirrors - tcpdump/commitdiff
CONTRIBUTING: remove redundant information, add additional information. [skip ci]
authorGuy Harris <[email protected]>
Wed, 9 Aug 2023 06:59:04 +0000 (23:59 -0700)
committerGuy Harris <[email protected]>
Wed, 9 Aug 2023 06:59:04 +0000 (23:59 -0700)
Remove a paragraph left over from the process of editing.

Indicate what the individual ND_TCHECK_*() macros do, and indicate that
*n*, in the GET_*_n() macros, is the length of the item to be fetched,
in bytes.

CONTRIBUTING.md

index 1932109160bf6c03196a6134fe7c936a6ea6d12c..5b9df8c9c17a6b6e11949ddcdfde2d0dafa0c046 100644 (file)
@@ -167,12 +167,6 @@ and ask!
    This means that an attempt to fetch packet data based on the expected
    format of the packet may run the risk of overrunning the buffer.
 
-   This is because the printer may receive incomplete packet in the
-   buffer, truncated at any random position, for example by capturing
-   with `-s size` option, so any attempt to fetch packet data based on
-   the expected format of the packet may run the risk of overrunning the
-   buffer.
-
    Furthermore, if the packet is complete, but is not correctly formed,
    that can also cause a printer to overrun the buffer, as it will be
    fetching packet data based on the expected format of the packet.
@@ -192,6 +186,13 @@ and ask!
    ND_TCHECK_SIZE(p)
    ND_TCHECK_LEN(p, l)
    ```
+
+   where *p* points to the data not being decoded.  For `ND_CHECK_n()`,
+   *n* is the length of the gap, in bytes.  For `ND_CHECK_SIZE()`, the
+   length of the gap, in bytes, is the size of an item of the data type
+   to which *p* points.  For `ND_CHECK_LEN()`, *l* is the length of the
+   gap, in bytes.
+
    For the `GET_*()` and `ND_TCHECK_*` macros (if not already done):
    * Assign: `ndo->ndo_protocol = "protocol";`
    * Define: `ND_LONGJMP_FROM_TCHECK` before including `netdissect.h`
@@ -221,7 +222,8 @@ and ask!
    `U` indicates that an unsigned value is fetched; `S` indicates that a
    signed value is fetched.  For multi-byte values, `BE` indicates that
    a big-endian value ("network byte order") is fetched, and `LE`
-   indicates that a little-endian value is fetched.
+   indicates that a little-endian value is fetched. *n* is the length,
+   in bytes, of the multi-byte integral value to be fetched.
 
    In addition to the bounds checking the `GET_*()` macros perform,
    using those macros has other advantages: