00001
00016 #ifndef CONFIG_H
00017 #define CONFIG_H
00018
00019 #define DEFAULT_EAPOL_VERSION 1
00020 #define DEFAULT_AP_SCAN 1
00021 #define DEFAULT_FAST_REAUTH 1
00022
00023 #include "config_ssid.h"
00024
00033 struct wpa_config_blob {
00038 char *name;
00039
00044 u8 *data;
00045
00050 size_t len;
00051
00056 struct wpa_config_blob *next;
00057 };
00058
00059
00069 struct wpa_config {
00076 struct wpa_ssid *ssid;
00077
00082 struct wpa_ssid **pssid;
00083
00091 int num_prio;
00092
00104 int eapol_version;
00105
00134 int ap_scan;
00135
00189 char *ctrl_interface;
00190
00199 char *ctrl_interface_group;
00200
00210 int fast_reauth;
00211
00219 char *opensc_engine_path;
00220
00228 char *pkcs11_engine_path;
00229
00238 char *pkcs11_module_path;
00239
00249 char *driver_param;
00250
00258 unsigned int dot11RSNAConfigPMKLifetime;
00259
00267 unsigned int dot11RSNAConfigPMKReauthThreshold;
00268
00276 unsigned int dot11RSNAConfigSATimeout;
00277
00290 int update_config;
00291
00296 struct wpa_config_blob *blobs;
00297 };
00298
00299
00300
00301
00302 void wpa_config_free(struct wpa_config *ssid);
00303 void wpa_config_free_ssid(struct wpa_ssid *ssid);
00304 struct wpa_ssid * wpa_config_get_network(struct wpa_config *config, int id);
00305 struct wpa_ssid * wpa_config_add_network(struct wpa_config *config);
00306 int wpa_config_remove_network(struct wpa_config *config, int id);
00307 void wpa_config_set_network_defaults(struct wpa_ssid *ssid);
00308 int wpa_config_set(struct wpa_ssid *ssid, const char *var, const char *value,
00309 int line);
00310 char * wpa_config_get(struct wpa_ssid *ssid, const char *var);
00311 char * wpa_config_get_no_key(struct wpa_ssid *ssid, const char *var);
00312 void wpa_config_update_psk(struct wpa_ssid *ssid);
00313 int wpa_config_add_prio_network(struct wpa_config *config,
00314 struct wpa_ssid *ssid);
00315
00316 const struct wpa_config_blob * wpa_config_get_blob(struct wpa_config *config,
00317 const char *name);
00318 void wpa_config_set_blob(struct wpa_config *config,
00319 struct wpa_config_blob *blob);
00320 void wpa_config_free_blob(struct wpa_config_blob *blob);
00321 int wpa_config_remove_blob(struct wpa_config *config, const char *name);
00322 struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
00323 const char *driver_param);
00324 #ifndef CONFIG_NO_STDOUT_DEBUG
00325 void wpa_config_debug_dump_networks(struct wpa_config *config);
00326 #else
00327 #define wpa_config_debug_dump_networks(c) do { } while (0)
00328 #endif
00329
00330
00331
00332
00346 struct wpa_config * wpa_config_read(const char *name);
00347
00363 int wpa_config_write(const char *name, struct wpa_config *config);
00364
00365 #endif
00366