]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - src/common/ieee802_11_common.c
WNM: Add support for SSID List element matching
[thirdparty/hostap.git] / src / common / ieee802_11_common.c
index d65675cdec810de71fe357bddd7d28df5ebdb154..98fadda1f90c1b7da6cad3320083379b8e4a3e7e 100644 (file)
@@ -97,6 +97,11 @@ static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen,
                        elems->p2p = pos;
                        elems->p2p_len = elen;
                        break;
+               case WFD_OUI_TYPE:
+                       /* Wi-Fi Alliance - WFD IE */
+                       elems->wfd = pos;
+                       elems->wfd_len = elen;
+                       break;
                case HS20_INDICATION_OUI_TYPE:
                        /* Hotspot 2.0 */
                        elems->hs20 = pos;
@@ -253,6 +258,14 @@ ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
                        elems->ht_operation = pos;
                        elems->ht_operation_len = elen;
                        break;
+               case WLAN_EID_VHT_CAP:
+                       elems->vht_capabilities = pos;
+                       elems->vht_capabilities_len = elen;
+                       break;
+               case WLAN_EID_VHT_OPERATION:
+                       elems->vht_operation = pos;
+                       elems->vht_operation_len = elen;
+                       break;
                case WLAN_EID_LINK_ID:
                        if (elen < 18)
                                break;
@@ -271,6 +284,10 @@ ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
                                break;
                        elems->bss_max_idle_period = pos;
                        break;
+               case WLAN_EID_SSID_LIST:
+                       elems->ssid_list = pos;
+                       elems->ssid_list_len = elen;
+                       break;
                default:
                        unknown++;
                        if (!show_errors)
@@ -397,3 +414,75 @@ const u8 * get_hdr_bssid(const struct ieee80211_hdr *hdr, size_t len)
                return NULL;
        }
 }
+
+
+int hostapd_config_wmm_ac(struct hostapd_wmm_ac_params wmm_ac_params[],
+                         const char *name, const char *val)
+{
+       int num, v;
+       const char *pos;
+       struct hostapd_wmm_ac_params *ac;
+
+       /* skip 'wme_ac_' or 'wmm_ac_' prefix */
+       pos = name + 7;
+       if (os_strncmp(pos, "be_", 3) == 0) {
+               num = 0;
+               pos += 3;
+       } else if (os_strncmp(pos, "bk_", 3) == 0) {
+               num = 1;
+               pos += 3;
+       } else if (os_strncmp(pos, "vi_", 3) == 0) {
+               num = 2;
+               pos += 3;
+       } else if (os_strncmp(pos, "vo_", 3) == 0) {
+               num = 3;
+               pos += 3;
+       } else {
+               wpa_printf(MSG_ERROR, "Unknown WMM name '%s'", pos);
+               return -1;
+       }
+
+       ac = &wmm_ac_params[num];
+
+       if (os_strcmp(pos, "aifs") == 0) {
+               v = atoi(val);
+               if (v < 1 || v > 255) {
+                       wpa_printf(MSG_ERROR, "Invalid AIFS value %d", v);
+                       return -1;
+               }
+               ac->aifs = v;
+       } else if (os_strcmp(pos, "cwmin") == 0) {
+               v = atoi(val);
+               if (v < 0 || v > 12) {
+                       wpa_printf(MSG_ERROR, "Invalid cwMin value %d", v);
+                       return -1;
+               }
+               ac->cwmin = v;
+       } else if (os_strcmp(pos, "cwmax") == 0) {
+               v = atoi(val);
+               if (v < 0 || v > 12) {
+                       wpa_printf(MSG_ERROR, "Invalid cwMax value %d", v);
+                       return -1;
+               }
+               ac->cwmax = v;
+       } else if (os_strcmp(pos, "txop_limit") == 0) {
+               v = atoi(val);
+               if (v < 0 || v > 0xffff) {
+                       wpa_printf(MSG_ERROR, "Invalid txop value %d", v);
+                       return -1;
+               }
+               ac->txop_limit = v;
+       } else if (os_strcmp(pos, "acm") == 0) {
+               v = atoi(val);
+               if (v < 0 || v > 1) {
+                       wpa_printf(MSG_ERROR, "Invalid acm value %d", v);
+                       return -1;
+               }
+               ac->admission_control_mandatory = v;
+       } else {
+               wpa_printf(MSG_ERROR, "Unknown wmm_ac_ field '%s'", pos);
+               return -1;
+       }
+
+       return 0;
+}