wireshark/epan
João Valverde a975d478ba dfilter: Require double-quoted strings with "matches"
Matches is a special case that looks on the RHS and tries
to convert every unparsed value to a string, regardless
of the LHS type. This is not how types work in the display
filter. Require double-quotes to avoid ambiguity, because
matches doesn't follow normal Wireshark display filter
type rules. It doesn't need nor benefit from the flexibility
provided by unparsed strings in the syntax.

For matches the RHS is always a literal strings except
if the RHS is also a field name, then it complains of an
incompatible type. This is confusing. No type can be compatible
because no type rules are ever considered. Every unparsed value is
a text string except if it happens to coincide with a field
name it also requires double-quoting or it throws a syntax error,
just to be difficult. We could remove this odd quirk but requiring
double-quotes for regular expressions is a better, more elegant
fix.

Before:
  Filter: tcp matches "udp"

  Constants:
  00000 PUT_PCRE	udp -> reg#1

  Instructions:
  00000 READ_TREE		tcp -> reg#0
  00001 IF-FALSE-GOTO	3
  00002 ANY_MATCHES	reg#0 matches reg#1
  00003 RETURN

  Filter: tcp matches udp

  Constants:
  00000 PUT_PCRE	udp -> reg#1

  Instructions:
  00000 READ_TREE		tcp -> reg#0
  00001 IF-FALSE-GOTO	3
  00002 ANY_MATCHES	reg#0 matches reg#1
  00003 RETURN

  Filter: tcp matches udp.srcport
  dftest: tcp and udp.srcport are not of compatible types.

  Filter: tcp matches udp.srcportt

  Constants:
  00000 PUT_PCRE	udp.srcportt -> reg#1

  Instructions:
  00000 READ_TREE		tcp -> reg#0
  00001 IF-FALSE-GOTO	3
  00002 ANY_MATCHES	reg#0 matches reg#1
  00003 RETURN

After:
  Filter: tcp matches "udp"

  Constants:
  00000 PUT_PCRE	udp -> reg#1

  Instructions:
  00000 READ_TREE		tcp -> reg#0
  00001 IF-FALSE-GOTO	3
  00002 ANY_MATCHES	reg#0 matches reg#1
  00003 RETURN

  Filter: tcp matches udp
  dftest: "udp" was unexpected in this context.

  Filter: tcp matches udp.srcport
  dftest: "udp.srcport" was unexpected in this context.

  Filter: tcp matches udp.srcportt
  dftest: "udp.srcportt" was unexpected in this context.

The error message could still be improved.
2021-10-17 22:53:36 +00:00
..
crypt Fix some spelling errors. 2021-09-28 09:50:58 +00:00
dfilter dfilter: Require double-quoted strings with "matches" 2021-10-17 22:53:36 +00:00
dissectors btsmp: Fix endianess of debug public key 2021-10-17 14:46:47 +00:00
ftypes dfilter: Don't try to parse byte arrays as strings 2021-10-15 13:06:51 +01:00
wslua Lua: Make FileHandler seek_read() optional 2021-10-03 11:04:29 +02:00
.editorconfig
CMakeLists.txt rdp: add dissector for the egfx channel 2021-10-02 11:15:32 +02:00
addr_and_mask.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
addr_and_mask.h
addr_resolv.c Move more numerical functions to wsutil/to_str.h 2021-09-16 20:55:03 +01:00
addr_resolv.h
address.h iwarp_mpa: fix iWarp MPA for NFS-over-RDMA 2021-08-31 08:14:31 +00:00
address_types.c wsutil: Remove ip6_to_str_buf_with_pfx() 2021-09-17 00:08:41 +01:00
address_types.h
afn.c
afn.h
aftypes.c
aftypes.h
app_mem_usage.c
app_mem_usage.h
arcnet_pids.h
arptypes.h
asn1.c epan: remove a few more uses of wmem_packet_scope 2021-08-29 11:38:25 +00:00
asn1.h
ax25_pids.h
bridged_pids.h
capture_dissectors.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
capture_dissectors.h
charsets.c epan: remove a few more uses of wmem_packet_scope 2021-08-29 11:38:25 +00:00
charsets.h
chdlctypes.h
cisco_pid.h
color_filters.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
color_filters.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
column-info.h
column-utils.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
column-utils.h
column.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
column.h
conv_id.h
conversation.c iwarp_mpa: fix iWarp MPA for NFS-over-RDMA 2021-08-31 08:14:31 +00:00
conversation.h BT-uTP: Track conversations 2021-10-13 04:37:21 +00:00
conversation_debug.h
conversation_filter.c
conversation_filter.h
conversation_table.c
conversation_table.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
crc6-tvb.c
crc6-tvb.h
crc8-tvb.c
crc8-tvb.h
crc10-tvb.c
crc10-tvb.h
crc16-tvb.c
crc16-tvb.h
crc32-tvb.c
crc32-tvb.h
dccpservicecodes.h
decode_as.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
decode_as.h
diam_dict.h
diam_dict.l
disabled_protos.c Replace g_log() calls with ws_log() 2021-06-16 12:50:27 +00:00
disabled_protos.h
dtd.h
dtd_grammar.lemon
dtd_parse.h
dtd_parse.l
dtd_preparse.l
dvb_chartbl.c dvb_chartbl: remove wmem_packet_scope 2021-09-07 17:06:08 +00:00
dvb_chartbl.h
eap.h
eapol_keydes_types.h
epan.c COSE dissector from dtn-wireshark project 2021-09-29 08:51:13 +00:00
epan.h epan: export epan_set_always_visible() 2021-09-08 14:40:24 +00:00
epan_dissect.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
etypes.h IEEE 1722 AVTP: Fix name 2021-09-02 16:23:09 +00:00
ex-opt.c Use the musl in-tree getopt_long() everywhere 2021-09-17 00:43:54 +01:00
ex-opt.h Use the musl in-tree getopt_long() everywhere 2021-09-17 00:43:54 +01:00
except.c Add ws_debug() and use it 2021-05-24 01:13:19 +00:00
except.h
exceptions.h Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
exntest.c
expert.c Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
expert.h
export_object.c
export_object.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
exported_pdu.c iwarp_mpa: fix iWarp MPA for NFS-over-RDMA 2021-08-31 08:14:31 +00:00
exported_pdu.h Move LINKTYPE_WIRESHARK_UPPER_PDU definitions to a separate header. 2021-08-20 02:18:19 -07:00
filter_expressions.c Qt: Undo MR 3422 (filter button separator hint) 2021-06-23 05:12:08 +00:00
filter_expressions.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
follow.c HTTP2, QUIC: fix "Follow Stream" 2021-09-13 15:13:10 +00:00
follow.h HTTP2, QUIC: fix "Follow Stream" 2021-09-13 15:13:10 +00:00
frame_data.c wiretap: always allocate a block for a record. 2021-08-29 19:12:13 -07:00
frame_data.h wiretap: always allocate a block for a record. 2021-08-29 19:12:13 -07:00
frame_data_sequence.c Fix null pointer 2021-06-21 18:12:45 +00:00
frame_data_sequence.h
funnel.c wsutils: add local implementation of g_memdup2. 2021-03-25 09:38:10 +00:00
funnel.h lua: dialog with prefilled values 2021-07-13 06:52:55 +00:00
garrayfix.h
golay.c
golay.h
guid-utils.c guids: wmem-scope lookups 2021-09-28 15:07:55 -04:00
guid-utils.h guids: wmem-scope lookups 2021-09-28 15:07:55 -04:00
iana_charsets.c
iana_charsets.h
iax2_codec_type.h
in_cksum.c
in_cksum.h
ip_opts.h
ipproto.c Eth: Segment routing over IPv6 2021-10-05 13:29:55 +00:00
ipproto.h Eth: Segment routing over IPv6 2021-10-05 13:29:55 +00:00
ipv4.h
ipv6.h
lapd_sapi.h
llcsaps.h
maxmind_db.c Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
maxmind_db.h maxmind: add optional synchronous lookups 2021-04-02 06:48:42 +00:00
media_params.c
media_params.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
next_tvb.c tvblist: explicitly scope memory 2021-09-08 01:37:07 +00:00
next_tvb.h tvblist: explicitly scope memory 2021-09-08 01:37:07 +00:00
nlpid.h osi/nlpid: Update Avaya proprietary NLPID 2021-04-01 15:45:38 +02:00
oids.c oids: remove global scopes from debug code 2021-09-07 17:39:22 +00:00
oids.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
oids_test.c Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
osi-utils.c osi: avoid global memory scopes 2021-09-14 19:05:11 +00:00
osi-utils.h osi: avoid global memory scopes 2021-09-14 19:05:11 +00:00
oui.h ieee80211: Add dissector for Ruckus vendor specific IE 2021-09-30 05:38:13 +00:00
packet.c proto: Delay deleting heur_dtbl_entry_t in heur_dissector_delete 2021-09-29 07:08:52 +00:00
packet.h Use wtap_blocks for packet comments 2021-07-07 18:40:24 +00:00
packet_info.h
params.h
pci-ids.c
pci-ids.h
plugin_if.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
plugin_if.h
ppptypes.h
prefs-int.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
prefs.c IO Graph: Add checkbox to prevent automatic rescans 2021-09-21 12:58:55 +00:00
prefs.h IO Graph: Add checkbox to prevent automatic rescans 2021-09-21 12:58:55 +00:00
print.c MinGW-w64: Replace incompatible format for strftime() 2021-09-22 14:28:49 +01:00
print.h
print.ps
print_stream.c
print_stream.h
proto.c dfilter: Forbid protocol filter names beginning with '-' 2021-10-15 17:29:34 +01:00
proto.h proto: Delay deleting heur_dtbl_entry_t in heur_dissector_delete 2021-09-29 07:08:52 +00:00
proto_data.c proto_data: use pinfo->pool not the global scope 2021-10-04 15:52:10 +00:00
proto_data.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
protobuf-helper.c
protobuf-helper.h
protobuf_lang_parser.lemon Add missing prototypes to lemon-generated code. 2021-04-16 18:38:26 +00:00
protobuf_lang_scanner.l protobuf: fix leaking tokens 2021-03-27 17:23:07 +00:00
protobuf_lang_tree.c protobuf: Fix leaking nodes and strings 2021-04-02 07:25:31 +00:00
protobuf_lang_tree.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
ps.h
ptvcursor.h ptvcursor: add explicit memory scope 2021-09-16 07:12:20 +00:00
radius_dict.l
range.c
range.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
reassemble.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
reassemble.h
reassemble_test.c reassemble_test: Add an explicit cast [-Wformat=] 2021-09-25 21:30:20 +01:00
reedsolomon.c Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
reedsolomon.h
register-int.h
register.c
register.h
req_resp_hdrs.c First pass pinfo->pool conversion 2021-07-21 05:38:29 +00:00
req_resp_hdrs.h
rtd_table.c
rtd_table.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
rtp_pt.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
sctpppids.c
sctpppids.h
secrets.c Replace g_log() calls with ws_log() 2021-06-16 12:50:27 +00:00
secrets.h
sequence_analysis.c Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
sequence_analysis.h Replace g_log() calls with ws_log() 2021-06-16 12:50:27 +00:00
show_exception.c Remove uninteresting information from REPORT_DISSECTOR_BUG() etc. messages. 2021-06-19 04:37:26 -07:00
show_exception.h
slow_protocol_subtypes.h
sminmpec.h
srt_table.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
srt_table.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
stat_groups.h Added statistics group for RSerPool protocols. 2021-04-08 09:36:23 +02:00
stat_tap_ui.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
stat_tap_ui.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
stats_tree.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
stats_tree.h
stats_tree_priv.h Use the musl in-tree getopt_long() everywhere 2021-09-17 00:43:54 +01:00
stream.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
stream.h Remove lingering circuit API from stream.h 2021-06-13 11:51:44 +00:00
strutil.c Remove duplicate format_size() function 2021-07-26 14:56:11 +00:00
strutil.h Remove duplicate format_size() function 2021-07-26 14:56:11 +00:00
t35.c
t35.h
tap-voip.h
tap.c Replace g_log() calls with ws_log() 2021-06-16 12:50:27 +00:00
tap.h
tfs.c
tfs.h
time_fmt.h
timestamp.c
timestamp.h
timestats.c
timestats.h
to_str.c to_str: scope decode_bits_in_field 2021-10-05 04:42:13 +00:00
to_str.h to_str: scope tvb_ip6_to_str 2021-10-07 13:31:23 -04:00
tvbparse.c tvbparse: explicitly memory-scope parser 2021-09-16 06:54:42 +00:00
tvbparse.h tvbparse: explicitly memory-scope parser 2021-09-16 06:54:42 +00:00
tvbtest.c tvbtest: Test offsets returned by tvb_find on subsets. 2021-04-03 15:12:20 +00:00
tvbuff-int.h
tvbuff.c USB HID: Parse bit fields with correct bit order 2021-09-26 18:16:28 +02:00
tvbuff.h USB HID: Parse bit fields with correct bit order 2021-09-26 18:16:28 +02:00
tvbuff_base64.c epan: more work to avoid global memory pool 2021-09-08 21:25:40 +00:00
tvbuff_brotli.c
tvbuff_composite.c
tvbuff_lz77.c Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
tvbuff_lz77huff.c Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
tvbuff_lznt1.c Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
tvbuff_rdp.c rdp: Fix compile errors 2021-10-03 10:31:07 +02:00
tvbuff_rdp.h rdp: add dissector for the egfx channel 2021-10-02 11:15:32 +02:00
tvbuff_real.c
tvbuff_subset.c tvbuff_subset: fix its implementation of string scanning. 2021-03-29 01:02:47 +00:00
tvbuff_zlib.c Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
uat-int.h
uat.c Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
uat.h wsutils: add local implementation of g_memdup2. 2021-03-25 09:38:10 +00:00
uat_load.l
unit_strings.c
unit_strings.h
value_string.c Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
value_string.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
wmem_scopes.c Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
wmem_scopes.h Move epan/wmem/wmem_scopes.h to epan/ 2021-07-26 14:56:11 +00:00
ws_printf.h Add ws_debug() and use it 2021-05-24 01:13:19 +00:00
wscbor.c COSE: Handle indefinite tstr/bstr encodings 2021-10-05 21:11:36 +00:00
wscbor.h COSE: Handle indefinite tstr/bstr encodings 2021-10-05 21:11:36 +00:00
wscbor_test.c COSE: Handle indefinite tstr/bstr encodings 2021-10-05 21:11:36 +00:00
x264_prt_id.h
xdlc.c First pass pinfo->pool conversion 2021-07-21 05:38:29 +00:00
xdlc.h