aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2016-12-16 17:47:02 -0500
committerMartin Kaiser <wireshark@kaiser.cx>2016-12-29 11:26:33 +0000
commitd05be43a8993f8cbbb19a29c39e3e556e27125e9 (patch)
tree0ef87adaf69727af05ce3eb16fae72ff28dadc13 /epan
parent4eb5836a2cf529f56e6d819c338bd3726d56ed45 (diff)
zvt: dissect card type and result code bitmaps
Change-Id: I26a7821642224c707dc4542a35b2b5b5aee159d5 Reviewed-on: https://code.wireshark.org/review/19456 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-zvt.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/epan/dissectors/packet-zvt.c b/epan/dissectors/packet-zvt.c
index 86674a2e5e..288bc5c9f0 100644
--- a/epan/dissectors/packet-zvt.c
+++ b/epan/dissectors/packet-zvt.c
@@ -164,8 +164,12 @@ typedef struct _bitmap_info_t {
static gint dissect_zvt_tlv_container(
tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree);
+static gint dissect_zvt_res_code(
+ tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree);
static gint dissect_zvt_cc(
tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree);
+static gint dissect_zvt_card_type(
+ tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree);
static const bitmap_info_t bitmap_info[] = {
{ BMP_TIMEOUT, 1, NULL },
@@ -183,14 +187,14 @@ static const bitmap_info_t bitmap_info[] = {
{ BMP_CARD_NUM, BMP_PLD_LEN_UNKNOWN, NULL },
{ BMP_T2_DAT, BMP_PLD_LEN_UNKNOWN, NULL },
{ BMP_T3_DAT, BMP_PLD_LEN_UNKNOWN, NULL },
- { BMP_RES_CODE, 1, NULL },
+ { BMP_RES_CODE, 1, dissect_zvt_res_code },
{ BMP_TID, 4, NULL },
{ BMP_T1_DAT, BMP_PLD_LEN_UNKNOWN, NULL },
{ BMP_CVV_CVC, 2, NULL },
{ BMP_ADD_DATA, BMP_PLD_LEN_UNKNOWN, NULL },
{ BMP_CC, 2, dissect_zvt_cc },
{ BMP_RCPT_NUM, 2, NULL },
- { BMP_CARD_TYPE, 1, NULL }
+ { BMP_CARD_TYPE, 1, dissect_zvt_card_type }
};
@@ -218,7 +222,9 @@ static int hf_zvt_data = -1;
static int hf_zvt_int_status = -1;
static int hf_zvt_pwd = -1;
static int hf_zvt_reg_cfg = -1;
+static int hf_zvt_res_code = -1;
static int hf_zvt_cc = -1;
+static int hf_zvt_card_type = -1;
static int hf_zvt_reg_svc_byte = -1;
static int hf_zvt_bmp = -1;
static int hf_zvt_tlv_total_len = -1;
@@ -262,6 +268,15 @@ static const value_string zvt_cc[] = {
{ 0, NULL }
};
+static const value_string card_type[] = {
+ { 2, "ec-card" },
+ { 5, "girocard" },
+ { 6, "Mastercard" },
+ { 10, "VISA" },
+ { 0, NULL }
+};
+static value_string_ext card_type_ext = VALUE_STRING_EXT_INIT(card_type);
+
static const value_string bitmap[] = {
{ BMP_TIMEOUT, "Timeout" },
{ BMP_MAX_STAT_INFO, "max. status info" },
@@ -548,6 +563,14 @@ dissect_zvt_tlv_container(tvbuff_t *tvb, gint offset,
}
+static gint dissect_zvt_res_code(
+ tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree)
+{
+ proto_tree_add_item(tree, hf_zvt_res_code, tvb, offset, 1, ENC_BIG_ENDIAN);
+ return 1;
+}
+
+
static gint dissect_zvt_cc(
tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree)
{
@@ -556,6 +579,14 @@ static gint dissect_zvt_cc(
}
+static gint dissect_zvt_card_type(
+ tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree)
+{
+ proto_tree_add_item(tree, hf_zvt_card_type, tvb, offset, 1, ENC_BIG_ENDIAN);
+ return 1;
+}
+
+
/* dissect one "bitmap", i.e BMP and the corresponding data */
static gint
dissect_zvt_bitmap(tvbuff_t *tvb, gint offset,
@@ -1036,11 +1067,17 @@ proto_register_zvt(void)
{ &hf_zvt_reg_cfg,
{ "Config byte", "zvt.reg.config_byte",
FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } },
+ { &hf_zvt_res_code,
+ { "Result Code", "zvt.result_code",
+ FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } },
/* we don't call the filter zvt.reg.cc, the currency code
appears in several apdus */
{ &hf_zvt_cc,
{ "Currency Code", "zvt.cc",
FT_UINT16, BASE_HEX, VALS(zvt_cc), 0, NULL, HFILL } },
+ { &hf_zvt_card_type,
+ { "Card Type", "zvt.card_type", FT_UINT8,
+ BASE_DEC|BASE_EXT_STRING, &card_type_ext, 0, NULL, HFILL } },
{ &hf_zvt_reg_svc_byte,
{ "Service byte", "zvt.reg.service_byte",
FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } },