wireshark/epan/ftypes
João Valverde ac0a69636b dfilter: Add support for unary arithmetic
This change implements a unary minus operator.

Filter: tcp.window_size_scalefactor == -tcp.dstport

Instructions:
00000 READ_TREE		tcp.window_size_scalefactor -> reg#0
00001 IF_FALSE_GOTO	6
00002 READ_TREE		tcp.dstport -> reg#1
00003 IF_FALSE_GOTO	6
00004 MK_MINUS		-reg#1 -> reg#2
00005 ANY_EQ		reg#0 == reg#2
00006 RETURN

It is supported for integer types, floats and relative time values.
The unsigned integer types are promoted to a 32 bit signed integer.

Unary plus is implemented as a no-op. The plus sign is simply ignored.

Constant arithmetic expressions are computed during compilation.

Overflow with constants is a compile time error. Overflow with
variables is a run time error and silently ignored. Only a debug
message will be printed to the console.

Related to #15504.
2022-03-28 11:20:41 +00:00
..
.editorconfig Fix EditorConfig settings 2022-02-23 23:37:47 +00:00
CMakeLists.txt Move regex code to wsutil 2021-11-14 21:00:59 +00:00
ftype-bytes.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftype-double.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftype-guid.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftype-ieee-11073-float.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftype-integer.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftype-ipv4.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftype-ipv6.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftype-none.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftype-protocol.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftype-string.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftype-time.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftypes-int.h dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftypes.c dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00
ftypes.h dfilter: Add support for unary arithmetic 2022-03-28 11:20:41 +00:00