All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iw: print out mesh configuration element on scan
@ 2013-07-12 11:17 Chun-Yeow Yeoh
  2013-07-26  8:58 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Chun-Yeow Yeoh @ 2013-07-12 11:17 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Chun-Yeow Yeoh

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@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iw: print out mesh configuration element on scan
  2013-07-12 11:17 [PATCH] iw: print out mesh configuration element on scan Chun-Yeow Yeoh
@ 2013-07-26  8:58 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2013-07-26  8:58 UTC (permalink / raw)
  To: Chun-Yeow Yeoh; +Cc: linux-wireless

On Fri, 2013-07-12 at 19:17 +0800, Chun-Yeow Yeoh wrote:
> Print out mesh configuration element which will be useful for
> decision making whether to join or not join the mesh network.

Applied, thanks.

johannes


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-26  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-12 11:17 [PATCH] iw: print out mesh configuration element on scan Chun-Yeow Yeoh
2013-07-26  8:58 ` Johannes Berg

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.