aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-05-26 08:30:56 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-05-26 08:30:56 +0000
commitfd8f1cee342d750fb76ff5d985f34967b303ae0f (patch)
treec49f9891ab2c184d7517f0a66858c7ea1e210ef1
parent604000a6b39623daff9eef80c913b5ff5e9e3092 (diff)
protocols running atop ACL/L2CAP needs to be able to track pdus based on
acl chandle + direction + l2cap-CID to uniquely identify a single specific flow of PDU packets. So we need to pass the chandle upp from acl to l2cap at least. It would have been nice to handle this using "conversations" but the bluetooth stack does not eaily map to the idiom host:port<->host:port instead in bluetooth you have unidirectional flows that are identified by ACL-chandle:L2CAP-CID:direction and additional state held inside l2cap would attach two such flows together into a "conversation". Bluetooth packets themself only indentify "half" of the two way conversation. svn path=/trunk/; revision=18218
-rw-r--r--epan/dissectors/Makefile.common1
-rw-r--r--epan/dissectors/packet-bthci_acl.c7
-rw-r--r--epan/dissectors/packet-bthci_acl.h31
3 files changed, 39 insertions, 0 deletions
diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common
index b7abad07a5..82fa2202a9 100644
--- a/epan/dissectors/Makefile.common
+++ b/epan/dissectors/Makefile.common
@@ -693,6 +693,7 @@ DISSECTOR_INCLUDES = \
packet-bgp.h \
packet-bootparams.h \
packet-bssap.h \
+ packet-bthci_acl.h \
packet-btl2cap.h \
packet-camel.h \
packet-chdlc.h \
diff --git a/epan/dissectors/packet-bthci_acl.c b/epan/dissectors/packet-bthci_acl.c
index 1a09c8cb90..bc51fd2bab 100644
--- a/epan/dissectors/packet-bthci_acl.c
+++ b/epan/dissectors/packet-bthci_acl.c
@@ -33,8 +33,10 @@
#include <glib.h>
#include <epan/packet.h>
+#include <epan/emem.h>
#include <etypes.h>
#include <packet-hci_h4.h>
+#include <packet-bthci_acl.h>
/* Initialize the protocol and registered fields */
static int proto_btacl = -1;
@@ -75,6 +77,7 @@ dissect_btacl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int offset=0;
guint16 pb_flag, l2cap_length;
tvbuff_t *next_tvb;
+ bthci_acl_data_t *acl_data;
if(check_col(pinfo->cinfo, COL_PROTOCOL)){
col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_ACL");
@@ -92,6 +95,10 @@ dissect_btacl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(btacl_tree, hf_btacl_bc_flag, tvb, offset, 2, TRUE);
offset+=2;
+ acl_data=ep_alloc(sizeof(bthci_acl_data_t));
+ pinfo->private_data=acl_data;
+ acl_data->chandle=flags&0x0fff;
+
length = tvb_get_letohs(tvb, offset);
proto_tree_add_item(btacl_tree, hf_btacl_length, tvb, offset, 2, TRUE);
diff --git a/epan/dissectors/packet-bthci_acl.h b/epan/dissectors/packet-bthci_acl.h
new file mode 100644
index 0000000000..c2f4a3ee94
--- /dev/null
+++ b/epan/dissectors/packet-bthci_acl.h
@@ -0,0 +1,31 @@
+/* packet-bthci_acl.h
+ *
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __PACKET_BTHCI_ACL_H__
+#define __PACKET_BTHCI_ACL_H__
+
+typedef struct _bthci_acl_data_t {
+ guint16 chandle; /* only low 12 bits used */
+} bthci_acl_data_t;
+
+#endif