ap_config.h
Go to the documentation of this file.
00001 /*
00002  * hostapd / Configuration definitions and helpers functions
00003  * Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi>
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 2 as
00007  * published by the Free Software Foundation.
00008  *
00009  * Alternatively, this software may be distributed under the terms of BSD
00010  * license.
00011  *
00012  * See README and COPYING for more details.
00013  */
00014 
00015 #ifndef HOSTAPD_CONFIG_H
00016 #define HOSTAPD_CONFIG_H
00017 
00018 #include "common/defs.h"
00019 #include "ip_addr.h"
00020 #include "common/wpa_common.h"
00021 
00022 #define MAX_STA_COUNT 2007
00023 #define MAX_VLAN_ID 4094
00024 
00025 typedef u8 macaddr[ETH_ALEN];
00026 
00027 struct mac_acl_entry {
00028         macaddr addr;
00029         int vlan_id;
00030 };
00031 
00032 struct hostapd_radius_servers;
00033 struct ft_remote_r0kh;
00034 struct ft_remote_r1kh;
00035 
00036 #define HOSTAPD_MAX_SSID_LEN 32
00037 
00038 #define NUM_WEP_KEYS 4
00039 struct hostapd_wep_keys {
00040         u8 idx;
00041         u8 *key[NUM_WEP_KEYS];
00042         size_t len[NUM_WEP_KEYS];
00043         int keys_set;
00044         size_t default_len; /* key length used for dynamic key generation */
00045 };
00046 
00047 typedef enum hostap_security_policy {
00048         SECURITY_PLAINTEXT = 0,
00049         SECURITY_STATIC_WEP = 1,
00050         SECURITY_IEEE_802_1X = 2,
00051         SECURITY_WPA_PSK = 3,
00052         SECURITY_WPA = 4
00053 } secpolicy;
00054 
00055 struct hostapd_ssid {
00056         char ssid[HOSTAPD_MAX_SSID_LEN + 1];
00057         size_t ssid_len;
00058         int ssid_set;
00059 
00060         char vlan[IFNAMSIZ + 1];
00061         secpolicy security_policy;
00062 
00063         struct hostapd_wpa_psk *wpa_psk;
00064         char *wpa_passphrase;
00065         char *wpa_psk_file;
00066 
00067         struct hostapd_wep_keys wep;
00068 
00069 #define DYNAMIC_VLAN_DISABLED 0
00070 #define DYNAMIC_VLAN_OPTIONAL 1
00071 #define DYNAMIC_VLAN_REQUIRED 2
00072         int dynamic_vlan;
00073 #ifdef CONFIG_FULL_DYNAMIC_VLAN
00074         char *vlan_tagged_interface;
00075 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
00076         struct hostapd_wep_keys **dyn_vlan_keys;
00077         size_t max_dyn_vlan_keys;
00078 };
00079 
00080 
00081 #define VLAN_ID_WILDCARD -1
00082 
00083 struct hostapd_vlan {
00084         struct hostapd_vlan *next;
00085         int vlan_id; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */
00086         char ifname[IFNAMSIZ + 1];
00087         int dynamic_vlan;
00088 #ifdef CONFIG_FULL_DYNAMIC_VLAN
00089 
00090 #define DVLAN_CLEAN_BR  0x1
00091 #define DVLAN_CLEAN_VLAN        0x2
00092 #define DVLAN_CLEAN_VLAN_PORT   0x4
00093 #define DVLAN_CLEAN_WLAN_PORT   0x8
00094         int clean;
00095 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
00096 };
00097 
00098 #define PMK_LEN 32
00099 struct hostapd_wpa_psk {
00100         struct hostapd_wpa_psk *next;
00101         int group;
00102         u8 psk[PMK_LEN];
00103         u8 addr[ETH_ALEN];
00104 };
00105 
00106 #define EAP_USER_MAX_METHODS 8
00107 struct hostapd_eap_user {
00108         struct hostapd_eap_user *next;
00109         u8 *identity;
00110         size_t identity_len;
00111         struct {
00112                 int vendor;
00113                 u32 method;
00114         } methods[EAP_USER_MAX_METHODS];
00115         u8 *password;
00116         size_t password_len;
00117         int phase2;
00118         int force_version;
00119         unsigned int wildcard_prefix:1;
00120         unsigned int password_hash:1; /* whether password is hashed with
00121                                        * nt_password_hash() */
00122         int ttls_auth; /* EAP_TTLS_AUTH_* bitfield */
00123 };
00124 
00125 
00126 #define NUM_TX_QUEUES 8
00127 
00128 struct hostapd_tx_queue_params {
00129         int aifs;
00130         int cwmin;
00131         int cwmax;
00132         int burst; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */
00133         int configured;
00134 };
00135 
00136 struct hostapd_wmm_ac_params {
00137         int cwmin;
00138         int cwmax;
00139         int aifs;
00140         int txop_limit; /* in units of 32us */
00141         int admission_control_mandatory;
00142 };
00143 
00144 
00148 struct hostapd_bss_config {
00149         char iface[IFNAMSIZ + 1];
00150         char bridge[IFNAMSIZ + 1];
00151 
00152         enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
00153 
00154         unsigned int logger_syslog; /* module bitfield */
00155         unsigned int logger_stdout; /* module bitfield */
00156 
00157         char *dump_log_name; /* file name for state dump (SIGUSR1) */
00158 
00159         int max_num_sta; /* maximum number of STAs in station table */
00160 
00161         int dtim_period;
00162 
00163         int ieee802_1x; /* use IEEE 802.1X */
00164         int eapol_version;
00165         int eap_server; /* Use internal EAP server instead of external
00166                          * RADIUS server */
00167         struct hostapd_eap_user *eap_user;
00168         char *eap_sim_db;
00169         struct hostapd_ip_addr own_ip_addr;
00170         char *nas_identifier;
00171         struct hostapd_radius_servers *radius;
00172         int acct_interim_interval;
00173 
00174         struct hostapd_ssid ssid;
00175 
00176         char *eap_req_id_text; /* optional displayable message sent with
00177                                 * EAP Request-Identity */
00178         size_t eap_req_id_text_len;
00179         int eapol_key_index_workaround;
00180 
00181         size_t default_wep_key_len;
00182         int individual_wep_key_len;
00183         int wep_rekeying_period;
00184         int broadcast_key_idx_min, broadcast_key_idx_max;
00185         int eap_reauth_period;
00186 
00187         int ieee802_11f; /* use IEEE 802.11f (IAPP) */
00188         char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
00189                                         * frames */
00190 
00191         enum {
00192                 ACCEPT_UNLESS_DENIED = 0,
00193                 DENY_UNLESS_ACCEPTED = 1,
00194                 USE_EXTERNAL_RADIUS_AUTH = 2
00195         } macaddr_acl;
00196         struct mac_acl_entry *accept_mac;
00197         int num_accept_mac;
00198         struct mac_acl_entry *deny_mac;
00199         int num_deny_mac;
00200         int wds_sta;
00201 
00202         int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
00203                         * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */
00204 
00205         int wpa; /* bitfield of WPA_PROTO_WPA, WPA_PROTO_RSN */
00206         int wpa_key_mgmt;
00207 #ifdef CONFIG_IEEE80211W
00208         enum mfp_options ieee80211w;
00209         /* dot11AssociationSAQueryMaximumTimeout (in TUs) */
00210         unsigned int assoc_sa_query_max_timeout;
00211         /* dot11AssociationSAQueryRetryTimeout (in TUs) */
00212         int assoc_sa_query_retry_timeout;
00213 #endif /* CONFIG_IEEE80211W */
00214         int wpa_pairwise;
00215         int wpa_group;
00216         int wpa_group_rekey;
00217         int wpa_strict_rekey;
00218         int wpa_gmk_rekey;
00219         int wpa_ptk_rekey;
00220         int rsn_pairwise;
00221         int rsn_preauth;
00222         char *rsn_preauth_interfaces;
00223         int peerkey;
00224 
00225 #ifdef CONFIG_IEEE80211R
00226         /* IEEE 802.11r - Fast BSS Transition */
00227         u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
00228         u8 r1_key_holder[FT_R1KH_ID_LEN];
00229         u32 r0_key_lifetime;
00230         u32 reassociation_deadline;
00231         struct ft_remote_r0kh *r0kh_list;
00232         struct ft_remote_r1kh *r1kh_list;
00233         int pmk_r1_push;
00234 #endif /* CONFIG_IEEE80211R */
00235 
00236         char *ctrl_interface; /* directory for UNIX domain sockets */
00237 #ifndef CONFIG_NATIVE_WINDOWS
00238         gid_t ctrl_interface_gid;
00239 #endif /* CONFIG_NATIVE_WINDOWS */
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         int wmm_uapsd;
00274 
00275         struct hostapd_vlan *vlan, *vlan_tail;
00276 
00277         macaddr bssid;
00278 
00279         /*
00280          * Maximum listen interval that STAs can use when associating with this
00281          * BSS. If a STA tries to use larger value, the association will be
00282          * denied with status code 51.
00283          */
00284         u16 max_listen_interval;
00285 
00286         int okc; /* Opportunistic Key Caching */
00287 
00288         int wps_state;
00289 #ifdef CONFIG_WPS
00290         int ap_setup_locked;
00291         u8 uuid[16];
00292         char *wps_pin_requests;
00293         char *device_name;
00294         char *manufacturer;
00295         char *model_name;
00296         char *model_number;
00297         char *serial_number;
00298         char *device_type;
00299         char *config_methods;
00300         u8 os_version[4];
00301         char *ap_pin;
00302         int skip_cred_build;
00303         u8 *extra_cred;
00304         size_t extra_cred_len;
00305         int wps_cred_processing;
00306         u8 *ap_settings;
00307         size_t ap_settings_len;
00308         char *upnp_iface;
00309         char *friendly_name;
00310         char *manufacturer_url;
00311         char *model_description;
00312         char *model_url;
00313         char *upc;
00314 #endif /* CONFIG_WPS */
00315 };
00316 
00317 
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         enum 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         int ht_op_mode_fixed;
00371         u16 ht_capab;
00372         int ieee80211n;
00373         int secondary_channel;
00374 };
00375 
00376 
00377 int hostapd_mac_comp(const void *a, const void *b);
00378 int hostapd_mac_comp_empty(const void *a);
00379 struct hostapd_config * hostapd_config_defaults(void);
00380 void hostapd_config_defaults_bss(struct hostapd_bss_config *bss);
00381 void hostapd_config_free(struct hostapd_config *conf);
00382 int hostapd_maclist_found(struct mac_acl_entry *list, int num_entries,
00383                           const u8 *addr, int *vlan_id);
00384 int hostapd_rate_found(int *list, int rate);
00385 int hostapd_wep_key_cmp(struct hostapd_wep_keys *a,
00386                         struct hostapd_wep_keys *b);
00387 const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf,
00388                            const u8 *addr, const u8 *prev_psk);
00389 int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf);
00390 const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan,
00391                                         int vlan_id);
00392 const struct hostapd_eap_user *
00393 hostapd_get_eap_user(const struct hostapd_bss_config *conf, const u8 *identity,
00394                      size_t identity_len, int phase2);
00395 
00396 #endif /* HOSTAPD_CONFIG_H */


wpa_supplicant_node
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Jan 2 2014 11:25:12