summaryrefslogtreecommitdiff
path: root/monitor/bnep.c
diff options
context:
space:
mode:
authorGowtham Anandha Babu <gowtham.ab@samsung.com>2015-04-21 14:44:27 +0530
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-04-23 17:10:28 +0200
commitf83bca62821c556290dd0cea74659f3bac0aefd0 (patch)
treea600062b4e60d31beb3f8bc1315e6dcbb2c48b23 /monitor/bnep.c
parent6939f973ff2c23a6f7bc8034e74deccc3eb6f26d (diff)
downloadbluez-f83bca62821c556290dd0cea74659f3bac0aefd0.tar.gz
monitor: Add support for decoding bnep Compressed pkt
BNEP: Compressed Ethernet (0x02|0) [proto 0x0300] 3c 3b 3a 39 38 37 36 35 34 33 32 31 30 2f 2e 2d 2c 2b 2a 29 28 27 26 25 24 23 22 21 20 1f 1e 1d
Diffstat (limited to 'monitor/bnep.c')
-rw-r--r--monitor/bnep.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/monitor/bnep.c b/monitor/bnep.c
index d417e2fa4..1735a7ae7 100644
--- a/monitor/bnep.c
+++ b/monitor/bnep.c
@@ -142,6 +142,20 @@ static bool bnep_control(struct bnep_frame *bnep_frame,
return true;
}
+static bool bnep_compressed(struct bnep_frame *bnep_frame,
+ uint8_t indent, int hdr_len)
+{
+
+ struct l2cap_frame *frame = &bnep_frame->l2cap_frame;
+
+ if (!l2cap_frame_get_be16(frame, &proto))
+ return false;
+
+ print_field("%*c[proto 0x%04x] ", indent, ' ', proto);
+
+ return true;
+}
+
struct bnep_data {
uint8_t type;
const char *str;
@@ -151,7 +165,7 @@ struct bnep_data {
static const struct bnep_data bnep_table[] = {
{ 0x00, "General Ethernet", bnep_general },
{ 0x01, "Control", bnep_control },
- { 0x02, "Compressed Ethernet", },
+ { 0x02, "Compressed Ethernet", bnep_compressed },
{ 0x03, "Compressed Ethernet SrcOnly", },
{ 0x04, "Compressed Ethernet DestOnly", },
{ }