wireshark/epan/dfilter
João Valverde 8746eea297 dfilter: Try to resolve field reference instead of using a heuristic
Instead of using a heuristic to decide whether the form ${...} is
a macro or not, try to resolve the name to a registered protocol
field and use that instead.

This increases somewhat the surface for clobbering existing macro
names with new field registrations but we'll cross that bridge when
we get to it.

Rejecting protocol field types reduces this probability again but it
may not be intuitive to the user trying to mistakenly use a reference
to a protocol why it is parsed as a macro. The reasons for rejecting
FT_PROTOCOL types as not interesting field references are not
very strong but it seems reasonable.

$ dftest 'frame.number != ${frame.number}'
Filter: frame.number != ${frame.number}

Instructions:
00000 READ_TREE		frame.number -> reg#0
00001 IF_FALSE_GOTO	5
00002 READ_REFERENCE	${frame.number} -> reg#1
00003 IF_FALSE_GOTO	5
00004 ALL_NE		reg#0 != reg#1
00005 RETURN

$ dftest 'frame != ${frame}'
dftest: macro 'frame' does not exist
2022-04-12 14:03:18 +00:00
..
.editorconfig dfilter: Fix EditorConfig settings 2022-03-21 17:49:12 +00:00
CMakeLists.txt dfilter: Improve grammar to parse ranges 2021-10-08 19:18:56 +01:00
dfilter-int.h dfilter: Add location tracking to scanner and use it to report errors 2022-04-10 10:09:51 +01:00
dfilter-macro.c dfilter: Try to resolve field reference instead of using a heuristic 2022-04-12 14:03:18 +00:00
dfilter-macro.h dfilter: Refactor macro tree references 2022-03-29 12:36:31 +00:00
dfilter.c dfilter: Try to resolve field reference instead of using a heuristic 2022-04-12 14:03:18 +00:00
dfilter.h Try to fix a narrowing warning 2022-04-11 22:23:13 +01:00
dfunctions.c dfilter: Add location tracking to scanner and use it to report errors 2022-04-10 10:09:51 +01:00
dfunctions.h dfilter: Use singly linked list for registers 2022-03-21 11:47:19 +00:00
dfvm.c dfilter: Print syntax tree using dftest + format enhancements 2022-04-05 12:04:37 +01:00
dfvm.h dfilter: Add remaining arithmetic integer ops 2022-03-31 16:49:42 +01:00
drange.c dfilter: Create the syntax node in the scanner and pass that 2022-04-10 09:54:03 +01:00
drange.h dfilter: Create the syntax node in the scanner and pass that 2022-04-10 09:54:03 +01:00
gencode.c dfilter: Remove existence test syntax tree nodes 2022-04-05 12:04:37 +01:00
gencode.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
grammar.lemon dfilter: Add location tracking to scanner and use it to report errors 2022-04-10 10:09:51 +01:00
scanner.l Try to fix a narrowing warning 2022-04-11 22:23:13 +01:00
semcheck.c dfilter: Add location tracking to scanner and use it to report errors 2022-04-10 10:09:51 +01:00
semcheck.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
sttype-function.c dfilter: Print syntax tree using dftest + format enhancements 2022-04-05 12:04:37 +01:00
sttype-function.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
sttype-pointer.c dfilter: Create the syntax node in the scanner and pass that 2022-04-10 09:54:03 +01:00
sttype-range.c epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
sttype-range.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +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-string.c dfilter: Add RHS bias for literal values 2022-03-05 11:10:54 +00:00
sttype-test.c dfilter: Remove existence test syntax tree nodes 2022-04-05 12:04:37 +01:00
sttype-test.h dfilter: Save lexical token value to syntax tree 2021-12-01 13:34:01 +00:00
syntax-tree.c Try to fix a narrowing warning 2022-04-11 22:23:13 +01:00
syntax-tree.h Try to fix a narrowing warning 2022-04-11 22:23:13 +01:00