[PATCH 4/5] monitor: Add support for decoding bnep SrcOnly pkt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



      BNEP: Compressed Ethernet SrcOnly (0x03|0)
         src 00:00:00:00:00:00 [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
---
 monitor/bnep.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/monitor/bnep.c b/monitor/bnep.c
index 1735a7a..5904367 100644
--- a/monitor/bnep.c
+++ b/monitor/bnep.c
@@ -156,6 +156,27 @@ static bool bnep_compressed(struct bnep_frame *bnep_frame,
 	return true;
 }
 
+static bool bnep_src_only(struct bnep_frame *bnep_frame,
+					uint8_t indent,	int hdr_len)
+{
+
+	struct l2cap_frame *frame;
+	char src_addr[20];
+
+	if (!get_macaddr(bnep_frame, src_addr))
+		return false;
+
+	frame = &bnep_frame->l2cap_frame;
+
+	if (!l2cap_frame_get_be16(frame, &proto))
+		return false;
+
+	print_field("%*csrc %s [proto 0x%04x] ", indent,
+					' ', src_addr, proto);
+
+	return true;
+}
+
 struct bnep_data {
 	uint8_t type;
 	const char *str;
@@ -166,7 +187,7 @@ static const struct bnep_data bnep_table[] = {
 	{ 0x00, "General Ethernet",		bnep_general	},
 	{ 0x01, "Control",			bnep_control	},
 	{ 0x02, "Compressed Ethernet",		bnep_compressed	},
-	{ 0x03, "Compressed Ethernet SrcOnly",			},
+	{ 0x03, "Compressed Ethernet SrcOnly",	bnep_src_only	},
 	{ 0x04, "Compressed Ethernet DestOnly",			},
 	{ }
 };
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux