forked from osmocom/wireshark
0662a3f6ac
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 ``` |
||
---|---|---|
.. | ||
.editorconfig | ||
CMakeLists.txt | ||
dfilter-int.h | ||
dfilter-macro.c | ||
dfilter-macro.h | ||
dfilter.c | ||
dfilter.h | ||
dfunctions.c | ||
dfunctions.h | ||
dfvm.c | ||
dfvm.h | ||
drange.c | ||
drange.h | ||
gencode.c | ||
gencode.h | ||
grammar.lemon | ||
scanner.l | ||
semcheck.c | ||
semcheck.h | ||
sttype-field.c | ||
sttype-field.h | ||
sttype-function.c | ||
sttype-function.h | ||
sttype-op.c | ||
sttype-op.h | ||
sttype-pointer.c | ||
sttype-pointer.h | ||
sttype-set.c | ||
sttype-set.h | ||
sttype-slice.c | ||
sttype-slice.h | ||
sttype-string.c | ||
syntax-tree.c | ||
syntax-tree.h |