aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/Makefile.common1
-rw-r--r--epan/dissectors/packet-btrfcomm.c13
-rw-r--r--epan/dissectors/packet-btrfcomm.h37
3 files changed, 48 insertions, 3 deletions
diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common
index ba5f8c224e..4973c3bd13 100644
--- a/epan/dissectors/Makefile.common
+++ b/epan/dissectors/Makefile.common
@@ -999,6 +999,7 @@ DISSECTOR_INCLUDES = \
packet-bssgp.h \
packet-bthci_acl.h \
packet-btl2cap.h \
+ packet-btrfcomm.h \
packet-camel.h \
packet-chdlc.h \
packet-cdt.h \
diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c
index 696a4defd2..7e63493cdb 100644
--- a/epan/dissectors/packet-btrfcomm.c
+++ b/epan/dissectors/packet-btrfcomm.c
@@ -53,6 +53,7 @@
#include <epan/emem.h>
#include <epan/expert.h>
#include "packet-btl2cap.h"
+#include "packet-btrfcomm.h"
static int hf_pf = -1;
static int hf_ea = -1;
@@ -498,9 +499,6 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 frame_type, pf_flag;
guint16 frame_len;
dlci_state_t *dlci_state;
- btl2cap_data_t *l2cap_data;
-
- l2cap_data=pinfo->private_data;
ti = proto_tree_add_item(tree, proto_btrfcomm, tvb, offset, -1, TRUE);
rfcomm_tree = proto_item_add_subtree(ti, ett_btrfcomm);
@@ -593,7 +591,16 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* dissect everything as OBEX for now */
if(dlci && frame_len && btobex_handle){
tvbuff_t *next_tvb;
+ btl2cap_data_t *l2cap_data;
+ btrfcomm_data_t rfcomm_data;
+
next_tvb = tvb_new_subset(tvb, offset, frame_len, frame_len);
+
+ l2cap_data = pinfo->private_data;
+ pinfo->private_data = &rfcomm_data;
+ rfcomm_data.chandle = l2cap_data->chandle;
+ rfcomm_data.cid = l2cap_data->cid;
+ rfcomm_data.dlci = dlci;
call_dissector(btobex_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-btrfcomm.h b/epan/dissectors/packet-btrfcomm.h
new file mode 100644
index 0000000000..52e153e855
--- /dev/null
+++ b/epan/dissectors/packet-btrfcomm.h
@@ -0,0 +1,37 @@
+/* packet-btrfcomm.h
+ *
+ * $Id: packet-btrfcomm.h 32887 2010-05-19 06:01:29Z krj $
+ *
+ * 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_BTRFCOMM_H__
+#define __PACKET_BTRFCOMM_H__
+
+/* This structure is passed to higher layer protocols through
+ * pinfo->private_data so that they can track "conversations" based on
+ * chandle, cid, dlci and direction
+ */
+typedef struct _btrfcomm_data_t {
+ guint16 chandle; /* only low 12 bits used */
+ guint16 cid;
+ guint8 dlci;
+} btrfcomm_data_t;
+
+#endif