diff options
author | Michael Mann <mmann78@netscape.net> | 2017-11-08 23:12:50 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-11-09 07:48:38 +0000 |
commit | 78665f5211fa9eeb3031dae2de8e551bcb2369ea (patch) | |
tree | ca4cbedebbfa9b966b3753bfc8cd78b38bcc126f /epan | |
parent | 82891e37e926040e89d4e761f93ec5c6cc0ca52a (diff) |
ISO 14443: Convert circuit API to conversation API
Change-Id: Id007a3df5442cf4d21263acb17303b6d735aaa7d
Reviewed-on: https://code.wireshark.org/review/24311
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/address.h | 3 | ||||
-rw-r--r-- | epan/conversation.h | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-iso14443.c | 33 |
3 files changed, 17 insertions, 22 deletions
diff --git a/epan/address.h b/epan/address.h index e871bca1ec..61abf2fabd 100644 --- a/epan/address.h +++ b/epan/address.h @@ -380,9 +380,6 @@ typedef enum { CT_IAX2, /* IAX2 call id */ CT_H223, /* H.223 logical channel number */ CT_BICC, /* BICC Circuit identifier */ - CT_ISO14443 /* ISO14443 connection between terminal and card - the circuit ID is always 0, there's only one - such connection */ /* Could also have ATM VPI/VCI pairs */ } circuit_type; diff --git a/epan/conversation.h b/epan/conversation.h index f6a3581765..4efe7e098b 100644 --- a/epan/conversation.h +++ b/epan/conversation.h @@ -76,7 +76,8 @@ typedef enum { ENDPOINT_IBQP, /* Infiniband QP number */ ENDPOINT_BLUETOOTH, ENDPOINT_TDMOP, - ENDPOINT_DVBCI + ENDPOINT_DVBCI, + ENDPOINT_ISO14443 } endpoint_type; /** diff --git a/epan/dissectors/packet-iso14443.c b/epan/dissectors/packet-iso14443.c index cc58046a72..cef146b192 100644 --- a/epan/dissectors/packet-iso14443.c +++ b/epan/dissectors/packet-iso14443.c @@ -40,7 +40,7 @@ #include <math.h> #include <epan/packet.h> #include <epan/expert.h> -#include <epan/circuit.h> +#include <epan/conversation.h> #include <epan/tfs.h> #include <epan/reassemble.h> #include <wiretap/wtap.h> @@ -683,7 +683,7 @@ static int dissect_iso14443_ats(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, gboolean crc_dropped) { proto_item *ti = proto_tree_get_parent(tree); - circuit_t *circuit; + conversation_t *conv; guint8 tl, t0 = 0, fsci, fwi, sfgi; proto_item *t0_it, *tb1_it, *tc1_it, *pi; proto_tree *t0_tree, *tb1_tree, *tc1_tree; @@ -693,9 +693,8 @@ static int dissect_iso14443_ats(tvbuff_t *tvb, gint offset, col_set_str(pinfo->cinfo, COL_INFO, "ATS"); proto_item_append_text(ti, ": ATS"); - circuit = circuit_new(CT_ISO14443, ISO14443_CIRCUIT_ID, pinfo->num); - circuit_add_proto_data(circuit, - proto_iso14443, GUINT_TO_POINTER((guint)ISO14443_A)); + conv = conversation_new_simple(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); + conversation_add_proto_data(conv, proto_iso14443, GUINT_TO_POINTER((guint)ISO14443_A)); offset_tl = offset; tl = tvb_get_guint8(tvb, offset); @@ -910,7 +909,7 @@ dissect_iso14443_cmd_type_attrib(tvbuff_t *tvb, packet_info *pinfo, gint offset = 0; guint8 mbli, cid; gint hl_resp_len; - circuit_t *circuit; + conversation_t *conv; if (pinfo->p2p_dir == P2P_DIR_SENT) { offset = dissect_iso14443_attrib( @@ -920,9 +919,8 @@ dissect_iso14443_cmd_type_attrib(tvbuff_t *tvb, packet_info *pinfo, col_set_str(pinfo->cinfo, COL_INFO, "Response to Attrib"); proto_item_append_text(ti, ": Response to Attrib"); - circuit = circuit_new(CT_ISO14443, ISO14443_CIRCUIT_ID, pinfo->num); - circuit_add_proto_data(circuit, - proto_iso14443, GUINT_TO_POINTER((guint)ISO14443_B)); + conv = conversation_new_simple(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); + conversation_add_proto_data(conv, proto_iso14443, GUINT_TO_POINTER((guint)ISO14443_B)); mbli = tvb_get_guint8(tvb, offset) >> 4; proto_tree_add_uint_bits_format_value(tree, hf_iso14443_mbli, @@ -1091,12 +1089,11 @@ dissect_iso14443_cmd_type_block(tvbuff_t *tvb, packet_info *pinfo, if (!crc_dropped) { iso14443_type_t t; - circuit_t *circuit; + conversation_t *conv; - circuit = find_circuit(CT_ISO14443, ISO14443_CIRCUIT_ID, pinfo->num); - if (circuit) { - t = (iso14443_type_t)GPOINTER_TO_UINT( - (gpointer)circuit_get_proto_data(circuit, proto_iso14443)); + conv = find_conversation_simple(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); + if (conv) { + t = (iso14443_type_t)GPOINTER_TO_UINT(conversation_get_proto_data(conv, proto_iso14443)); proto_tree_add_checksum(tree, tvb, offset, hf_iso14443_crc, hf_iso14443_crc_status, &ei_iso14443_wrong_crc, pinfo, @@ -1324,7 +1321,7 @@ static int dissect_iso14443(tvbuff_t *tvb, proto_item *tree_ti; proto_tree *iso14443_tree, *hdr_tree; tvbuff_t *payload_tvb; - circuit_t *circuit; + conversation_t *conv; if (tvb_captured_length(tvb) < 4) return 0; @@ -1377,9 +1374,9 @@ static int dissect_iso14443(tvbuff_t *tvb, /* all events that are not data transfers close the connection to the card (e.g. the field is switched on or off) */ - circuit = find_circuit(CT_ISO14443, ISO14443_CIRCUIT_ID, pinfo->num); - if (circuit) - close_circuit(circuit, pinfo->num); + conv = find_conversation_simple(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); + if (conv) + conv->last_frame = pinfo->num; } return offset; |