aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Krystad <pkrystad@codeaurora.org>2012-03-05 16:14:50 -0800
committerJohan Hedberg <johan.hedberg@intel.com>2012-03-05 16:29:51 -0800
commit40b53b39a9e8f97199a735bc086dcbd3dca6560f (patch)
tree6001b7a5ace82c7b380ab41371c165e9e8f10d63
parentc80984a2d67ce8e5b5f1befdb32243a8e4d14ec8 (diff)
downloadbluez-hcidump-40b53b39a9e8f97199a735bc086dcbd3dca6560f.tar.gz
bluez-hcidump-40b53b39a9e8f97199a735bc086dcbd3dca6560f.tar.xz
bluez-hcidump-40b53b39a9e8f97199a735bc086dcbd3dca6560f.zip
Add parsing of L2CAP Create/Move Channel signals
-rw-r--r--parser/l2cap.c96
1 files changed, 96 insertions, 0 deletions
diff --git a/parser/l2cap.c b/parser/l2cap.c
index 03aa9f6..39e29a0 100644
--- a/parser/l2cap.c
+++ b/parser/l2cap.c
@@ -868,6 +868,78 @@ static void l2cap_ctrl_parse(int level, struct frame *frm, uint32_t ctrl)
printf(" F-bit");
}
+static inline void create_req(int level, l2cap_cmd_hdr *cmd, struct frame *frm)
+{
+ l2cap_create_req *h = frm->ptr;
+ uint16_t psm = btohs(h->psm);
+ uint16_t scid = btohs(h->scid);
+
+ if (p_filter(FILT_L2CAP))
+ return;
+
+ printf("Create req: psm %d scid 0x%4.4x id %d\n", psm, scid, h->id);
+}
+
+static inline void create_rsp(int level, l2cap_cmd_hdr *cmd, struct frame *frm)
+{
+ l2cap_create_rsp *h = frm->ptr;
+ uint16_t scid = btohs(h->scid);
+ uint16_t dcid = btohs(h->dcid);
+ uint16_t result = btohs(h->result);
+ uint16_t status = btohs(h->status);
+
+ if (p_filter(FILT_L2CAP))
+ return;
+
+ printf("Create rsp: dcid 0x%4.4x scid 0x%4.4x result %d status %d\n", dcid, scid, result, status);
+}
+
+static inline void move_req(int level, l2cap_cmd_hdr *cmd, struct frame *frm)
+{
+ l2cap_move_req *h = frm->ptr;
+ uint16_t icid = btohs(h->icid);
+
+ if (p_filter(FILT_L2CAP))
+ return;
+
+ printf("Move req: icid 0x%4.4x id %d\n", icid, h->id);
+}
+
+static inline void move_rsp(int level, l2cap_cmd_hdr *cmd, struct frame *frm)
+{
+ l2cap_move_rsp *h = frm->ptr;
+ uint16_t icid = btohs(h->icid);
+ uint16_t result = btohs(h->result);
+
+ if (p_filter(FILT_L2CAP))
+ return;
+
+ printf("Move rsp: icid 0x%4.4x result %d\n", icid, result);
+}
+
+static inline void move_cfm(int level, l2cap_cmd_hdr *cmd, struct frame *frm)
+{
+ l2cap_move_cfm *h = frm->ptr;
+ uint16_t icid = btohs(h->icid);
+ uint16_t result = btohs(h->result);
+
+ if (p_filter(FILT_L2CAP))
+ return;
+
+ printf("Move cfm: icid 0x%4.4x result %d\n", icid, result);
+}
+
+static inline void move_cfm_rsp(int level, l2cap_cmd_hdr *cmd, struct frame *frm)
+{
+ l2cap_move_cfm_rsp *h = frm->ptr;
+ uint16_t icid = btohs(h->icid);
+
+ if (p_filter(FILT_L2CAP))
+ return;
+
+ printf("Move cfm rsp: icid 0x%4.4x\n", icid);
+}
+
static void l2cap_parse(int level, struct frame *frm)
{
l2cap_hdr *hdr = (void *)frm->ptr;
@@ -937,6 +1009,30 @@ static void l2cap_parse(int level, struct frame *frm)
info_rsp(level, hdr, frm);
break;
+ case L2CAP_CREATE_REQ:
+ create_req(level, hdr, frm);
+ break;
+
+ case L2CAP_CREATE_RSP:
+ create_rsp(level, hdr, frm);
+ break;
+
+ case L2CAP_MOVE_REQ:
+ move_req(level, hdr, frm);
+ break;
+
+ case L2CAP_MOVE_RSP:
+ move_rsp(level, hdr, frm);
+ break;
+
+ case L2CAP_MOVE_CFM:
+ move_cfm(level, hdr, frm);
+ break;
+
+ case L2CAP_MOVE_CFM_RSP:
+ move_cfm_rsp(level, hdr, frm);
+ break;
+
default:
if (p_filter(FILT_L2CAP))
break;