config.h

Go to the documentation of this file.
00001 
00017 #ifndef CONFIG_H
00018 #define CONFIG_H
00019 
00020 #include "defs.h"
00021 #include "ip_addr.h"
00022 #include "wpa_common.h"
00023 
00024 #ifndef IFNAMSIZ
00025 #define IFNAMSIZ 16
00026 #endif
00027 
00028 typedef u8 macaddr[ETH_ALEN];
00029 
00030 struct mac_acl_entry {
00031         macaddr addr;
00032         int vlan_id;
00033 };
00034 
00035 struct hostapd_radius_servers;
00036 struct ft_remote_r0kh;
00037 struct ft_remote_r1kh;
00038 
00039 #define HOSTAPD_MAX_SSID_LEN 32
00040 
00041 #define NUM_WEP_KEYS 4
00042 struct hostapd_wep_keys {
00043         u8 idx;
00044         u8 *key[NUM_WEP_KEYS];
00045         size_t len[NUM_WEP_KEYS];
00046         int keys_set;
00047         size_t default_len; /* key length used for dynamic key generation */
00048 };
00049 
00050 typedef enum hostap_security_policy {
00051         SECURITY_PLAINTEXT = 0,
00052         SECURITY_STATIC_WEP = 1,
00053         SECURITY_IEEE_802_1X = 2,
00054         SECURITY_WPA_PSK = 3,
00055         SECURITY_WPA = 4
00056 } secpolicy;
00057 
00058 struct hostapd_ssid {
00059         char ssid[HOSTAPD_MAX_SSID_LEN + 1];
00060         size_t ssid_len;
00061         int ssid_set;
00062 
00063         char vlan[IFNAMSIZ + 1];
00064         secpolicy security_policy;
00065 
00066         struct hostapd_wpa_psk *wpa_psk;
00067         char *wpa_passphrase;
00068         char *wpa_psk_file;
00069 
00070         struct hostapd_wep_keys wep;
00071 
00072 #define DYNAMIC_VLAN_DISABLED 0
00073 #define DYNAMIC_VLAN_OPTIONAL 1
00074 #define DYNAMIC_VLAN_REQUIRED 2
00075         int dynamic_vlan;
00076 #ifdef CONFIG_FULL_DYNAMIC_VLAN
00077         char *vlan_tagged_interface;
00078 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
00079         struct hostapd_wep_keys **dyn_vlan_keys;
00080         size_t max_dyn_vlan_keys;
00081 };
00082 
00083 
00084 #define VLAN_ID_WILDCARD -1
00085 
00086 struct hostapd_vlan {
00087         struct hostapd_vlan *next;
00088         int vlan_id; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */
00089         char ifname[IFNAMSIZ + 1];
00090         int dynamic_vlan;
00091 #ifdef CONFIG_FULL_DYNAMIC_VLAN
00092 
00093 #define DVLAN_CLEAN_BR  0x1
00094 #define DVLAN_CLEAN_VLAN        0x2
00095 #define DVLAN_CLEAN_VLAN_PORT   0x4
00096 #define DVLAN_CLEAN_WLAN_PORT   0x8
00097         int clean;
00098 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
00099 };
00100 
00101 #define PMK_LEN 32
00102 struct hostapd_wpa_psk {
00103         struct hostapd_wpa_psk *next;
00104         int group;
00105         u8 psk[PMK_LEN];
00106         u8 addr[ETH_ALEN];
00107 };
00108 
00109 #define EAP_USER_MAX_METHODS 8
00110 struct hostapd_eap_user {
00111         struct hostapd_eap_user *next;
00112         u8 *identity;
00113         size_t identity_len;
00114         struct {
00115                 int vendor;
00116                 u32 method;
00117         } methods[EAP_USER_MAX_METHODS];
00118         u8 *password;
00119         size_t password_len;
00120         int phase2;
00121         int force_version;
00122         unsigned int wildcard_prefix:1;
00123         unsigned int password_hash:1; /* whether password is hashed with
00124                                        * nt_password_hash() */
00125         int ttls_auth; /* EAP_TTLS_AUTH_* bitfield */
00126 };
00127 
00128 
00129 #define NUM_TX_QUEUES 8
00130 
00131 struct hostapd_tx_queue_params {
00132         int aifs;
00133         int cwmin;
00134         int cwmax;
00135         int burst; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */
00136         int configured;
00137 };
00138 
00139 struct hostapd_wmm_ac_params {
00140         int cwmin;
00141         int cwmax;
00142         int aifs;
00143         int txop_limit; /* in units of 32us */
00144         int admission_control_mandatory;
00145 };
00146 
00147 
00152 struct hostapd_bss_config {
00153         char iface[IFNAMSIZ + 1];
00154         char bridge[IFNAMSIZ + 1];
00155 
00156         enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
00157 
00158         unsigned int logger_syslog; /* module bitfield */
00159         unsigned int logger_stdout; /* module bitfield */
00160 
00161         char *dump_log_name; /* file name for state dump (SIGUSR1) */
00162 
00163         int max_num_sta; /* maximum number of STAs in station table */
00164 
00165         int dtim_period;
00166 
00167         int ieee802_1x; /* use IEEE 802.1X */
00168         int eapol_version;
00169         int eap_server; /* Use internal EAP server instead of external
00170                          * RADIUS server */
00171         struct hostapd_eap_user *eap_user;
00172         char *eap_sim_db;
00173         struct hostapd_ip_addr own_ip_addr;
00174         char *nas_identifier;
00175         struct hostapd_radius_servers *radius;
00176 
00177         struct hostapd_ssid ssid;
00178 
00179         char *eap_req_id_text; /* optional displayable message sent with
00180                                 * EAP Request-Identity */
00181         size_t eap_req_id_text_len;
00182         int eapol_key_index_workaround;
00183 
00184         size_t default_wep_key_len;
00185         int individual_wep_key_len;
00186         int wep_rekeying_period;
00187         int broadcast_key_idx_min, broadcast_key_idx_max;
00188         int eap_reauth_period;
00189 
00190         int ieee802_11f; /* use IEEE 802.11f (IAPP) */
00191         char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
00192                                         * frames */
00193 
00194         enum {
00195                 ACCEPT_UNLESS_DENIED = 0,
00196                 DENY_UNLESS_ACCEPTED = 1,
00197                 USE_EXTERNAL_RADIUS_AUTH = 2
00198         } macaddr_acl;
00199         struct mac_acl_entry *accept_mac;
00200         int num_accept_mac;
00201         struct mac_acl_entry *deny_mac;
00202         int num_deny_mac;
00203 
00204         int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
00205                         * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */
00206 
00207         int wpa; /* bitfield of WPA_PROTO_WPA, WPA_PROTO_RSN */
00208         int wpa_key_mgmt;
00209 #ifdef CONFIG_IEEE80211W
00210         enum mfp_options ieee80211w;
00211         /* dot11AssociationSAQueryMaximumTimeout (in TUs) */
00212         unsigned int assoc_sa_query_max_timeout;
00213         /* dot11AssociationSAQueryRetryTimeout (in TUs) */
00214         int assoc_sa_query_retry_timeout;
00215 #endif /* CONFIG_IEEE80211W */
00216         int wpa_pairwise;
00217         int wpa_group;
00218         int wpa_group_rekey;
00219         int wpa_strict_rekey;
00220         int wpa_gmk_rekey;
00221         int wpa_ptk_rekey;
00222         int rsn_pairwise;
00223         int rsn_preauth;
00224         char *rsn_preauth_interfaces;
00225         int peerkey;
00226 
00227 #ifdef CONFIG_IEEE80211R
00228         /* IEEE 802.11r - Fast BSS Transition */
00229         u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
00230         u8 r1_key_holder[FT_R1KH_ID_LEN];
00231         u32 r0_key_lifetime;
00232         u32 reassociation_deadline;
00233         struct ft_remote_r0kh *r0kh_list;
00234         struct ft_remote_r1kh *r1kh_list;
00235         int pmk_r1_push;
00236 #endif /* CONFIG_IEEE80211R */
00237 
00238         char *ctrl_interface; /* directory for UNIX domain sockets */
00239         gid_t ctrl_interface_gid;
00240         int ctrl_interface_gid_set;
00241 
00242         char *ca_cert;
00243         char *server_cert;
00244         char *private_key;
00245         char *private_key_passwd;
00246         int check_crl;
00247         char *dh_file;
00248         u8 *pac_opaque_encr_key;
00249         u8 *eap_fast_a_id;
00250         size_t eap_fast_a_id_len;
00251         char *eap_fast_a_id_info;
00252         int eap_fast_prov;
00253         int pac_key_lifetime;
00254         int pac_key_refresh_time;
00255         int eap_sim_aka_result_ind;
00256         int tnc;
00257 
00258         char *radius_server_clients;
00259         int radius_server_auth_port;
00260         int radius_server_ipv6;
00261 
00262         char *test_socket; /* UNIX domain socket path for driver_test */
00263 
00264         int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group
00265                                  * address instead of individual address
00266                                  * (for driver_wired.c).
00267                                  */
00268 
00269         int ap_max_inactivity;
00270         int ignore_broadcast_ssid;
00271 
00272         int wmm_enabled;
00273 
00274         struct hostapd_vlan *vlan, *vlan_tail;
00275 
00276         macaddr bssid;
00277 
00278         /*
00279          * Maximum listen interval that STAs can use when associating with this
00280          * BSS. If a STA tries to use larger value, the association will be
00281          * denied with status code 51.
00282          */
00283         u16 max_listen_interval;
00284 
00285         int okc; /* Opportunistic Key Caching */
00286 
00287         int wps_state;
00288 #ifdef CONFIG_WPS
00289         int ap_setup_locked;
00290         u8 uuid[16];
00291         char *wps_pin_requests;
00292         char *device_name;
00293         char *manufacturer;
00294         char *model_name;
00295         char *model_number;
00296         char *serial_number;
00297         char *device_type;
00298         char *config_methods;
00299         u8 os_version[4];
00300         char *ap_pin;
00301         int skip_cred_build;
00302         u8 *extra_cred;
00303         size_t extra_cred_len;
00304         int wps_cred_processing;
00305         u8 *ap_settings;
00306         size_t ap_settings_len;
00307         char *upnp_iface;
00308         char *friendly_name;
00309         char *manufacturer_url;
00310         char *model_description;
00311         char *model_url;
00312         char *upc;
00313 #endif /* CONFIG_WPS */
00314 };
00315 
00316 
00321 struct hostapd_config {
00322         struct hostapd_bss_config *bss, *last_bss;
00323         size_t num_bss;
00324 
00325         u16 beacon_int;
00326         int rts_threshold;
00327         int fragm_threshold;
00328         u8 send_probe_response;
00329         u8 channel;
00330         hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
00331         enum {
00332                 LONG_PREAMBLE = 0,
00333                 SHORT_PREAMBLE = 1
00334         } preamble;
00335         enum {
00336                 CTS_PROTECTION_AUTOMATIC = 0,
00337                 CTS_PROTECTION_FORCE_ENABLED = 1,
00338                 CTS_PROTECTION_FORCE_DISABLED = 2,
00339                 CTS_PROTECTION_AUTOMATIC_NO_OLBC = 3,
00340         } cts_protection_type;
00341 
00342         int *supported_rates;
00343         int *basic_rates;
00344 
00345         const struct wpa_driver_ops *driver;
00346 
00347         int ap_table_max_size;
00348         int ap_table_expiration_time;
00349 
00350         char country[3]; /* first two octets: country code as described in
00351                           * ISO/IEC 3166-1. Third octet:
00352                           * ' ' (ascii 32): all environments
00353                           * 'O': Outdoor environemnt only
00354                           * 'I': Indoor environment only
00355                           */
00356 
00357         int ieee80211d;
00358 
00359         struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES];
00360 
00361         /*
00362          * WMM AC parameters, in same order as 802.1D, i.e.
00363          * 0 = BE (best effort)
00364          * 1 = BK (background)
00365          * 2 = VI (video)
00366          * 3 = VO (voice)
00367          */
00368         struct hostapd_wmm_ac_params wmm_ac_params[4];
00369 
00370         enum {
00371                 INTERNAL_BRIDGE_DO_NOT_CONTROL = -1,
00372                 INTERNAL_BRIDGE_DISABLED = 0,
00373                 INTERNAL_BRIDGE_ENABLED = 1
00374         } bridge_packets;
00375 
00376 #ifdef CONFIG_IEEE80211N
00377         int ht_op_mode_fixed;
00378         u16 ht_capab;
00379 #endif /* CONFIG_IEEE80211N */
00380         int ieee80211n;
00381         int secondary_channel;
00382 };
00383 
00384 
00385 int hostapd_mac_comp(const void *a, const void *b);
00386 int hostapd_mac_comp_empty(const void *a);
00387 struct hostapd_config * hostapd_config_defaults(void);
00388 struct hostapd_config * hostapd_config_read(const char *fname);
00389 void hostapd_config_free(struct hostapd_config *conf);
00390 int hostapd_maclist_found(struct mac_acl_entry *list, int num_entries,
00391                           const u8 *addr, int *vlan_id);
00392 int hostapd_rate_found(int *list, int rate);
00393 int hostapd_wep_key_cmp(struct hostapd_wep_keys *a,
00394                         struct hostapd_wep_keys *b);
00395 const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf,
00396                            const u8 *addr, const u8 *prev_psk);
00397 int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf);
00398 const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan,
00399                                         int vlan_id);
00400 const struct hostapd_eap_user *
00401 hostapd_get_eap_user(const struct hostapd_bss_config *conf, const u8 *identity,
00402                      size_t identity_len, int phase2);
00403 
00404 #endif /* CONFIG_H */
00405 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:16:47 2009 for hostapd by  doxygen 1.6.1