wireshark/test/suite_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
..
__init__.py
dfiltertest.py spelling: "two pass" -> two-pass 2022-08-22 10:20:29 +00:00
group_bytes_ether.py test: convert suite_dfilter to use fixtures 2018-11-15 22:57:40 +00:00
group_bytes_ipv6.py dfilter: Add more IPv6 tests 2022-04-06 18:09:12 +01:00
group_bytes_type.py test: convert suite_dfilter to use fixtures 2018-11-15 22:57:40 +00:00
group_double.py test: Add dfilter 'double' tests 2022-07-26 10:32:16 +00:00
group_function.py dfilter: Add abs() function 2022-04-18 17:09:00 +01:00
group_integer.py dfilter: Add support for binary literal constants 2022-02-23 22:27:59 +00:00
group_integer_1byte.py test: convert suite_dfilter to use fixtures 2018-11-15 22:57:40 +00:00
group_ipv4.py test: convert suite_dfilter to use fixtures 2018-11-15 22:57:40 +00:00
group_membership.py dfilter: Add support for literal strings with null bytes 2022-06-21 15:10:08 +00:00
group_scanner.py dfilter: Reject invalid character escape sequences 2021-11-23 16:48:02 +00:00
group_slice.py dfilter: Allow existence check for slices 2022-07-04 22:45:14 +00:00
group_string_type.py dfilter: Clean up function parameters semantic check 2021-11-10 02:12:06 +00:00
group_stringz.py test: convert suite_dfilter to use fixtures 2018-11-15 22:57:40 +00:00
group_syntax.py dfilter: Amend a numeric pattern in the scanner 2022-10-08 09:51:49 +00:00
group_time_relative.py test: convert suite_dfilter to use fixtures 2018-11-15 22:57:40 +00:00
group_time_type.py dfilter: Add support for entering time in UTC 2021-12-30 17:53:09 +00:00
group_tvb.py tests: Remove tests for non-existent functionality 2021-12-08 07:02:27 +00:00
group_uint64.py test: convert suite_dfilter to use fixtures 2018-11-15 22:57:40 +00:00