wireshark/epan/dfilter
João Valverde 0662a3f6ac dfilter: Amend a numeric pattern in the scanner
We amend the :<numeric> pattern to not eat the leading
colon. Because the colon can be part of the value (with IPv6 addresses
for example) we want to avoid doing that.

IPv6 addresses are covered by their own rules but this removes the
requirement in the future to handle any special cases and avoids
surprises.

For this reason the colon-prefix syntax is already explicitly defined to
work only for byte arrays and there is currently no universal
syntax for all literal values or even all numbers.

Other numbers can keep using the lexical type "unparsed".

```
run/dftest "_ws.ftypes.uint8 == :fd"
Filter: _ws.ftypes.uint8 == :fd
dftest: ":fd" is not a valid number.
	_ws.ftypes.uint8 == :fd
	                    ^~~

run/dftest "_ws.ftypes.uint8 == fd"
Filter: _ws.ftypes.uint8 == fd
dftest: "fd" is not a valid number.
	_ws.ftypes.uint8 == fd
	                    ^~

run/dftest "_ws.ftypes.uint8 == 0xfd"
Filter: _ws.ftypes.uint8 == 0xfd

Syntax tree:
 0 TEST_ANY_EQ:
   1 FIELD(_ws.ftypes.uint8 <FT_UINT8>)
   1 FVALUE(253 <FT_UINT8>)

Instructions:
00000 READ_TREE		_ws.ftypes.uint8 <FT_UINT8> -> reg#0
00001 IF_FALSE_GOTO	3
00002 ANY_EQ		reg#0 == 253 <FT_UINT8>
00003 RETURN

run/dftest "_ws.ftypes.bytes == fd"
Filter: _ws.ftypes.bytes == fd

Syntax tree:
 0 TEST_ANY_EQ:
   1 FIELD(_ws.ftypes.bytes <FT_BYTES>)
   1 FVALUE(fd <FT_BYTES>)

Instructions:
00000 READ_TREE		_ws.ftypes.bytes <FT_BYTES> -> reg#0
00001 IF_FALSE_GOTO	3
00002 ANY_EQ		reg#0 == fd <FT_BYTES>
00003 RETURN

run/dftest "_ws.ftypes.bytes == :fd"
Filter: _ws.ftypes.bytes == :fd

Syntax tree:
 0 TEST_ANY_EQ:
   1 FIELD(_ws.ftypes.bytes <FT_BYTES>)
   1 FVALUE(fd <FT_BYTES>)

Instructions:
00000 READ_TREE		_ws.ftypes.bytes <FT_BYTES> -> reg#0
00001 IF_FALSE_GOTO	3
00002 ANY_EQ		reg#0 == fd <FT_BYTES>
00003 RETURN
```
2022-10-08 09:51:49 +00:00
..
.editorconfig dfilter: Fix EditorConfig settings 2022-03-21 17:49:12 +00:00
CMakeLists.txt dfilter: Rename test syntax tree node 2022-07-02 11:39:17 +01:00
dfilter-int.h dfilter: Remove unparsed syntax type and RHS literal bias 2022-07-02 11:18:20 +01:00
dfilter-macro.c dfilter: Add layer support for references 2022-06-25 14:57:40 +01:00
dfilter-macro.h dfilter: Refactor macro tree references 2022-03-29 12:36:31 +00:00
dfilter.c dfilter: Remove unparsed syntax type and RHS literal bias 2022-07-02 11:18:20 +01:00
dfilter.h Try to fix a narrowing warning 2022-04-11 22:23:13 +01:00
dfunctions.c dfilter: Fix a crash using abs() 2022-07-19 19:11:47 +01:00
dfunctions.h dfilter: Allow arithmetic expressions as function arguments 2022-04-18 17:10:31 +01:00
dfvm.c dvfm: Fix -Wmissing-prototypes 2022-07-15 13:45:52 +00:00
dfvm.h dfilter: Small optimization for "not all zero" code 2022-07-05 09:58:43 +01:00
drange.c dfilter: Add layer support for references 2022-06-25 14:57:40 +01:00
drange.h dfilter: Add layer support for references 2022-06-25 14:57:40 +01:00
gencode.c dfilter: Small optimization for "not all zero" code 2022-07-05 09:58:43 +01:00
gencode.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
grammar.lemon dfilter: Rename test syntax tree node 2022-07-02 11:39:17 +01:00
scanner.l dfilter: Amend a numeric pattern in the scanner 2022-10-08 09:51:49 +00:00
semcheck.c dfilter: Fix crash with FT_NONE and arithmetic expressions 2022-07-28 16:50:09 +00:00
semcheck.h dfilter: Allow arithmetic expressions as function arguments 2022-04-18 17:10:31 +01:00
sttype-field.c dfilter: Add layer support for references 2022-06-25 14:57:40 +01:00
sttype-field.h dfilter: Add layer support for references 2022-06-25 14:57:40 +01:00
sttype-function.c dfilter: Allow arithmetic expressions as function arguments 2022-04-18 17:10:31 +01:00
sttype-function.h dfilter: Allow arithmetic expressions as function arguments 2022-04-18 17:10:31 +01:00
sttype-op.c dfilter: Fix some debug strings 2022-07-02 21:21:12 +01:00
sttype-op.h dfilter: Rename test syntax tree node 2022-07-02 11:39:17 +01:00
sttype-pointer.c dfilter: Remove STTYPE_RANGE_NODE 2022-06-25 16:06:48 +01:00
sttype-pointer.h dfilter: Add max() and min() functions 2022-04-14 13:07:41 +00:00
sttype-set.c Remove some unnecessary casts. 2021-10-27 10:24:20 +01:00
sttype-set.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
sttype-slice.c dfilter: Add layer support for references 2022-06-25 14:57:40 +01:00
sttype-slice.h dfilter: Add layer support for references 2022-06-25 14:57:40 +01:00
sttype-string.c dfilter: Remove unparsed syntax type and RHS literal bias 2022-07-02 11:18:20 +01:00
syntax-tree.c dfilter: Rename test syntax tree node 2022-07-02 11:39:17 +01:00
syntax-tree.h dfilter: Rename test syntax tree node 2022-07-02 11:39:17 +01:00