aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-btl2cap.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2006-05-26 22:34:33 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2006-05-26 22:34:33 +0000
commitaf3140f90c1ecb54e35fb67943de2fdfc87208fd (patch)
tree7b230b09de373f040a98d743977a818821697ce9 /epan/dissectors/packet-btl2cap.c
parent6ded651c02acccb8c875a710b9e433a0faf2b80e (diff)
pass both chandle and cid from l2cap to higher layer protocols.
higher layer protocols need the chandle, cid and direction (from pinfo) in order to identify packets for the same "conversation" (it is not a conversation per se in bluetooth butn one unidirectional flow that we track) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18220 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-btl2cap.c')
-rw-r--r--epan/dissectors/packet-btl2cap.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c
index ac41d6cb1d..74e0e66a84 100644
--- a/epan/dissectors/packet-btl2cap.c
+++ b/epan/dissectors/packet-btl2cap.c
@@ -36,6 +36,7 @@
#include <epan/packet.h>
#include <etypes.h>
#include <epan/emem.h>
+#include "packet-bthci_acl.h"
#include "packet-btl2cap.h"
/* Initialize the protocol and registered fields */
@@ -435,7 +436,11 @@ dissect_disconnrequestresponse(tvbuff_t *tvb, int offset, packet_info *pinfo _U_
-/* Code to actually dissect the packets */
+/* Code to actually dissect the packets
+ * This dissector will only be called ontop of BTHCI ACL
+ * and this dissector _REQUIRES_ that
+ * pinfo->private_data points to a valid bthci_acl_data_t structure
+ */
static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int offset=0;
@@ -445,6 +450,8 @@ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 psm;
tvbuff_t *next_tvb;
psm_data_t *psm_data;
+ bthci_acl_data_t *acl_data;
+ btl2cap_data_t *l2cap_data;
if(check_col(pinfo->cinfo, COL_PROTOCOL)){
col_set_str(pinfo->cinfo, COL_PROTOCOL, "L2CAP");
@@ -459,7 +466,6 @@ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
btl2cap_tree=proto_item_add_subtree(ti, ett_btl2cap);
}
-
length = tvb_get_letohs(tvb, offset);
proto_tree_add_item(btl2cap_tree, hf_btl2cap_length, tvb, offset, 2, TRUE);
offset+=2;
@@ -468,6 +474,11 @@ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(btl2cap_tree, hf_btl2cap_cid, tvb, offset, 2, TRUE);
offset+=2;
+ acl_data=(bthci_acl_data_t *)pinfo->private_data;
+ l2cap_data=ep_alloc(sizeof(btl2cap_data_t));
+ l2cap_data->chandle=acl_data->chandle;
+ l2cap_data->cid=cid;
+ pinfo->private_data=l2cap_data;
if(cid==0x0001){ /* This is a command packet*/
while(offset<(length+4)) {