diff options
author | Michael Mann <mmann78@netscape.net> | 2017-11-02 20:55:23 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-11-05 23:17:32 +0000 |
commit | 23afd28daf7a8ccbdba395e83fed79c0ca352f50 (patch) | |
tree | 6d012d4a832beea463e329cdeb85e45f03bf925b | |
parent | 08bf89f4877b65a6a31c33023d8022bf9d94d1b6 (diff) |
Convert TIPC to use endpoint conversations
Change-Id: Iab03ebbfc982bf7182851f63c17fa59bc71d7709
Reviewed-on: https://code.wireshark.org/review/24219
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/address.h | 1 | ||||
-rw-r--r-- | epan/conversation.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-exported_pdu.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-tipc.c | 14 | ||||
-rw-r--r-- | epan/exported_pdu.c | 2 | ||||
-rw-r--r-- | epan/to_str.c | 1 |
6 files changed, 7 insertions, 16 deletions
diff --git a/epan/address.h b/epan/address.h index 3c1cc43a54..d2b9af13ce 100644 --- a/epan/address.h +++ b/epan/address.h @@ -365,7 +365,6 @@ typedef enum { PT_EXCHG, /* Fibre Channel exchange */ PT_DDP, /* DDP AppleTalk connection */ PT_IDP, /* XNS IDP sockets */ - PT_TIPC, /* TIPC PORT */ PT_USB, /* USB endpoint 0xffff means the host */ PT_I2C, PT_IBQP, /* Infiniband QP number */ diff --git a/epan/conversation.c b/epan/conversation.c index d337a94b44..b0bfd54f07 100644 --- a/epan/conversation.c +++ b/epan/conversation.c @@ -1406,8 +1406,6 @@ endpoint_type conversation_pt_to_endpoint_type(port_type pt) return ENDPOINT_DDP; case PT_IDP: return ENDPOINT_IDP; - case PT_TIPC: - return ENDPOINT_TIPC; case PT_USB: return ENDPOINT_USB; case PT_I2C: diff --git a/epan/dissectors/packet-exported_pdu.c b/epan/dissectors/packet-exported_pdu.c index ae75ce6a98..390a205d86 100644 --- a/epan/dissectors/packet-exported_pdu.c +++ b/epan/dissectors/packet-exported_pdu.c @@ -154,8 +154,6 @@ static port_type exp_pdu_old_to_new_port_type(guint type) return PT_DDP; case OLD_PT_IDP: return PT_IDP; - case OLD_PT_TIPC: - return PT_TIPC; case OLD_PT_USB: return PT_USB; case OLD_PT_I2C: @@ -164,6 +162,7 @@ static port_type exp_pdu_old_to_new_port_type(guint type) return PT_IBQP; case OLD_PT_BLUETOOTH: return PT_BLUETOOTH; + case OLD_PT_TIPC: case OLD_PT_TDMOP: case OLD_PT_NCP: case OLD_PT_SBCCS: diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c index 8cbefbd99e..3dd4289814 100644 --- a/epan/dissectors/packet-tipc.c +++ b/epan/dissectors/packet-tipc.c @@ -2141,7 +2141,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ proto_item *ti, *item; proto_tree *tipc_tree, *tipc_data_tree; int offset = 0; - guint32 dword; + guint32 srcport, destport = 0, dword; guint8 version; guint32 msg_size; guint8 hdr_size; @@ -2293,16 +2293,14 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ break; } - dword = tvb_get_ntohl(tipc_tvb, offset); - pinfo->ptype = PT_TIPC; - pinfo->srcport = dword; - proto_tree_add_item(tipc_tree, hf_tipc_org_port, tipc_tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item_ret_uint(tipc_tree, hf_tipc_org_port, tipc_tvb, offset, 4, ENC_BIG_ENDIAN, &srcport); offset = offset + 4; if (user != TIPC_NAME_DISTRIBUTOR) { - dword = tvb_get_ntohl(tipc_tvb, offset); - pinfo->destport = dword; - proto_tree_add_item(tipc_tree, hf_tipc_dst_port, tipc_tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item_ret_uint(tipc_tree, hf_tipc_dst_port, tipc_tvb, offset, 4, ENC_BIG_ENDIAN, &destport); } + + conversation_create_endpoint(pinfo, &pinfo->src, &pinfo->dst, ENDPOINT_TIPC, srcport, destport, 0); + offset = offset + 4; /* 20 - 24 Bytes 20 bytes: Used in subnetwork local, connection oriented messages, where error code, reroute diff --git a/epan/exported_pdu.c b/epan/exported_pdu.c index 18194ab9e1..b271135e6d 100644 --- a/epan/exported_pdu.c +++ b/epan/exported_pdu.c @@ -122,8 +122,6 @@ static guint exp_pdu_new_to_old_port_type(port_type pt) return OLD_PT_DDP; case PT_IDP: return OLD_PT_IDP; - case PT_TIPC: - return OLD_PT_TIPC; case PT_USB: return OLD_PT_USB; case PT_I2C: diff --git a/epan/to_str.c b/epan/to_str.c index 83f9470084..db83dc04c0 100644 --- a/epan/to_str.c +++ b/epan/to_str.c @@ -1140,7 +1140,6 @@ port_type_to_str (port_type type) case PT_EXCHG: return "FC EXCHG"; case PT_DDP: return "DDP"; case PT_IDP: return "IDP"; - case PT_TIPC: return "TIPC"; case PT_USB: return "USB"; case PT_I2C: return "I2C"; case PT_IBQP: return "IBQP"; |