diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2018-04-07 21:44:45 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-04-09 09:34:51 +0000 |
commit | e8441d5bf921e5e09871ae14e5980dbed146454f (patch) | |
tree | 6d32862cee133b34dd6dcabdd89dfe57c86320f4 /epan/dissectors/packet-iso14443.c | |
parent | 398c9ddfe1512d7aa65219ab59fb475fd2944a2a (diff) |
iso14443: make the payload dissector configurable
Add an iso14443.subdissector table where other protocols can register
themselves for iso14443's payload. Register iso7816 dissector in this
table.
Change-Id: Idb17ae014449443448ec4c64017531bc69d806b3
Reviewed-on: https://code.wireshark.org/review/26821
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-iso14443.c')
-rw-r--r-- | epan/dissectors/packet-iso14443.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/epan/dissectors/packet-iso14443.c b/epan/dissectors/packet-iso14443.c index 6362449e61..4419eb8c53 100644 --- a/epan/dissectors/packet-iso14443.c +++ b/epan/dissectors/packet-iso14443.c @@ -27,6 +27,7 @@ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> +#include <epan/decode_as.h> #include <epan/conversation.h> #include <epan/tfs.h> #include <epan/reassemble.h> @@ -170,6 +171,8 @@ static dissector_handle_t iso14443_handle; static dissector_table_t iso14443_cmd_type_table; +static dissector_table_t iso14443_subdissector_table; + static int ett_iso14443 = -1; static int ett_iso14443_hdr = -1; static int ett_iso14443_msg = -1; @@ -1088,8 +1091,10 @@ dissect_iso14443_cmd_type_block(tvbuff_t *tvb, packet_info *pinfo, &i_block_frag_items, NULL, tree); if (payload_tvb) { - /* XXX - forward to the actual upper layer protocol */ - call_data_dissector(payload_tvb, pinfo, tree); + if (!dissector_try_payload_new(iso14443_subdissector_table, + payload_tvb, pinfo, tree, TRUE, NULL)) { + call_data_dissector(payload_tvb, pinfo, tree); + } } } @@ -1883,6 +1888,11 @@ proto_register_iso14443(void) register_dissector("iso14443", dissect_iso14443, proto_iso14443); transactions = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); + + iso14443_subdissector_table = + register_decode_as_next_proto(proto_iso14443, + "Payload", "iso14443.subdissector", + "ISO14443 payload subdissector", NULL); } |