From 73b943276e5d3abd21d14a3819df092abd959650 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Fri, 7 Jul 2023 10:34:08 -0400 Subject: [PATCH] doc/byte_test: Document byte_test variable usage Issue: 6144 This commit updates the byte_test documentation now that a variable name can be used for the nbytes value. --- doc/userguide/rules/differences-from-snort.rst | 7 +++++++ doc/userguide/rules/payload-keywords.rst | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/userguide/rules/differences-from-snort.rst b/doc/userguide/rules/differences-from-snort.rst index db56912568..56da32dc84 100644 --- a/doc/userguide/rules/differences-from-snort.rst +++ b/doc/userguide/rules/differences-from-snort.rst @@ -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 -------------------- diff --git a/doc/userguide/rules/payload-keywords.rst b/doc/userguide/rules/payload-keywords.rst index f55d9958a6..0622114c8f 100644 --- a/doc/userguide/rules/payload-keywords.rst +++ b/doc/userguide/rules/payload-keywords.rst @@ -368,13 +368,14 @@ and the final result will be right shifted one bit for each trailing ``0`` in the ````. Format:: - - byte_test:, [!], , [,relative] \ - [,][, string, ][, dce][, bitmask ]; + + byte_test: | , [!], , [,relative] \ + [,][, string, ][, dce][, bitmask ]; +----------------+------------------------------------------------------------------------------+ | | The number of bytes selected from the packet to be converted | +| | or the name of a byte_extract/byte_math variable. | +----------------+------------------------------------------------------------------------------+ | | | | | - [!] Negation can prefix other operators |