wpa_supplicant / hostapd
2.5
|
hostapd / Initialization and configuration More...
Go to the source code of this file.
Data Structures | |
struct | hapd_interfaces |
struct | hostapd_probereq_cb |
struct | hostapd_rate_data |
struct | hostapd_frame_info |
struct | wps_stat |
struct | hostapd_data |
hostapd per-BSS data structure More... | |
struct | hostapd_sta_info |
struct | hostapd_iface |
hostapd per-interface data structure More... | |
Macros | |
#define | HOSTAPD_RATE_BASIC 0x00000001 |
#define | STA_HASH_SIZE 256 |
#define | STA_HASH(sta) (sta[5]) |
#define | AID_WORDS ((2008 + 31) / 32) |
Functions | |
int | hostapd_for_each_interface (struct hapd_interfaces *interfaces, int(*cb)(struct hostapd_iface *iface, void *ctx), void *ctx) |
int | hostapd_reload_config (struct hostapd_iface *iface) |
struct hostapd_data * | hostapd_alloc_bss_data (struct hostapd_iface *hapd_iface, struct hostapd_config *conf, struct hostapd_bss_config *bss) |
Allocate and initialize per-BSS data. More... | |
int | hostapd_setup_interface (struct hostapd_iface *iface) |
Setup of an interface. More... | |
int | hostapd_setup_interface_complete (struct hostapd_iface *iface, int err) |
Complete interface setup. More... | |
void | hostapd_interface_deinit (struct hostapd_iface *iface) |
void | hostapd_interface_free (struct hostapd_iface *iface) |
struct hostapd_iface * | hostapd_init (struct hapd_interfaces *interfaces, const char *config_file) |
Allocate and initialize per-interface data. More... | |
struct hostapd_iface * | hostapd_interface_init_bss (struct hapd_interfaces *interfaces, const char *phy, const char *config_fname, int debug) |
Read configuration file and init BSS data. More... | |
void | hostapd_new_assoc_sta (struct hostapd_data *hapd, struct sta_info *sta, int reassoc) |
Notify that a new station associated with the AP. More... | |
void | hostapd_interface_deinit_free (struct hostapd_iface *iface) |
int | hostapd_enable_iface (struct hostapd_iface *hapd_iface) |
int | hostapd_reload_iface (struct hostapd_iface *hapd_iface) |
int | hostapd_disable_iface (struct hostapd_iface *hapd_iface) |
int | hostapd_add_iface (struct hapd_interfaces *ifaces, char *buf) |
int | hostapd_remove_iface (struct hapd_interfaces *ifaces, char *buf) |
void | hostapd_channel_list_updated (struct hostapd_iface *iface, int initiator) |
void | hostapd_set_state (struct hostapd_iface *iface, enum hostapd_iface_state s) |
const char * | hostapd_state_text (enum hostapd_iface_state s) |
int | hostapd_switch_channel (struct hostapd_data *hapd, struct csa_settings *settings) |
void | hostapd_switch_channel_fallback (struct hostapd_iface *iface, const struct hostapd_freq_params *freq_params) |
void | hostapd_cleanup_cs_params (struct hostapd_data *hapd) |
void | hostapd_periodic_iface (struct hostapd_iface *iface) |
int | hostapd_register_probereq_cb (struct hostapd_data *hapd, int(*cb)(void *ctx, const u8 *sa, const u8 *da, const u8 *bssid, const u8 *ie, size_t ie_len, int ssi_signal), void *ctx) |
void | hostapd_prune_associations (struct hostapd_data *hapd, const u8 *addr) |
Remove extraneous associations. More... | |
int | hostapd_notif_assoc (struct hostapd_data *hapd, const u8 *addr, const u8 *ie, size_t ielen, int reassoc) |
void | hostapd_notif_disassoc (struct hostapd_data *hapd, const u8 *addr) |
void | hostapd_event_sta_low_ack (struct hostapd_data *hapd, const u8 *addr) |
void | hostapd_event_connect_failed_reason (struct hostapd_data *hapd, const u8 *addr, int reason_code) |
int | hostapd_probe_req_rx (struct hostapd_data *hapd, const u8 *sa, const u8 *da, const u8 *bssid, const u8 *ie, size_t ie_len, int ssi_signal) |
void | hostapd_event_ch_switch (struct hostapd_data *hapd, int freq, int ht, int offset, int width, int cf1, int cf2) |
const struct hostapd_eap_user * | hostapd_get_eap_user (struct hostapd_data *hapd, const u8 *identity, size_t identity_len, int phase2) |
struct hostapd_data * | hostapd_get_iface (struct hapd_interfaces *interfaces, const char *ifname) |
hostapd / Initialization and configuration
struct hostapd_data* hostapd_alloc_bss_data | ( | struct hostapd_iface * | hapd_iface, |
struct hostapd_config * | conf, | ||
struct hostapd_bss_config * | bss | ||
) |
Allocate and initialize per-BSS data.
hapd_iface | Pointer to interface data |
conf | Pointer to per-interface configuration |
bss | Pointer to per-BSS configuration for this BSS |
This function is used to allocate per-BSS data structure. This data will be freed after hostapd_cleanup() is called for it during interface deinitialization.
struct hostapd_iface* hostapd_init | ( | struct hapd_interfaces * | interfaces, |
const char * | config_file | ||
) |
Allocate and initialize per-interface data.
config_file | Path to the configuration file |
This function is used to allocate main data structures for per-interface data. The allocated data buffer will be freed by calling hostapd_cleanup_iface().
struct hostapd_iface* hostapd_interface_init_bss | ( | struct hapd_interfaces * | interfaces, |
const char * | phy, | ||
const char * | config_fname, | ||
int | debug | ||
) |
Read configuration file and init BSS data.
This function is used to parse configuration file for a BSS. This BSS is added to an existing interface sharing the same radio (if any) or a new interface is created if this is the first interface on a radio. This allocate memory for the BSS. No actual driver operations are started.
This is similar to hostapd_interface_init(), but for a case where the configuration is used to add a single BSS instead of all BSSes for a radio.
void hostapd_new_assoc_sta | ( | struct hostapd_data * | hapd, |
struct sta_info * | sta, | ||
int | reassoc | ||
) |
Notify that a new station associated with the AP.
hapd | Pointer to BSS data |
sta | Pointer to the associated STA data |
reassoc | 1 to indicate this was a re-association; 0 = first association |
This function will be called whenever a station associates with the AP. It can be called from ieee802_11.c for drivers that export MLME to hostapd and from drv_callbacks.c based on driver events for drivers that take care of management frames (IEEE 802.11 authentication and association) internally.
void hostapd_prune_associations | ( | struct hostapd_data * | hapd, |
const u8 * | addr | ||
) |
Remove extraneous associations.
hapd | Pointer to BSS data for the most recent association |
addr | Associated STA address |
This function looks through all radios and BSS's for previous (stale) associations of STA. If any are found they are removed.
int hostapd_setup_interface | ( | struct hostapd_iface * | iface | ) |
Setup of an interface.
iface | Pointer to interface data. |
Initializes the driver interface, validates the configuration, and sets driver parameters based on the configuration. Flushes old stations, sets the channel, encryption, beacons, and WDS links based on the configuration.
If interface setup requires more time, e.g., to perform HT co-ex scans, ACS, or DFS operations, this function returns 0 before such operations have been completed. The pending operations are registered into eloop and will be completed from eloop callbacks. Those callbacks end up calling hostapd_setup_interface_complete() once setup has been completed.
int hostapd_setup_interface_complete | ( | struct hostapd_iface * | iface, |
int | err | ||
) |
Complete interface setup.
This function is called when previous steps in the interface setup has been completed. This can also start operations, e.g., DFS, that will require additional processing before interface is ready to be enabled. Such operations will call this function from eloop callbacks when finished.