diff options
Diffstat (limited to 'epan/dissectors/packet-zvt.c')
-rw-r--r-- | epan/dissectors/packet-zvt.c | 250 |
1 files changed, 152 insertions, 98 deletions
diff --git a/epan/dissectors/packet-zvt.c b/epan/dissectors/packet-zvt.c index 61a965204c..33048219b4 100644 --- a/epan/dissectors/packet-zvt.c +++ b/epan/dissectors/packet-zvt.c @@ -100,15 +100,15 @@ typedef struct _apdu_info_t { static void dissect_zvt_int_status(tvbuff_t *tvb, gint offset, guint16 len, packet_info *pinfo, proto_tree *tree, zvt_transaction_t *zvt_trans); -static void dissect_zvt_reg(tvbuff_t *tvb, gint offset, guint16 len, +static void dissect_zvt_reg(tvbuff_t *tvb, gint offset, guint16 len _U_, packet_info *pinfo, proto_tree *tree, zvt_transaction_t *zvt_trans); static void dissect_zvt_bitmap_seq(tvbuff_t *tvb, gint offset, guint16 len, + packet_info *pinfo, proto_tree *tree, zvt_transaction_t *zvt_trans _U_); +static void dissect_zvt_init(tvbuff_t *tvb, gint offset, guint16 len _U_, + packet_info *pinfo _U_, proto_tree *tree, zvt_transaction_t *zvt_trans _U_); +static void dissect_zvt_pass_bitmap_seq(tvbuff_t *tvb, gint offset, guint16 len _U_, packet_info *pinfo, proto_tree *tree, zvt_transaction_t *zvt_trans); -static void dissect_zvt_init(tvbuff_t *tvb, gint offset, guint16 len, - packet_info *pinfo, proto_tree *tree, zvt_transaction_t *zvt_trans); -static void dissect_zvt_pass_bitmap_seq(tvbuff_t *tvb, gint offset, guint16 len, - packet_info *pinfo, proto_tree *tree, zvt_transaction_t *zvt_trans); -static void dissect_zvt_abort(tvbuff_t *tvb, gint offset, guint16 len, +static void dissect_zvt_abort(tvbuff_t *tvb, gint offset, guint16 len _U_, packet_info *pinfo, proto_tree *tree, zvt_transaction_t *zvt_trans); static const apdu_info_t apdu_info[] = { @@ -169,9 +169,9 @@ static gint dissect_zvt_amount( static gint dissect_zvt_tlv_container( tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree); static inline gint dissect_zvt_res_code( - tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree); + tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree); static inline gint dissect_zvt_cc( - tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree); + tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree); static inline gint dissect_zvt_terminal_id( tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree); static inline gint dissect_zvt_time( @@ -179,7 +179,7 @@ static inline gint dissect_zvt_time( static inline gint dissect_zvt_date( tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree); static inline gint dissect_zvt_card_type( - tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree); + tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree); static inline gint dissect_zvt_trace_number( tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree); static inline gint dissect_zvt_expiry_date( @@ -224,58 +224,66 @@ static const bitmap_info_t bitmap_info[] = { void proto_register_zvt(void); void proto_reg_handoff_zvt(void); -static int proto_zvt = -1; - -static int ett_zvt = -1; -static int ett_zvt_apdu = -1; -static int ett_zvt_bitmap = -1; -static int ett_zvt_tlv_dat_obj = -1; -static int ett_zvt_tlv_subseq = -1; -static int ett_zvt_tlv_tag = -1; - -static int hf_zvt_resp_in = -1; -static int hf_zvt_resp_to = -1; -static int hf_zvt_serial_char = -1; -static int hf_zvt_crc = -1; -static int hf_zvt_ctrl = -1; -static int hf_zvt_ccrc = -1; -static int hf_zvt_aprc = -1; -static int hf_zvt_len = -1; -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_amount = -1; -static int hf_zvt_terminal_id = -1; -static int hf_zvt_time = -1; -static int hf_zvt_date = -1; -static int hf_zvt_card_type = -1; -static int hf_zvt_bmp = -1; -static int hf_zvt_tlv_total_len = -1; -static int hf_zvt_tlv_tag = -1; -static int hf_zvt_tlv_tag_class = -1; -static int hf_zvt_tlv_tag_type = -1; -static int hf_zvt_tlv_len = -1; -static int hf_zvt_text_lines_line = -1; -static int hf_zvt_permitted_cmd = -1; -static int hf_zvt_receipt_type = -1; -static int hf_zvt_receipt_parameter_positive_customer = -1; -static int hf_zvt_receipt_parameter_negative_customer = -1; -static int hf_zvt_receipt_parameter_positive_merchant = -1; -static int hf_zvt_receipt_parameter_negative_merchant = -1; -static int hf_zvt_receipt_parameter_customer_before_merchant = -1; -static int hf_zvt_receipt_parameter_print_short_receipt = -1; -static int hf_zvt_receipt_parameter_no_product_data = -1; -static int hf_zvt_receipt_parameter_ecr_as_printer = -1; -static int hf_zvt_receipt_parameter = -1; -static int hf_zvt_trace_number = -1; -static int hf_zvt_expiry_date = -1; -static int hf_zvt_card_number = -1; -static int hf_zvt_card_name = -1; -static int hf_zvt_additional_data = -1; -static int hf_zvt_characters_per_line = -1; +static dissector_handle_t zvt_tcp_handle; + +static int proto_zvt; + +static int ett_zvt; +static int ett_zvt_apdu; +static int ett_zvt_bitmap; +static int ett_zvt_tlv_dat_obj; +static int ett_zvt_tlv_subseq; +static int ett_zvt_tlv_tag; +static int ett_zvt_tlv_receipt; + +static int hf_zvt_resp_in; +static int hf_zvt_resp_to; +static int hf_zvt_serial_char; +static int hf_zvt_crc; +static int hf_zvt_ctrl; +static int hf_zvt_ccrc; +static int hf_zvt_aprc; +static int hf_zvt_len; +static int hf_zvt_data; +static int hf_zvt_int_status; +static int hf_zvt_pwd; +static int hf_zvt_reg_cfg; +static int hf_zvt_res_code; +static int hf_zvt_cc; +static int hf_zvt_amount; +static int hf_zvt_terminal_id; +static int hf_zvt_time; +static int hf_zvt_date; +static int hf_zvt_card_type; +static int hf_zvt_bmp; +static int hf_zvt_tlv_total_len; +static int hf_zvt_tlv_tag; +static int hf_zvt_tlv_tag_class; +static int hf_zvt_tlv_tag_type; +static int hf_zvt_tlv_len; +static int hf_zvt_text_lines_line; +static int hf_zvt_permitted_cmd; +static int hf_zvt_receipt_type; +static int hf_zvt_receipt_parameter_positive_customer; +static int hf_zvt_receipt_parameter_negative_customer; +static int hf_zvt_receipt_parameter_positive_merchant; +static int hf_zvt_receipt_parameter_negative_merchant; +static int hf_zvt_receipt_parameter_customer_before_merchant; +static int hf_zvt_receipt_parameter_print_short_receipt; +static int hf_zvt_receipt_parameter_no_product_data; +static int hf_zvt_receipt_parameter_ecr_as_printer; +static int hf_zvt_receipt_parameter; +static int hf_zvt_trace_number; +static int hf_zvt_expiry_date; +static int hf_zvt_card_number; +static int hf_zvt_card_name; +static int hf_zvt_additional_data; +static int hf_zvt_characters_per_line; +static int hf_zvt_receipt_info; +static int hf_zvt_receipt_info_positive; +static int hf_zvt_receipt_info_signature; +static int hf_zvt_receipt_info_negative; +static int hf_zvt_receipt_info_printing; static int * const receipt_parameter_flag_fields[] = { &hf_zvt_receipt_parameter_positive_customer, @@ -289,7 +297,15 @@ static int * const receipt_parameter_flag_fields[] = { NULL }; -static expert_field ei_invalid_apdu_len = EI_INIT; +static int * const receipt_info_fields[] = { + &hf_zvt_receipt_info_positive, + &hf_zvt_receipt_info_signature, + &hf_zvt_receipt_info_negative, + &hf_zvt_receipt_info_printing, + NULL +}; + +static expert_field ei_invalid_apdu_len; static const value_string serial_char[] = { { STX, "Start of text (STX)" }, @@ -322,6 +338,9 @@ static value_string_ext ctrl_field_ext = VALUE_STRING_EXT_INIT(ctrl_field); /* ISO 4217 currency codes */ static const value_string zvt_cc[] = { + { 0x0756, "CHF" }, + { 0x0826, "GBP" }, + { 0x0840, "USD" }, { 0x0978, "EUR" }, { 0, NULL } }; @@ -338,6 +357,7 @@ static const value_string card_type[] = { { 5, "girocard" }, { 6, "Mastercard" }, { 10, "VISA" }, + { 46, "Maestro" }, { 0, NULL } }; static value_string_ext card_type_ext = VALUE_STRING_EXT_INIT(card_type); @@ -400,6 +420,7 @@ static value_string_ext tlv_tag_class_ext = VALUE_STRING_EXT_INIT(tlv_tag_class) #define TLV_TAG_CARDHOLDER_AUTH 0x1F10 #define TLV_TAG_ONLINE_FLAG 0x1F11 #define TLV_TAG_CARD_TYPE 0x1F12 +#define TLV_TAG_RECEIPT_INFO 0x1F37 typedef struct _tlv_seq_info_t { @@ -409,7 +430,7 @@ typedef struct _tlv_seq_info_t { static gint dissect_zvt_tlv_seq(tvbuff_t *tvb, gint offset, guint16 seq_max_len, - packet_info *pinfo _U_, proto_tree *tree, tlv_seq_info_t *seq_info); + packet_info *pinfo, proto_tree *tree, tlv_seq_info_t *seq_info); typedef struct _tlv_info_t { guint32 tag; @@ -419,7 +440,7 @@ typedef struct _tlv_info_t { static inline gint dissect_zvt_tlv_text_lines( tvbuff_t *tvb, gint offset, gint len, - packet_info *pinfo, proto_tree *tree, tlv_seq_info_t *seq_info); + packet_info *pinfo _U_, proto_tree *tree, tlv_seq_info_t *seq_info); static inline gint dissect_zvt_tlv_subseq( tvbuff_t *tvb, gint offset, gint len, @@ -427,19 +448,23 @@ static inline gint dissect_zvt_tlv_subseq( static inline gint dissect_zvt_tlv_permitted_cmd( tvbuff_t *tvb, gint offset, gint len, - packet_info *pinfo, proto_tree *tree, tlv_seq_info_t *seq_info); + packet_info *pinfo _U_, proto_tree *tree, tlv_seq_info_t *seq_info _U_); static inline gint dissect_zvt_tlv_receipt_type( tvbuff_t *tvb, gint offset, gint len, - packet_info *pinfo, proto_tree *tree, tlv_seq_info_t *seq_info); + packet_info *pinfo _U_, proto_tree *tree, tlv_seq_info_t *seq_info _U_); static inline gint dissect_zvt_tlv_receipt_param( tvbuff_t *tvb, gint offset, gint len, - packet_info *pinfo, proto_tree *tree, tlv_seq_info_t *seq_info); + packet_info *pinfo _U_, proto_tree *tree, tlv_seq_info_t *seq_info _U_); static inline gint dissect_zvt_tlv_characters_per_line( tvbuff_t *tvb, gint offset, gint len, - packet_info *pinfo, proto_tree *tree, tlv_seq_info_t *seq_info); + packet_info *pinfo, proto_tree *tree, tlv_seq_info_t *seq_info _U_); + +static inline gint dissect_zvt_tlv_receipt_info( + tvbuff_t *tvb, gint offset, gint len, packet_info *pinfo _U_, + proto_tree *tree, tlv_seq_info_t *seq_info _U_); static const tlv_info_t tlv_info[] = { { TLV_TAG_TEXT_LINES, dissect_zvt_tlv_text_lines }, @@ -450,7 +475,8 @@ static const tlv_info_t tlv_info[] = { { TLV_TAG_PERMITTED_ZVT_CMD, dissect_zvt_tlv_permitted_cmd }, { TLV_TAG_RECEIPT_TYPE, dissect_zvt_tlv_receipt_type }, { TLV_TAG_RECEIPT_PARAM, dissect_zvt_tlv_receipt_param }, - { TLV_TAG_CHARS_PER_LINE, dissect_zvt_tlv_characters_per_line } + { TLV_TAG_CHARS_PER_LINE, dissect_zvt_tlv_characters_per_line }, + { TLV_TAG_RECEIPT_INFO, dissect_zvt_tlv_receipt_info } }; static const value_string tlv_tags[] = { @@ -472,6 +498,7 @@ static const value_string tlv_tags[] = { { TLV_TAG_CARDHOLDER_AUTH, "Cardholder authentication" }, { TLV_TAG_ONLINE_FLAG, "Online flag" }, { TLV_TAG_CARD_TYPE, "Card type" }, + { TLV_TAG_RECEIPT_INFO, "Receipt information" }, { 0, NULL } }; static value_string_ext tlv_tags_ext = VALUE_STRING_EXT_INIT(tlv_tags); @@ -524,7 +551,7 @@ static inline gint dissect_zvt_tlv_receipt_param( tvbuff_t *tvb, gint offset, gint len, packet_info *pinfo _U_, proto_tree *tree, tlv_seq_info_t *seq_info _U_) { - proto_tree_add_bitmask(tree, tvb, offset, hf_zvt_receipt_parameter, ett_zvt_tlv_tag, receipt_parameter_flag_fields, ENC_BIG_ENDIAN); + proto_tree_add_bitmask(tree, tvb, offset, hf_zvt_receipt_parameter, ett_zvt_tlv_receipt, receipt_parameter_flag_fields, ENC_BIG_ENDIAN); return len; } @@ -533,8 +560,18 @@ static inline gint dissect_zvt_tlv_characters_per_line( tvbuff_t *tvb, gint offset, gint len, packet_info *pinfo _U_, proto_tree *tree, tlv_seq_info_t *seq_info _U_) { - const gchar *str = tvb_bcd_dig_to_str_be(pinfo->pool, tvb, offset, 1, NULL, FALSE); - proto_tree_add_string(tree, hf_zvt_characters_per_line, tvb, offset, 1, str); + proto_tree_add_item(tree, hf_zvt_characters_per_line, tvb, offset, 1, + ENC_BCD_DIGITS_0_9 | ENC_BIG_ENDIAN); + return len; +} + + +static inline gint dissect_zvt_tlv_receipt_info( + tvbuff_t *tvb, gint offset, gint len, + packet_info *pinfo _U_, proto_tree *tree, tlv_seq_info_t *seq_info _U_) +{ + proto_tree_add_bitmask(tree, tvb, offset, hf_zvt_receipt_info, + ett_zvt_tlv_receipt, receipt_info_fields, ENC_BIG_ENDIAN); return len; } @@ -570,7 +607,7 @@ dissect_zvt_tlv_tag(tvbuff_t *tvb, gint offset, tag_ti = proto_tree_add_uint_format(tree, hf_zvt_tlv_tag, tvb, offset_start, offset-offset_start, _tag, "Tag: %s (0x%x)", - val_to_str_ext(_tag, &tlv_tags_ext, "unknown"), _tag); + val_to_str_ext_const(_tag, &tlv_tags_ext, "unknown"), _tag); tag_tree = proto_item_add_subtree(tag_ti, ett_zvt_tlv_tag); proto_tree_add_item(tag_tree, hf_zvt_tlv_tag_class, @@ -730,14 +767,14 @@ static inline gint dissect_zvt_card_type( static inline gint dissect_zvt_terminal_id( tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree) { - const gchar *str = tvb_bcd_dig_to_str_be(pinfo->pool, tvb, offset, 4, NULL, FALSE); - proto_tree_add_string(tree, hf_zvt_terminal_id, tvb, offset, 4, str); + proto_tree_add_item(tree, hf_zvt_terminal_id, tvb, offset, 4, + ENC_BCD_DIGITS_0_9 | ENC_BIG_ENDIAN); return 4; } static inline gint dissect_zvt_amount( - tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree) + tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { const gchar *str = tvb_bcd_dig_to_str_be(pinfo->pool, tvb, offset, 6, NULL, FALSE); proto_tree_add_uint64(tree, hf_zvt_amount, tvb, offset, 6, g_ascii_strtoll(str,NULL,10)); @@ -746,7 +783,7 @@ static inline gint dissect_zvt_amount( static inline gint dissect_zvt_time( - tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree) + tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { const gchar *str = tvb_bcd_dig_to_str_be(pinfo->pool, tvb, offset, 3, NULL, FALSE); gchar *fstr = (char *)wmem_alloc(pinfo->pool, 9); @@ -765,7 +802,7 @@ static inline gint dissect_zvt_time( static inline gint dissect_zvt_date( - tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree) + tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { const gchar *str = tvb_bcd_dig_to_str_be(pinfo->pool, tvb, offset, 2, NULL, FALSE); gchar *fstr = (char *)wmem_alloc(pinfo->pool, 6); @@ -781,7 +818,7 @@ static inline gint dissect_zvt_date( static inline gint dissect_zvt_expiry_date( - tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree) + tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { const gchar *str = tvb_bcd_dig_to_str_be(pinfo->pool, tvb, offset, 2, NULL, FALSE); gchar *fstr = (char *)wmem_alloc(pinfo->pool, 6); @@ -799,8 +836,8 @@ static inline gint dissect_zvt_expiry_date( static inline gint dissect_zvt_trace_number( tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree) { - const gchar *str = tvb_bcd_dig_to_str_be(pinfo->pool, tvb, offset, 3, NULL, FALSE); - proto_tree_add_string(tree, hf_zvt_trace_number, tvb, offset, 3, str); + proto_tree_add_item(tree, hf_zvt_trace_number, tvb, offset, 3, + ENC_BCD_DIGITS_0_9 | ENC_BIG_ENDIAN); return 3; } @@ -811,14 +848,15 @@ static inline gint dissect_zvt_card_number( guint8 tens = tvb_get_guint8(tvb, offset) & 0x0f; guint8 ones = tvb_get_guint8(tvb, offset + 1) & 0x0f; guint8 length = tens * 10 + ones; - const gchar *str = tvb_bcd_dig_to_str_be(pinfo->pool, tvb, offset + 2, length, NULL, FALSE); - proto_tree_add_string(tree, hf_zvt_card_number, tvb, offset + 2, length, str); + + proto_tree_add_item(tree, hf_zvt_card_number, tvb, offset + 2, length, + ENC_BCD_DIGITS_0_9 | ENC_BIG_ENDIAN); return 2 + length; } static inline gint dissect_zvt_card_name( - tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree) + tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { guint8 tens = tvb_get_guint8(tvb, offset) & 0x0f; guint8 ones = tvb_get_guint8(tvb, offset + 1) & 0x0f; @@ -830,7 +868,7 @@ static inline gint dissect_zvt_card_name( static inline gint dissect_zvt_additional_data( - tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree) + tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { guint8 hundrets = tvb_get_guint8(tvb, offset) & 0x0f; guint8 tens = tvb_get_guint8(tvb, offset + 1) & 0x0f; @@ -866,7 +904,7 @@ dissect_zvt_bitmap(tvbuff_t *tvb, gint offset, proto_tree_add_item(bitmap_tree, hf_zvt_bmp, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_append_text(bitmap_it, ": %s", - val_to_str(bmp, bitmap, "unknown")); + val_to_str_const(bmp, bitmap, "unknown")); offset++; bi = (bitmap_info_t *)g_hash_table_lookup( @@ -962,7 +1000,7 @@ dissect_zvt_pass_bitmap_seq(tvbuff_t *tvb, gint offset, guint16 len _U_, (which may be the complete APDU payload or a part of it) */ static void dissect_zvt_bitmap_seq(tvbuff_t *tvb, gint offset, guint16 len, - packet_info *pinfo _U_, proto_tree *tree, zvt_transaction_t *zvt_trans _U_) + packet_info *pinfo, proto_tree *tree, zvt_transaction_t *zvt_trans _U_) { gint offset_start, ret; @@ -1079,7 +1117,7 @@ dissect_zvt_apdu(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tre ctrl = tvb_get_ntohs(tvb, offset); proto_tree_add_item(apdu_tree, hf_zvt_ctrl, tvb, offset, 2, ENC_BIG_ENDIAN); col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, - val_to_str_const(ctrl, ctrl_field, "Unknown 0x%x")); + val_to_str(ctrl, ctrl_field, "Unknown 0x%x")); offset += 2; if (PINFO_FD_VISITED(pinfo)) { @@ -1130,7 +1168,7 @@ dissect_zvt_apdu(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tre static gint -dissect_zvt_serial(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree) +dissect_zvt_serial(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { gint offset_start; int apdu_len; @@ -1248,7 +1286,7 @@ static guint get_zvt_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offs } static int -dissect_zvt_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_zvt_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { tcp_dissect_pdus(tvb, pinfo, tree, TRUE, ZVT_APDU_MIN_LEN, get_zvt_message_len, dissect_zvt, data); @@ -1275,7 +1313,8 @@ proto_register_zvt(void) &ett_zvt_bitmap, &ett_zvt_tlv_dat_obj, &ett_zvt_tlv_subseq, - &ett_zvt_tlv_tag + &ett_zvt_tlv_tag, + &ett_zvt_tlv_receipt }; static hf_register_info hf[] = { { &hf_zvt_resp_in, @@ -1358,7 +1397,7 @@ proto_register_zvt(void) FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_zvt_text_lines_line, { "Text line", "zvt.tlv.text_lines.line", - FT_STRING, STR_UNICODE, NULL, 0, NULL, HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_zvt_permitted_cmd, { "Permitted command", "zvt.tlv.permitted_command", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, @@ -1372,10 +1411,10 @@ proto_register_zvt(void) { "Negative customer receipt", "zvt.tlv.receipt_parameter.negative_customer", FT_BOOLEAN, 8, TFS(&tfs_required_not_required), 0x40, NULL, HFILL } }, { &hf_zvt_receipt_parameter_positive_merchant, - { "Positive merchant receipt", "zvt.tlv.receipt_parameter.positive_customer", FT_BOOLEAN, + { "Positive merchant receipt", "zvt.tlv.receipt_parameter.positive_merchant", FT_BOOLEAN, 8, TFS(&tfs_required_not_required), 0x20, NULL, HFILL } }, { &hf_zvt_receipt_parameter_negative_merchant, - { "Negative merchant receipt", "zvt.tlv.receipt_parameter.negative_customer", FT_BOOLEAN, + { "Negative merchant receipt", "zvt.tlv.receipt_parameter.negative_merchant", FT_BOOLEAN, 8, TFS(&tfs_required_not_required), 0x10, NULL, HFILL } }, { &hf_zvt_receipt_parameter_customer_before_merchant, { "Customer receipt should be sent before the merchant receipt", "zvt.tlv.receipt_parameter.customer_first", FT_BOOLEAN, @@ -1410,6 +1449,24 @@ proto_register_zvt(void) { &hf_zvt_characters_per_line, { "Characters per line", "zvt.characters_per_line", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_zvt_receipt_info, + { "Receipt information", "zvt.tlv.receipt_info", FT_UINT8, + BASE_HEX, NULL, 0x00, NULL, HFILL } }, + { &hf_zvt_receipt_info_positive, + { "Positive receipt (authorised)", + "zvt.tlv.receipt_info.positive", FT_BOOLEAN, 8, + TFS(&tfs_yes_no), 0x01, NULL, HFILL } }, + { &hf_zvt_receipt_info_signature, + { "Receipt contains a signature", + "zvt.tlv.receipt_info.signature", FT_BOOLEAN, 8, + TFS(&tfs_yes_no), 0x02, NULL, HFILL } }, + { &hf_zvt_receipt_info_negative, + { "Negative receipt (aborted, rejected)", + "zvt.tlv.receipt_info.negative", FT_BOOLEAN, 8, + TFS(&tfs_yes_no), 0x04, NULL, HFILL } }, + { &hf_zvt_receipt_info_printing, + { "Printing is mandatory", "zvt.tlv.receipt_info.printing", + FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL } } }; static ei_register_info ei[] = { @@ -1451,6 +1508,7 @@ proto_register_zvt(void) /* register by name to allow mapping to a user DLT */ register_dissector("zvt", dissect_zvt, proto_zvt); + zvt_tcp_handle = register_dissector("zvt.tcp", dissect_zvt_tcp, proto_zvt); register_shutdown_routine(zvt_shutdown); } @@ -1459,10 +1517,6 @@ proto_register_zvt(void) void proto_reg_handoff_zvt(void) { - dissector_handle_t zvt_tcp_handle; - - zvt_tcp_handle = create_dissector_handle(dissect_zvt_tcp, proto_zvt); - dissector_add_for_decode_as_with_preference("tcp.port", zvt_tcp_handle); } |