All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
To: linux-bluetooth@vger.kernel.org
Cc: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Subject: [PATCH v2 13/22] monitor/avdtp: Decode AVDTP_SECURITY_CONTROL
Date: Fri, 20 Nov 2015 15:13:31 +0100	[thread overview]
Message-ID: <1448028820-25330-14-git-send-email-andrzej.kaczmarek@codecoup.pl> (raw)
In-Reply-To: <1448028820-25330-1-git-send-email-andrzej.kaczmarek@codecoup.pl>

---
 monitor/avdtp.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/monitor/avdtp.c b/monitor/avdtp.c
index 3dfae0d..bb2409e 100644
--- a/monitor/avdtp.c
+++ b/monitor/avdtp.c
@@ -550,6 +550,33 @@ response:
 	return true;
 }
 
+static bool avdtp_security_control(struct avdtp_frame *avdtp_frame)
+{
+	struct l2cap_frame *frame = &avdtp_frame->l2cap_frame;
+	uint8_t seid;
+
+	if (avdtp_frame->hdr & 0x01)
+		goto reject;
+
+	if (avdtp_frame->hdr & 0x02)
+		goto response;
+
+	if (!l2cap_frame_get_u8(frame, &seid))
+		return false;
+
+	print_field("ACP SEID: %d", seid >> 2);
+
+	packet_hexdump(frame->data, frame->size);
+	return true;
+
+reject:
+	return avdtp_reject_common(avdtp_frame);
+
+response:
+	packet_hexdump(frame->data, frame->size);
+	return true;
+}
+
 static bool avdtp_signalling_packet(struct avdtp_frame *avdtp_frame)
 {
 	struct l2cap_frame *frame = &avdtp_frame->l2cap_frame;
@@ -636,6 +663,9 @@ static bool avdtp_signalling_packet(struct avdtp_frame *avdtp_frame)
 	case AVDTP_ABORT:
 		ret = avdtp_abort(avdtp_frame);
 		break;
+	case AVDTP_SECURITY_CONTROL:
+		ret = avdtp_security_control(avdtp_frame);
+		break;
 	default:
 		packet_hexdump(frame->data, frame->size);
 		ret = true;
-- 
2.6.2


  parent reply	other threads:[~2015-11-20 14:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 14:13 [PATCH v2 00/22] Add AVDTP/A2DP decoding to btmon Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 01/22] monitor/l2cap: Add channel sequence number Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 02/22] monitor/avdtp: Add basic decoding of AVDTP signalling Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 03/22] monitor/avdtp: Decode AVDTP_DISCOVER Andrzej Kaczmarek
2015-11-20 16:50   ` Szymon Janc
2015-11-20 14:13 ` [PATCH v2 04/22] monitor/avdtp: Decode AVDTP_GET_CAPABILITIES Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 05/22] monitor/avdtp: Decode AVDTP_SET_CONFIGURATION Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 06/22] monitor/avdtp: Decode AVDTP_GET_CONFIGURATION Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 07/22] monitor/avdtp: Decode AVDTP_RECONFIGURE Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 08/22] monitor/avdtp: Decode AVDTP_OPEN Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 09/22] monitor/avdtp: Decode AVDTP_START Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 10/22] monitor/avdtp: Decode AVDTP_CLOSE Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 11/22] monitor/avdtp: Decode AVDTP_SUSPEND Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 12/22] monitor/avdtp: Decode AVDTP_ABORT Andrzej Kaczmarek
2015-11-20 14:13 ` Andrzej Kaczmarek [this message]
2015-11-20 14:13 ` [PATCH v2 14/22] monitor/avdtp: Decode AVDTP_GET_ALL_CAPABILITIES Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 15/22] monitor/avdtp: Decode AVDTP_DELAYREPORT Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 16/22] monitor/avdtp: Decode basic Media Codec capabilities Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 17/22] monitor/avdtp: Decode basic Content Protection capabilities Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 18/22] monitor/a2dp: Decode SBC capabilities Andrzej Kaczmarek
2015-11-20 16:35   ` Szymon Janc
2015-11-20 14:13 ` [PATCH v2 19/22] monitor/a2dp: Decode MPEG-1,2 capabilities Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 20/22] monitor/a2dp: Decode AAC capabilities Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 21/22] monitor/a2dp: Decode aptX capabilities Andrzej Kaczmarek
2015-11-20 14:13 ` [PATCH v2 22/22] monitor/a2dp: Decode LDAC capabilities Andrzej Kaczmarek
2015-11-20 16:40   ` Szymon Janc
2015-11-20 16:37 ` [PATCH v2 00/22] Add AVDTP/A2DP decoding to btmon Andrzej Kaczmarek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448028820-25330-14-git-send-email-andrzej.kaczmarek@codecoup.pl \
    --to=andrzej.kaczmarek@codecoup.pl \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.