dbus: Expose interface globals via D-Bus properties
[mech_eap.git] / wpa_supplicant / config.c
index 239c3e8..03b91a2 100644 (file)
@@ -15,6 +15,7 @@
 #include "rsn_supp/wpa.h"
 #include "eap_peer/eap.h"
 #include "p2p/p2p.h"
+#include "fst/fst.h"
 #include "config.h"
 
 
@@ -967,6 +968,13 @@ static int wpa_config_parse_group(const struct parse_data *data,
        val = wpa_config_parse_cipher(line, value);
        if (val == -1)
                return -1;
+
+       /*
+        * Backwards compatibility - filter out WEP ciphers that were previously
+        * allowed.
+        */
+       val &= ~(WPA_CIPHER_WEP104 | WPA_CIPHER_WEP40);
+
        if (val & ~WPA_ALLOWED_GROUP_CIPHERS) {
                wpa_printf(MSG_ERROR, "Line %d: not allowed group cipher "
                           "(0x%x).", line, val);
@@ -2262,6 +2270,7 @@ void wpa_config_free(struct wpa_config *config)
        os_free(config->osu_dir);
        os_free(config->bgscan);
        os_free(config->wowlan_triggers);
+       os_free(config->fst_group_id);
        os_free(config);
 }
 
@@ -3508,9 +3517,12 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
        config->user_mpm = DEFAULT_USER_MPM;
        config->max_peer_links = DEFAULT_MAX_PEER_LINKS;
        config->mesh_max_inactivity = DEFAULT_MESH_MAX_INACTIVITY;
+       config->dot11RSNASAERetransPeriod =
+               DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD;
        config->fast_reauth = DEFAULT_FAST_REAUTH;
        config->p2p_go_intent = DEFAULT_P2P_GO_INTENT;
        config->p2p_intra_bss = DEFAULT_P2P_INTRA_BSS;
+       config->p2p_go_freq_change_policy = DEFAULT_P2P_GO_FREQ_MOVE;
        config->p2p_go_max_inactivity = DEFAULT_P2P_GO_MAX_INACTIVITY;
        config->p2p_optimize_listen_chan = DEFAULT_P2P_OPTIMIZE_LISTEN_CHAN;
        config->p2p_go_ctwindow = DEFAULT_P2P_GO_CTWINDOW;
@@ -4121,6 +4133,7 @@ static const struct global_parse_data global_fields[] = {
        { INT(user_mpm), 0 },
        { INT_RANGE(max_peer_links, 0, 255), 0 },
        { INT(mesh_max_inactivity), 0 },
+       { INT(dot11RSNASAERetransPeriod), 0 },
 #endif /* CONFIG_MESH */
        { INT(disable_scan_offload), 0 },
        { INT(fast_reauth), 0 },
@@ -4155,8 +4168,8 @@ static const struct global_parse_data global_fields[] = {
 #endif /* CONFIG_WPS */
 #ifdef CONFIG_P2P
        { FUNC(sec_device_type), CFG_CHANGED_SEC_DEVICE_TYPE },
-       { INT(p2p_listen_reg_class), 0 },
-       { INT(p2p_listen_channel), 0 },
+       { INT(p2p_listen_reg_class), CFG_CHANGED_P2P_LISTEN_CHANNEL },
+       { INT(p2p_listen_channel), CFG_CHANGED_P2P_LISTEN_CHANNEL },
        { INT(p2p_oper_reg_class), CFG_CHANGED_P2P_OPER_CHANNEL },
        { INT(p2p_oper_channel), CFG_CHANGED_P2P_OPER_CHANNEL },
        { INT_RANGE(p2p_go_intent, 0, 15), 0 },
@@ -4164,6 +4177,7 @@ static const struct global_parse_data global_fields[] = {
        { INT_RANGE(persistent_reconnect, 0, 1), 0 },
        { INT_RANGE(p2p_intra_bss, 0, 1), CFG_CHANGED_P2P_INTRA_BSS },
        { INT(p2p_group_idle), 0 },
+       { INT_RANGE(p2p_go_freq_change_policy, 0, P2P_GO_FREQ_MOVE_MAX), 0 },
        { INT_RANGE(p2p_passphrase_len, 8, 63),
          CFG_CHANGED_P2P_PASSPHRASE_LEN },
        { FUNC(p2p_pref_chan), CFG_CHANGED_P2P_PREF_CHAN },
@@ -4227,6 +4241,11 @@ static const struct global_parse_data global_fields[] = {
        { INT(passive_scan), 0 },
        { INT(reassoc_same_bss_optim), 0 },
        { INT(wps_priority), 0},
+#ifdef CONFIG_FST
+       { STR_RANGE(fst_group_id, 1, FST_MAX_GROUP_ID_LEN), 0 },
+       { INT_RANGE(fst_priority, 1, FST_MAX_PRIO_VALUE), 0 },
+       { INT_RANGE(fst_llt, 1, FST_MAX_LLT_MS), 0 },
+#endif /* CONFIG_FST */
 };
 
 #undef FUNC
@@ -4285,6 +4304,23 @@ int wpa_config_get_value(const char *name, struct wpa_config *config,
 }
 
 
+int wpa_config_get_num_global_field_names(void)
+{
+       return NUM_GLOBAL_FIELDS;
+}
+
+
+const char * wpa_config_get_global_field_name(unsigned int i, int *no_var)
+{
+       if (i >= NUM_GLOBAL_FIELDS)
+               return NULL;
+
+       if (no_var)
+               *no_var = !global_fields[i].param1;
+       return global_fields[i].name;
+}
+
+
 int wpa_config_process_global(struct wpa_config *config, char *pos, int line)
 {
        size_t i;