forked from osmocom/wireshark
8746eea297
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 |
||
---|---|---|
.. | ||
.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-function.c | ||
sttype-function.h | ||
sttype-pointer.c | ||
sttype-range.c | ||
sttype-range.h | ||
sttype-set.c | ||
sttype-set.h | ||
sttype-string.c | ||
sttype-test.c | ||
sttype-test.h | ||
syntax-tree.c | ||
syntax-tree.h |