add support for expected throughput
[project/iwinfo.git] / iwinfo_lua.c
index 94913ac..eebab8e 100644 (file)
@@ -134,21 +134,21 @@ static char * iwinfo_crypto_desc(struct iwinfo_crypto_entry *c)
                                                sprintf(desc, "mixed WPA/WPA2 %s (%s)",
                                                        iwinfo_crypto_print_suites(c->auth_suites),
                                                        iwinfo_crypto_print_ciphers(
-                                                               c->pair_ciphers & c->group_ciphers));
+                                                               c->pair_ciphers | c->group_ciphers));
                                                break;
 
                                        case 2:
                                                sprintf(desc, "WPA2 %s (%s)",
                                                        iwinfo_crypto_print_suites(c->auth_suites),
                                                        iwinfo_crypto_print_ciphers(
-                                                               c->pair_ciphers & c->group_ciphers));
+                                                               c->pair_ciphers | c->group_ciphers));
                                                break;
 
                                        case 1:
                                                sprintf(desc, "WPA %s (%s)",
                                                        iwinfo_crypto_print_suites(c->auth_suites),
                                                        iwinfo_crypto_print_ciphers(
-                                                               c->pair_ciphers & c->group_ciphers));
+                                                               c->pair_ciphers | c->group_ciphers));
                                                break;
                                }
                        }
@@ -328,6 +328,11 @@ static int iwinfo_L_assoclist(lua_State *L, int (*func)(const char *, char *, in
                        set_rateinfo(L, &e->rx_rate, true);
                        set_rateinfo(L, &e->tx_rate, false);
 
+                       if (e->thr) {
+                               lua_pushnumber(L, e->thr);
+                               lua_setfield(L, -2, "expected_throughput");
+                       }
+
                        lua_setfield(L, -2, macstr);
                }
        }