Do not store dynamic HT IEs in configuration structures
[libeap.git] / hostapd / config.c
index 57fbb75..16f2a8e 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * hostapd / Configuration file
  * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2007-2008, Intel Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -244,6 +245,14 @@ static struct hostapd_config * hostapd_config_defaults(void)
        conf->wme_ac_params[2] = ac_vi;
        conf->wme_ac_params[3] = ac_vo;
 
+#ifdef CONFIG_IEEE80211N
+       SET_2BIT_LE16(&bss->ht_capab,
+                     HT_CAP_INFO_MIMO_PWR_SAVE_OFFSET,
+                     MIMO_PWR_NO_LIMIT_ON_MIMO_SEQS);
+
+       bss->ht_capab |= HT_CAP_INFO_GREEN_FIELD;
+#endif /* CONFIG_IEEE80211N */
+
        return conf;
 }
 
@@ -369,7 +378,7 @@ static int hostapd_config_read_wpa_psk(const char *fname,
                        ret = -1;
                        break;
                }
-               if (os_memcmp(addr, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0)
+               if (is_zero_ether_addr(addr))
                        psk->group = 1;
                else
                        os_memcpy(psk->addr, addr, ETH_ALEN);
@@ -1474,6 +1483,10 @@ struct hostapd_config * hostapd_config_read(const char *fname)
                } else if (os_strcmp(buf, "eap_sim_aka_result_ind") == 0) {
                        bss->eap_sim_aka_result_ind = atoi(pos);
 #endif /* EAP_SIM */
+#ifdef EAP_TNC
+               } else if (os_strcmp(buf, "tnc") == 0) {
+                       bss->tnc = atoi(pos);
+#endif /* EAP_TNC */
 #endif /* EAP_SERVER */
                } else if (os_strcmp(buf, "eap_message") == 0) {
                        char *term;
@@ -1852,6 +1865,11 @@ struct hostapd_config * hostapd_config_read(const char *fname)
                                printf("Line %d: invalid rate list\n", line);
                                errors++;
                        }
+               } else if (os_strcmp(buf, "preamble") == 0) {
+                       if (atoi(pos))
+                               conf->preamble = SHORT_PREAMBLE;
+                       else
+                               conf->preamble = LONG_PREAMBLE;
                } else if (os_strcmp(buf, "ignore_broadcast_ssid") == 0) {
                        bss->ignore_broadcast_ssid = atoi(pos);
                } else if (os_strcmp(buf, "bridge_packets") == 0) {
@@ -1929,8 +1947,14 @@ struct hostapd_config * hostapd_config_read(const char *fname)
                } else if (os_strcmp(buf, "ieee80211w") == 0) {
                        bss->ieee80211w = atoi(pos);
 #endif /* CONFIG_IEEE80211W */
+#ifdef CONFIG_IEEE80211N
+               } else if (os_strcmp(buf, "ieee80211n") == 0) {
+                       bss->ieee80211n = atoi(pos);
+#endif /* CONFIG_IEEE80211N */
                } else if (os_strcmp(buf, "max_listen_interval") == 0) {
                        bss->max_listen_interval = atoi(pos);
+               } else if (os_strcmp(buf, "okc") == 0) {
+                       bss->okc = atoi(pos);
                } else {
                        printf("Line %d: unknown configuration item '%s'\n",
                               line, buf);