diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-08-30 15:51:54 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-08-31 00:20:17 +0000 |
commit | 6b6cf9992e8d592a58086653d5d3d58409d02311 (patch) | |
tree | d112f7c52ae7894b5e08dc5638d517d95326166a /plugins | |
parent | 0158d621cad2b10254d30ed3c3a03c80ced7ae03 (diff) | |
download | wireshark-6b6cf9992e8d592a58086653d5d3d58409d02311.tar.gz wireshark-6b6cf9992e8d592a58086653d5d3d58409d02311.tar.bz2 wireshark-6b6cf9992e8d592a58086653d5d3d58409d02311.zip |
Don't do any Decode As stuff for dissector tables not used with Decode As.
Have all dissector tables have a "supports Decode As" flag, which
defaults to FALSE, and which is set to TRUE if a register_decode_as()
refers to it.
When adding a dissector to a dissector table with a given key, only add
it for Decode As if the dissector table supports it.
For non-FT_STRING dissector tables, always check for multiple entries
for the same protocol with different dissectors, and report an error if
we found them.
This means there's no need for the creator of a dissector table to
specify whether duplicates of that sort should be allowed - we always do
the check when registering something for "Decode As" (in a non-FT_STRING
dissector table), and just don't bother registering anything for "Decode
As" if the dissector table doesn't support "Decode As", so there's no
check done for those dissector tables.
Change-Id: I4e98bfe0061f1014cd7ffdf4c51d9b6e8a2a5689
Reviewed-on: https://code.wireshark.org/review/17405
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/docsis/packet-docsis.c | 2 | ||||
-rw-r--r-- | plugins/docsis/packet-macmgmt.c | 2 | ||||
-rw-r--r-- | plugins/ethercat/packet-ethercat-frame.c | 2 | ||||
-rw-r--r-- | plugins/wimax/mac_mgmt_msg_decoder.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/plugins/docsis/packet-docsis.c b/plugins/docsis/packet-docsis.c index 2f2057ac3b..a498d83379 100644 --- a/plugins/docsis/packet-docsis.c +++ b/plugins/docsis/packet-docsis.c @@ -825,7 +825,7 @@ proto_register_docsis (void) #if 0 docsis_dissector_table = register_dissector_table ("docsis", "DOCSIS Encapsulation Type", proto_docsis, - FT_UINT8, BASE_DEC, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE); + FT_UINT8, BASE_DEC); #endif register_dissector ("docsis", dissect_docsis, proto_docsis); diff --git a/plugins/docsis/packet-macmgmt.c b/plugins/docsis/packet-macmgmt.c index ca8d82c3b6..f2041037f6 100644 --- a/plugins/docsis/packet-macmgmt.c +++ b/plugins/docsis/packet-macmgmt.c @@ -274,7 +274,7 @@ proto_register_docsis_mgmt (void) docsis_mgmt_dissector_table = register_dissector_table ("docsis_mgmt", "DOCSIS Mac Management", proto_docsis_mgmt, - FT_UINT8, BASE_DEC, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE); + FT_UINT8, BASE_DEC); register_dissector ("docsis_mgmt", dissect_macmgmt, proto_docsis_mgmt); } diff --git a/plugins/ethercat/packet-ethercat-frame.c b/plugins/ethercat/packet-ethercat-frame.c index 0d9eb5f677..1db5599d75 100644 --- a/plugins/ethercat/packet-ethercat-frame.c +++ b/plugins/ethercat/packet-ethercat-frame.c @@ -139,7 +139,7 @@ void proto_register_ethercat_frame(void) /* Define a handle (ecatf.type) for sub dissectors that want to dissect the Ethercat frame ether type (E88A4) payload. */ ethercat_frame_dissector_table = register_dissector_table("ecatf.type", "EtherCAT frame type", - proto_ethercat_frame, FT_UINT8, BASE_DEC, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE); + proto_ethercat_frame, FT_UINT8, BASE_DEC); } void proto_reg_handoff_ethercat_frame(void) diff --git a/plugins/wimax/mac_mgmt_msg_decoder.c b/plugins/wimax/mac_mgmt_msg_decoder.c index c42d9c4246..2eed2e5c36 100644 --- a/plugins/wimax/mac_mgmt_msg_decoder.c +++ b/plugins/wimax/mac_mgmt_msg_decoder.c @@ -214,7 +214,7 @@ void proto_register_mac_mgmt_msg(void) expert_register_field_array(expert_mac_mgmt, ei, array_length(ei)); subdissector_message_table = register_dissector_table("wmx.mgmtmsg", - "WiMax MAC Management Message", proto_mac_mgmt_msg_decoder, FT_UINT8, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE); + "WiMax MAC Management Message", proto_mac_mgmt_msg_decoder, FT_UINT8, BASE_DEC); /* Register dissector by name */ register_dissector("wmx_mac_mgmt_msg_decoder", dissect_mac_mgmt_msg_decoder, |