Search Linux Wireless

[PATCH] iw: print out mesh configuration element on scan

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

 



Print out mesh configuration element which will be useful for
decision making whether to join or not join the mesh network.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@xxxxxxxxx>
---
 scan.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/scan.c b/scan.c
index 6d770d3..4fb0f23 100644
--- a/scan.c
+++ b/scan.c
@@ -787,6 +787,37 @@ static void print_bss_load(const uint8_t type, uint8_t len, const uint8_t *data)
 	printf("\t\t * available admission capacity: %d [*32us]\n", (data[4] << 8) | data[3]);
 }
 
+static void print_mesh_conf(const uint8_t type, uint8_t len, const uint8_t *data)
+{
+	printf("\n");
+	printf("\t\t * Active Path Selection Protocol ID: %d\n", data[0]);
+	printf("\t\t * Active Path Selection Metric ID: %d\n", data[1]);
+	printf("\t\t * Congestion Control Mode ID: %d\n", data[2]);
+	printf("\t\t * Synchronization Method ID: %d\n", data[3]);
+	printf("\t\t * Authentication Protocol ID: %d\n", data[4]);
+	printf("\t\t * Mesh Formation Info:\n");
+	printf("\t\t\t Number of Peerings: %d\n", (data[5] & 0x7E) >> 1);
+	if (data[5] & 0x01)
+		printf("\t\t\t Connected to Mesh Gate\n");
+	if (data[5] & 0x80)
+		printf("\t\t\t Connected to AS\n");
+	printf("\t\t * Mesh Capability\n");
+	if (data[6] & 0x01)
+		printf("\t\t\t Accepting Additional Mesh Peerings\n");
+	if (data[6] & 0x02)
+		printf("\t\t\t MCCA Supported\n");
+	if (data[6] & 0x04)
+		printf("\t\t\t MCCA Enabled\n");
+	if (data[6] & 0x08)
+		printf("\t\t\t Forwarding\n");
+	if (data[6] & 0x10)
+		printf("\t\t\t MBCA Supported\n");
+	if (data[6] & 0x20)
+		printf("\t\t\t TBTT Adjusting\n");
+	if (data[6] & 0x40)
+		printf("\t\t\t Mesh Power Save Level\n");
+}
+
 struct ie_print {
 	const char *name;
 	void (*print)(const uint8_t type, uint8_t len, const uint8_t *data);
@@ -846,6 +877,7 @@ static const struct ie_print ieprinters[] = {
 	[192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), },
 	[48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), },
 	[50] = { "Extended supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
+	[113] = { "MESH Configuration", print_mesh_conf, 7, 7, BIT(PRINT_SCAN), },
 	[114] = { "MESH ID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), },
 	[127] = { "Extended capabilities", print_capabilities, 0, 255, BIT(PRINT_SCAN), },
 };
-- 
1.7.0.4

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




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux