Skip to content

Commit

Permalink
doc/byte_test: Document byte_test variable usage
Browse files Browse the repository at this point in the history
Issue: 6144

This commit updates the byte_test documentation now that a variable name
can be used for the nbytes value.
  • Loading branch information
jlucovsky committed Jul 8, 2023
1 parent 3dea471 commit 9968182
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions doc/userguide/rules/differences-from-snort.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,13 @@ See :doc:`http-keywords` for all HTTP keywords.

- Suricata will never match if there's a zero divisor. Division by 0 is undefined.

``byte_test`` Keyword
---------------------

- Suricata allows a variable name from ``byte_extract`` or ``byte_math``
to be specified for the ``nbytes`` value. The value of ``nbytes`` must adhere
to the same constraints as though a value was directly supplied by the rule.


``isdataat`` Keyword
--------------------
Expand Down
7 changes: 4 additions & 3 deletions doc/userguide/rules/payload-keywords.rst
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,14 @@ and the final result will be right shifted one bit for each trailing ``0`` in
the ``<bitmask value>``.

Format::
byte_test:<num of bytes>, [!]<operator>, <test value>, <offset> [,relative] \
[,<endian>][, string, <num type>][, dce][, bitmask <bitmask value>];

byte_test:<num of bytes> | <ariable_name>, [!]<operator>, <test value>, <offset> [,relative] \
[,<endian>][, string, <num type>][, dce][, bitmask <bitmask value>];


+----------------+------------------------------------------------------------------------------+
| <num of bytes> | The number of bytes selected from the packet to be converted |
| | or the name of a byte_extract/byte_math variable. |
+----------------+------------------------------------------------------------------------------+
| <operator> | |
| | - [!] Negation can prefix other operators |
Expand Down

0 comments on commit 9968182

Please sign in to comment.