]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/hostapd/config.h
This commit was generated by cvs2svn to compensate for changes in r156678,
[FreeBSD/FreeBSD.git] / contrib / hostapd / config.h
1 #ifndef CONFIG_H
2 #define CONFIG_H
3
4 #include "config_types.h"
5
6 typedef u8 macaddr[ETH_ALEN];
7
8 struct hostapd_radius_servers;
9
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];
16 };
17
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;
28 };
29
30 struct hostapd_config {
31         char iface[IFNAMSIZ + 1];
32         char bridge[IFNAMSIZ + 1];
33
34         const struct driver_ops *driver;
35
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;
43
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 */
52
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) */
58
59         int ieee802_1x; /* use IEEE 802.1X */
60         int eap_server; /* Use internal EAP server instead of external
61                          * RADIUS server */
62         struct hostapd_eap_user *eap_user;
63         char *eap_sim_db;
64         struct hostapd_ip_addr own_ip_addr;
65         char *nas_identifier;
66         struct hostapd_radius_servers *radius;
67
68 #define HOSTAPD_SSID_LEN 32
69         char ssid[HOSTAPD_SSID_LEN + 1];
70         size_t ssid_len;
71         int ssid_set;
72         char *eap_req_id_text; /* optional displayable message sent with
73                                 * EAP Request-Identity */
74         size_t eap_req_id_text_len;
75         int eapol_key_index_workaround;
76
77         size_t default_wep_key_len;
78         int individual_wep_key_len;
79         int wep_rekeying_period;
80         int eap_reauth_period;
81
82         int ieee802_11f; /* use IEEE 802.11f (IAPP) */
83         char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
84                                         * frames */
85
86         u8 assoc_ap_addr[ETH_ALEN];
87         int assoc_ap; /* whether assoc_ap_addr is set */
88
89         enum {
90                 ACCEPT_UNLESS_DENIED = 0,
91                 DENY_UNLESS_ACCEPTED = 1,
92                 USE_EXTERNAL_RADIUS_AUTH = 2
93         } macaddr_acl;
94         macaddr *accept_mac;
95         int num_accept_mac;
96         macaddr *deny_mac;
97         int num_deny_mac;
98
99 #define HOSTAPD_AUTH_OPEN BIT(0)
100 #define HOSTAPD_AUTH_SHARED_KEY BIT(1)
101         int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
102                         * algorithms */
103
104 #define HOSTAPD_WPA_VERSION_WPA BIT(0)
105 #define HOSTAPD_WPA_VERSION_WPA2 BIT(1)
106         int wpa;
107         struct hostapd_wpa_psk *wpa_psk;
108         char *wpa_passphrase;
109         char *wpa_psk_file;
110 #define WPA_KEY_MGMT_IEEE8021X BIT(0)
111 #define WPA_KEY_MGMT_PSK BIT(1)
112         int wpa_key_mgmt;
113 #define WPA_CIPHER_NONE BIT(0)
114 #define WPA_CIPHER_WEP40 BIT(1)
115 #define WPA_CIPHER_WEP104 BIT(2)
116 #define WPA_CIPHER_TKIP BIT(3)
117 #define WPA_CIPHER_CCMP BIT(4)
118         int wpa_pairwise;
119         int wpa_group;
120         int wpa_group_rekey;
121         int wpa_strict_rekey;
122         int wpa_gmk_rekey;
123         int rsn_preauth;
124         char *rsn_preauth_interfaces;
125
126         char *ctrl_interface; /* directory for UNIX domain sockets */
127         gid_t ctrl_interface_gid;
128         int ctrl_interface_gid_set;
129
130         char *ca_cert;
131         char *server_cert;
132         char *private_key;
133         char *private_key_passwd;
134         int check_crl;
135
136         char *radius_server_clients;
137         int radius_server_auth_port;
138         int radius_server_ipv6;
139
140         char *test_socket; /* UNIX domain socket path for driver_test */
141
142         int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group
143                                  * address instead of individual address
144                                  * (for driver_wired.c).
145                                  */
146 };
147
148
149 struct hostapd_config * hostapd_config_read(const char *fname);
150 void hostapd_config_free(struct hostapd_config *conf);
151 int hostapd_maclist_found(macaddr *list, int num_entries, u8 *addr);
152 const u8 * hostapd_get_psk(const struct hostapd_config *conf, const u8 *addr,
153                            const u8 *prev_psk);
154 int hostapd_setup_wpa_psk(struct hostapd_config *conf);
155 const struct hostapd_eap_user *
156 hostapd_get_eap_user(const struct hostapd_config *conf, const u8 *identity,
157                      size_t identity_len, int phase2);
158
159 #endif /* CONFIG_H */