diff options
author | Michal Labedzki <michal.labedzki@tieto.com> | 2015-02-26 13:24:12 +0100 |
---|---|---|
committer | Michal Labedzki <michal.labedzki@tieto.com> | 2015-03-02 13:17:33 +0000 |
commit | 51e12e2938d7bdf73fa8ed9c0d318c6dc00a2eae (patch) | |
tree | 963c0f4dfb5b7e037a9bf45b2c330d4bc5370292 | |
parent | 701be1f052922aa00288a8c28c42ee358587b7fb (diff) |
Bluetooth: L2CAP: Add link to Connect and Disconnect frames
Add ability to jumps to connect or disconnect frame from any frame
binded to specific PSM session, what should improves analyse by user.
Change-Id: Icdf6634bf128ba83721d39cf8986cf16bfb4e7a4
Reviewed-on: https://code.wireshark.org/review/7470
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
-rw-r--r-- | epan/dissectors/packet-btl2cap.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c index 561d9ffcea..2a10f62646 100644 --- a/epan/dissectors/packet-btl2cap.c +++ b/epan/dissectors/packet-btl2cap.c @@ -131,6 +131,8 @@ static int hf_btl2cap_le_psm = -1; static int hf_btl2cap_flags_reserved = -1; static int hf_btl2cap_flags_continuation = -1; static int hf_btl2cap_data = -1; +static int hf_btl2cap_connect_in_frame = -1; +static int hf_btl2cap_disconnect_in_frame = -1; /* Initialize the subtree pointers */ static gint ett_btl2cap = -1; @@ -181,6 +183,7 @@ typedef struct _psm_data_t { guint32 remote_cid; guint16 psm; gboolean local_service; + guint32 connect_in_frame; guint32 disconnect_in_frame; config_data_t in; config_data_t out; @@ -679,6 +682,7 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, psm_data->interface_id = k_interface_id; psm_data->adapter_id = k_adapter_id; psm_data->chandle = k_chandle; + psm_data->connect_in_frame = pinfo->fd->num; psm_data->disconnect_in_frame = max_disconnect_in_frame; key[0].length = 1; @@ -2108,6 +2112,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) psm_data->remote_cid == key_cid) && psm_data->disconnect_in_frame > pinfo->fd->num) { config_data_t *config_data; + proto_item *sub_item; psm = psm_data->psm; l2cap_data->local_cid = psm_data->local_cid; @@ -2120,6 +2125,17 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) config_data = &(psm_data->in); else config_data = &(psm_data->out); + + if (psm_data->connect_in_frame > 0 && psm_data->connect_in_frame < G_MAXUINT32) { + sub_item = proto_tree_add_uint(btl2cap_tree, hf_btl2cap_connect_in_frame, tvb, 0, 0, psm_data->connect_in_frame); + PROTO_ITEM_SET_GENERATED(sub_item); + } + + if (psm_data->disconnect_in_frame > 0 && psm_data->disconnect_in_frame < G_MAXUINT32) { + sub_item = proto_tree_add_uint(btl2cap_tree, hf_btl2cap_disconnect_in_frame, tvb, 0, 0, psm_data->disconnect_in_frame); + PROTO_ITEM_SET_GENERATED(sub_item); + } + if (config_data->mode == 0) { offset = dissect_b_frame(tvb, pinfo, tree, btl2cap_tree, cid, psm, psm_data->local_service, length, offset, l2cap_data); } else { @@ -2597,6 +2613,16 @@ proto_register_btl2cap(void) FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_btl2cap_connect_in_frame, + { "Connect in frame", "btl2cap.connect_in", + FT_FRAMENUM, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_btl2cap_disconnect_in_frame, + { "Disconnect in frame", "btl2cap.disconnect_in", + FT_FRAMENUM, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, }; /* Setup protocol subtree array */ |