]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: print out mesh configuration element on scan
authorChun-Yeow Yeoh <yeohchunyeow@gmail.com>
Fri, 12 Jul 2013 11:17:06 +0000 (19:17 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 26 Jul 2013 08:58:21 +0000 (10:58 +0200)
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

diff --git a/scan.c b/scan.c
index 6d770d34ae7cc7b733cec7ad63a32af6c5a2eddf..4fb0f23efe483e69a0a6556072fb07a2fda51b72 100644 (file)
--- 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), },
 };