diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2015-11-19 11:53:54 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-11-19 13:39:55 +0000 |
commit | 4fd711f338ac99b4d71bbe068430bc6807e09d4a (patch) | |
tree | d7b04fefc7d8e4bc8761446766a2a29046ca024e | |
parent | 9b2c889abe0219fc162659e106c5b95deb6268f3 (diff) |
use the official DLT for ISO14443
add DLT_ISO14443 to pcap_to_wtap_map[]
define WTAP_ENCAP_ISO14443, link it to the iso14443 dissector
Change-Id: Id837197c4d66071094f9336d60db36a371424807
Reviewed-on: https://code.wireshark.org/review/11959
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-iso14443.c | 8 | ||||
-rw-r--r-- | wiretap/pcap-common.c | 3 | ||||
-rw-r--r-- | wiretap/wtap.c | 3 | ||||
-rw-r--r-- | wiretap/wtap.h | 1 |
4 files changed, 14 insertions, 1 deletions
diff --git a/epan/dissectors/packet-iso14443.c b/epan/dissectors/packet-iso14443.c index 5ca135c33c..68d904faeb 100644 --- a/epan/dissectors/packet-iso14443.c +++ b/epan/dissectors/packet-iso14443.c @@ -41,6 +41,7 @@ #include <epan/expert.h> #include <epan/packet.h> #include <epan/tfs.h> +#include <wiretap/wtap.h> /* Proximity Integrated Circuit Card, i.e. the smartcard */ #define ADDR_PICC "PICC" @@ -122,6 +123,8 @@ void proto_reg_handoff_iso14443(void); static int proto_iso14443 = -1; +static dissector_handle_t iso14443_handle; + static dissector_table_t iso14443_cmd_type_table; static int ett_iso14443 = -1; @@ -1066,7 +1069,8 @@ proto_register_iso14443(void) "iso14443.cmd_type", "ISO14443 Command Type", FT_UINT8, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE); - new_register_dissector("iso14443", dissect_iso14443, proto_iso14443); + iso14443_handle = + new_register_dissector("iso14443", dissect_iso14443, proto_iso14443); transactions = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); } @@ -1077,6 +1081,8 @@ proto_reg_handoff_iso14443(void) { dissector_handle_t cmd_type_handle; + dissector_add_uint("wtap_encap", WTAP_ENCAP_ISO14443, iso14443_handle); + cmd_type_handle = new_create_dissector_handle( dissect_iso14443_cmd_type_wupa, proto_iso14443); dissector_add_uint("iso14443.cmd_type", CMD_TYPE_WUPA, cmd_type_handle); diff --git a/wiretap/pcap-common.c b/wiretap/pcap-common.c index 2dc5e56285..f9ecc8db93 100644 --- a/wiretap/pcap-common.c +++ b/wiretap/pcap-common.c @@ -433,6 +433,9 @@ static const struct { /* IPMI Trace Data Collection */ { 260, WTAP_ENCAP_IPMI_TRACE }, + /* ISO14443 contactless smartcard standards */ + { 264, WTAP_ENCAP_ISO14443 }, + /* * To repeat: * diff --git a/wiretap/wtap.c b/wiretap/wtap.c index 38be2248dc..7e6d4982da 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -959,6 +959,9 @@ static struct encap_type_info encap_table_base[] = { /* WTAP_ENCAP_NSTRACE_3_5 */ { "NetScaler Encapsulation 3.5 of Ethernet", "nstrace35" }, + + /* WTAP_ENCAP_ISO14443 */ + { "ISO 14443 contactless smartcard standards", "iso14443" }, }; WS_DLL_LOCAL diff --git a/wiretap/wtap.h b/wiretap/wtap.h index e11c61adce..08883c1cd3 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -264,6 +264,7 @@ extern "C" { #define WTAP_ENCAP_LOOP 175 #define WTAP_ENCAP_JSON 176 #define WTAP_ENCAP_NSTRACE_3_5 177 +#define WTAP_ENCAP_ISO14443 178 /* After adding new item here, please also add new item to encap_table_base array */ #define WTAP_NUM_ENCAP_TYPES wtap_get_num_encap_types() |