1 /* 2 * hostapd / Initialization and configuration 3 * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi> 4 * 5 * This software may be distributed under the terms of the BSD license. 6 * See README for more details. 7 */ 8 9 #ifndef HOSTAPD_H 10 #define HOSTAPD_H 11 12 #include "common/defs.h" 13 #include "ap/ap_config.h" 14 15 struct wpa_driver_ops; 16 struct wpa_ctrl_dst; 17 struct radius_server_data; 18 struct upnp_wps_device_sm; 19 struct hostapd_data; 20 struct sta_info; 21 struct hostap_sta_driver_data; 22 struct ieee80211_ht_capabilities; 23 struct full_dynamic_vlan; 24 enum wps_event; 25 union wps_event_data; 26 27 struct hostapd_iface; 28 29 struct hapd_interfaces { 30 int (*reload_config)(struct hostapd_iface *iface); 31 struct hostapd_config * (*config_read_cb)(const char *config_fname); 32 int (*ctrl_iface_init)(struct hostapd_data *hapd); 33 void (*ctrl_iface_deinit)(struct hostapd_data *hapd); 34 int (*for_each_interface)(struct hapd_interfaces *interfaces, 35 int (*cb)(struct hostapd_iface *iface, 36 void *ctx), void *ctx); 37 int (*driver_init)(struct hostapd_iface *iface); 38 39 size_t count; 40 int global_ctrl_sock; 41 char *global_iface_path; 42 char *global_iface_name; 43 struct hostapd_iface **iface; 44 }; 45 46 47 struct hostapd_probereq_cb { 48 int (*cb)(void *ctx, const u8 *sa, const u8 *da, const u8 *bssid, 49 const u8 *ie, size_t ie_len, int ssi_signal); 50 void *ctx; 51 }; 52 53 #define HOSTAPD_RATE_BASIC 0x00000001 54 55 struct hostapd_rate_data { 56 int rate; /* rate in 100 kbps */ 57 int flags; /* HOSTAPD_RATE_ flags */ 58 }; 59 60 struct hostapd_frame_info { 61 u32 channel; 62 u32 datarate; 63 int ssi_signal; /* dBm */ 64 }; 65 66 67 /** 68 * struct hostapd_data - hostapd per-BSS data structure 69 */ 70 struct hostapd_data { 71 struct hostapd_config *iconf; 72 struct hostapd_bss_config *conf; 73 int interface_added; /* virtual interface added for this BSS */ 74 75 u8 own_addr[ETH_ALEN]; 76 77 int num_sta; /* number of entries in sta_list */ 78 79 struct wpa_authenticator *wpa_auth; 80 81 #ifdef CONFIG_FULL_DYNAMIC_VLAN 82 struct full_dynamic_vlan *full_dynamic_vlan; 83 #endif /* CONFIG_FULL_DYNAMIC_VLAN */ 84 85 #ifdef CONFIG_WPS 86 unsigned int ap_pin_failures; 87 unsigned int ap_pin_failures_consecutive; 88 struct upnp_wps_device_sm *wps_upnp; 89 unsigned int ap_pin_lockout_time; 90 #endif /* CONFIG_WPS */ 91 92 #ifdef CONFIG_P2P 93 struct p2p_data *p2p; 94 struct p2p_group *p2p_group; 95 struct wpabuf *p2p_beacon_ie; 96 struct wpabuf *p2p_probe_resp_ie; 97 98 /* Number of non-P2P association stations */ 99 int num_sta_no_p2p; 100 101 /* Periodic NoA (used only when no non-P2P clients in the group) */ 102 int noa_enabled; 103 int noa_start; 104 int noa_duration; 105 #endif /* CONFIG_P2P */ 106 #ifdef CONFIG_INTERWORKING 107 size_t gas_frag_limit; 108 #endif /* CONFIG_INTERWORKING */ 109 110 #ifdef CONFIG_SQLITE 111 struct hostapd_eap_user tmp_eap_user; 112 #endif /* CONFIG_SQLITE */ 113 }; 114 115 #endif /* HOSTAPD_H */ 116