diff options
author | João Valverde <j@v6e.pt> | 2022-07-15 00:08:20 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2022-07-15 00:11:38 +0100 |
commit | 7bea636cd4d160752537e2939e949aa5ea58a42d (patch) | |
tree | 503e8a1f3223f59b8969c9357694ad6cb3f57514 /docbook | |
parent | 97ce9845c320c50fa9036d2e4dedd3ee220524dc (diff) |
WSUG: Add display filter arithmetic operators
Diffstat (limited to 'docbook')
-rw-r--r-- | docbook/wsug_src/WSUG_chapter_work.adoc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/docbook/wsug_src/WSUG_chapter_work.adoc b/docbook/wsug_src/WSUG_chapter_work.adoc index cc01b6b79b..cca4af80ae 100644 --- a/docbook/wsug_src/WSUG_chapter_work.adoc +++ b/docbook/wsug_src/WSUG_chapter_work.adoc @@ -562,7 +562,6 @@ English and C-like operators are interchangeable and can be mixed within a filte | le | | \<= | Less than or equal to | `frame.len \<= 0x20` | contains | | | Protocol, field or slice contains a value | `sip.To contains "a1762"` | matches | | ~ | Protocol or text field matches a Perl-compatible regular expression| `http.host matches "acme\\.(org\|com\|net)"` -| bitwise_and | | & | Bitwise AND is non-zero | `tcp.flags & 0x02` |=== @@ -803,6 +802,29 @@ ip.addr in {10.0.0.5 .. 10.0.0.9, 192.168.1.1..192.168.1.9} frame.time_delta in {10 .. 10.5} ---- +==== Arithmetic operators + +You can perform the arithmetic operations on numeric fields shown in <<ArithmeticOps>> + +[#ArithmeticOps] + +.Display Filter Arithmetic Operations +[options="header",cols="1,1,4"] +|=== +|Name |Syntax | Description +|Unary minus |-A | Negation of A +|Addition |A + B | Add B to A +|Subtraction |A - B | Subtract B from A +|Multiplication |A * B | Multiply A times B +|Division |A / B | Divide A by B +|Modulo |A % B | Remainder of A divided by B +|Bitwise AND |A & B | Bitwise AND of A and B +|=== + +Arithmetic expressions can be grouped using curly braces. + +//TODO: Add example. + ==== Functions The display filter language has a number of functions to convert fields, see |