Import of hostapd 0.4.9
[dragonfly.git] / contrib / hostapd-0.4.9 / config.h
blobdf411a562123c09bdae2f389d7f94673a265ab24
1 #ifndef CONFIG_H
2 #define CONFIG_H
4 #include "config_types.h"
6 typedef u8 macaddr[ETH_ALEN];
8 struct hostapd_radius_servers;
10 #define PMK_LEN 32
11 struct hostapd_wpa_psk {
12 struct hostapd_wpa_psk *next;
13 int group;
14 u8 psk[PMK_LEN];
15 u8 addr[ETH_ALEN];
18 #define EAP_USER_MAX_METHODS 8
19 struct hostapd_eap_user {
20 struct hostapd_eap_user *next;
21 u8 *identity;
22 size_t identity_len;
23 u8 methods[EAP_USER_MAX_METHODS];
24 u8 *password;
25 size_t password_len;
26 int phase2;
27 int force_version;
30 struct hostapd_config {
31 char iface[IFNAMSIZ + 1];
32 char bridge[IFNAMSIZ + 1];
34 const struct driver_ops *driver;
36 enum {
37 HOSTAPD_LEVEL_DEBUG_VERBOSE = 0,
38 HOSTAPD_LEVEL_DEBUG = 1,
39 HOSTAPD_LEVEL_INFO = 2,
40 HOSTAPD_LEVEL_NOTICE = 3,
41 HOSTAPD_LEVEL_WARNING = 4
42 } logger_syslog_level, logger_stdout_level;
44 #define HOSTAPD_MODULE_IEEE80211 BIT(0)
45 #define HOSTAPD_MODULE_IEEE8021X BIT(1)
46 #define HOSTAPD_MODULE_RADIUS BIT(2)
47 #define HOSTAPD_MODULE_WPA BIT(3)
48 #define HOSTAPD_MODULE_DRIVER BIT(4)
49 #define HOSTAPD_MODULE_IAPP BIT(5)
50 unsigned int logger_syslog; /* module bitfield */
51 unsigned int logger_stdout; /* module bitfield */
53 enum { HOSTAPD_DEBUG_NO = 0, HOSTAPD_DEBUG_MINIMAL = 1,
54 HOSTAPD_DEBUG_VERBOSE = 2,
55 HOSTAPD_DEBUG_MSGDUMPS = 3,
56 HOSTAPD_DEBUG_EXCESSIVE = 4 } debug; /* debug verbosity level */
57 char *dump_log_name; /* file name for state dump (SIGUSR1) */
59 int ieee802_1x; /* use IEEE 802.1X */
60 int eapol_version;
61 int eap_server; /* Use internal EAP server instead of external
62 * RADIUS server */
63 struct hostapd_eap_user *eap_user;
64 char *eap_sim_db;
65 struct hostapd_ip_addr own_ip_addr;
66 char *nas_identifier;
67 struct hostapd_radius_servers *radius;
69 #define HOSTAPD_SSID_LEN 32
70 char ssid[HOSTAPD_SSID_LEN + 1];
71 size_t ssid_len;
72 int ssid_set;
73 char *eap_req_id_text; /* optional displayable message sent with
74 * EAP Request-Identity */
75 size_t eap_req_id_text_len;
76 int eapol_key_index_workaround;
78 size_t default_wep_key_len;
79 int individual_wep_key_len;
80 int wep_rekeying_period;
81 int eap_reauth_period;
83 int ieee802_11f; /* use IEEE 802.11f (IAPP) */
84 char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
85 * frames */
87 u8 assoc_ap_addr[ETH_ALEN];
88 int assoc_ap; /* whether assoc_ap_addr is set */
90 enum {
91 ACCEPT_UNLESS_DENIED = 0,
92 DENY_UNLESS_ACCEPTED = 1,
93 USE_EXTERNAL_RADIUS_AUTH = 2
94 } macaddr_acl;
95 macaddr *accept_mac;
96 int num_accept_mac;
97 macaddr *deny_mac;
98 int num_deny_mac;
100 #define HOSTAPD_AUTH_OPEN BIT(0)
101 #define HOSTAPD_AUTH_SHARED_KEY BIT(1)
102 int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
103 * algorithms */
105 #define HOSTAPD_WPA_VERSION_WPA BIT(0)
106 #define HOSTAPD_WPA_VERSION_WPA2 BIT(1)
107 int wpa;
108 struct hostapd_wpa_psk *wpa_psk;
109 char *wpa_passphrase;
110 char *wpa_psk_file;
111 #define WPA_KEY_MGMT_IEEE8021X BIT(0)
112 #define WPA_KEY_MGMT_PSK BIT(1)
113 int wpa_key_mgmt;
114 #define WPA_CIPHER_NONE BIT(0)
115 #define WPA_CIPHER_WEP40 BIT(1)
116 #define WPA_CIPHER_WEP104 BIT(2)
117 #define WPA_CIPHER_TKIP BIT(3)
118 #define WPA_CIPHER_CCMP BIT(4)
119 int wpa_pairwise;
120 int wpa_group;
121 int wpa_group_rekey;
122 int wpa_strict_rekey;
123 int wpa_gmk_rekey;
124 int rsn_preauth;
125 char *rsn_preauth_interfaces;
127 char *ctrl_interface; /* directory for UNIX domain sockets */
128 gid_t ctrl_interface_gid;
129 int ctrl_interface_gid_set;
131 char *ca_cert;
132 char *server_cert;
133 char *private_key;
134 char *private_key_passwd;
135 int check_crl;
137 char *radius_server_clients;
138 int radius_server_auth_port;
139 int radius_server_ipv6;
141 char *test_socket; /* UNIX domain socket path for driver_test */
143 int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group
144 * address instead of individual address
145 * (for driver_wired.c).
150 struct hostapd_config * hostapd_config_read(const char *fname);
151 void hostapd_config_free(struct hostapd_config *conf);
152 int hostapd_maclist_found(macaddr *list, int num_entries, u8 *addr);
153 const u8 * hostapd_get_psk(const struct hostapd_config *conf, const u8 *addr,
154 const u8 *prev_psk);
155 int hostapd_setup_wpa_psk(struct hostapd_config *conf);
156 const struct hostapd_eap_user *
157 hostapd_get_eap_user(const struct hostapd_config *conf, const u8 *identity,
158 size_t identity_len, int phase2);
160 #endif /* CONFIG_H */