aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/main.c
Commit message (Collapse)AuthorAgeFilesLines
* Find correct driver for interface additions/removalsRoy Marples2016-03-221-1/+2
| | | | | | | | | Interface additions/removals are not guaranteed to be for the driver listening to the kernel events. As such, send the events to wpa_supplicant_event_global() which can then pick the correct interface registered with wpa_supplicant to send the event to. Signed-off-by: Roy Marples <roy@marples.name>
* hostapd: Use ifname of the current context in debug messagesEliad Peller2016-03-061-3/+2
| | | | | | | In case of multiple BSS configuration, return the current interface name, instead of the first one. Signed-off-by: Eliad Peller <eliad@wizery.com>
* hostapd: Allow UDP ctrl_iface configuration to set the UDP portJanusz Dziedzic2016-03-051-0/+6
| | | | | | | | | | | | | This allows the UDP port to be set for the per-interface and global control interfaces. The format is: udp:<port_no> For example: hostapd -ddt -g udp:8888 And in the configuration file: ctrl_interface=udp:8877 Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
* hostapd: Use common functions for ctrl_ifaceJanusz Dziedzic2016-03-051-1/+1
| | | | | | Use the common functions, structures when UNIX socket ctrl_iface used. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
* eloop: Add eloop_sock_requeue()Roy Marples2016-02-071-3/+10
| | | | | | | This function can be used to re-build eloop socket tables after forking for eloop implementations that need this. Signed-off-by: Roy Marples <roy@marples.name>
* Update copyright notices for the new year 2016Jouni Malinen2016-01-011-2/+2
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* hostapd: Add feature to start all interfaces at the same time in syncSrinivasa Duvvuri2015-10-281-1/+8
| | | | | | | | | | | | | | | | | | | | When multiple interfaces across mutiple radios are started using a single instance of hostapd, they all come up at different times depending upon how long the ACS and HT scan take on each radio. This will result in stations (that already have the AP profile) associating with the first interfaces that comes up. For example in a dual band radio case (2G and 5G) with ACS enabled, 2G always comes up first because the ACS scan takes less time on 2G and this results in all stations associating with the 2G interface first. This feature brings up all the interfaces at the same time. The list of interfaces specified via hostapd.conf files on the command line are all marked as sync interfaces. All the interfaces are synchronized in hostapd_setup_interface_complete(). This feature is turned on with '-S' commmand line option. Signed-off-by: Srinivasa Duvvuri <sduvvuri@chromium.org>
* Add shared periodic cleanup function for AP modeJouni Malinen2015-07-201-0/+26
| | | | | | | | | This new mechanism can be used to combine multiple periodic AP (including P2P GO) task into a single eloop timeout to minimize number of wakeups for the process. hostapd gets its own periodic caller and wpa_supplicant uses the previously added timer to trigger these calls. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* FST: Integration into hostapdAnton Nayshtut2015-07-161-0/+14
| | | | | | This commit integrates the FST into the hostapd. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Global control interface notificationsAnton Nayshtut2015-07-161-0/+1
| | | | | | | | | | This commit implements hostapd global control interface notifications infrastructure. hostapd global control interface clients issue ATTACH/DETACH commands to register and deregister with hostapd correspondingly - the same way as for any other hostapd/wpa_supplicant control interface. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix spelling of initialize in a comment and an error messageJouni Malinen2015-06-101-1/+1
| | | | Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Update copyright notices for the new year 2015Jouni Malinen2015-01-261-2/+2
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* hostapd: Set stdout line-bufferedPaul Stewart2014-12-291-0/+2
| | | | | | | | | If hostapd will use stdout for debugging, set stdout to be line buffered in case its output is redirected to a file. This allows incremental output to be viewed immediately instead of at the file buffering interval. Signed-hostap: Paul Stewart <pstew@chromium.org>
* Clean up debug prints to use wpa_printf()Jouni Malinen2014-12-261-1/+1
| | | | | | | This converts most of the remaining perror() and printf() calls from hostapd and wpa_supplicant to use wpa_printf(). Signed-off-by: Jouni Malinen <j@w1.fi>
* Add hostapd driver_params config parameterJouni Malinen2014-11-291-0/+1
| | | | | | | This is mainly for development testing purposes to allow driver_nl80211 behavior to be modified. Signed-off-by: Jouni Malinen <j@w1.fi>
* Remove forgotten driver_test.c variablesJouni Malinen2014-11-291-3/+0
| | | | | | | hostapd was still providing couple of parameters that were used only in the already removed driver_test.c framework. Signed-off-by: Jouni Malinen <j@w1.fi>
* hostapd: Add wowlan_triggers config paramDmitry Shmidt2014-11-161-0/+9
| | | | | | | | | | New kernels in wiphy_suspend() will call cfg80211_leave_all() that will eventually end up in cfg80211_stop_ap() unless wowlan_triggers were set. For now, use the parameters from the station mode as-is. It may be desirable to extend (or constraint) this in the future for specific AP mode needs. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* HT: Let the driver advertise its supported SMPS modes for AP modeEliad Peller2014-10-231-0/+1
| | | | | | | | Add smps_modes field, and let the driver fill it with its supported SMPS modes (static/dynamic). This will let us start an AP with specific SMPS mode (e.g., dynamic) that will allow it to reduce its power usage. Signed-off-by: Eliad Peller <eliad@wizery.com>
* Add printf NULL checks to silence static analyzerSrinivas Girigowda2014-08-281-3/+4
| | | | | | | | Add NULL checks to take care of issues reported by static analyzer tool on potentially using NULL with printf format %s (which has undefined behavior even though many compilers end up printing "(null)"). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix hostapd error path regressionJouni Malinen2014-03-071-0/+2
| | | | | | | | | | Commit 354c903f8e47ae0fb41fb54ecc018e61d9573506 added setting of driver_ap_teardown on the hostapd exit path without taking into account that this may also be called on an error path where the interface has not been initialized. Fix the resulting NULL pointer dereference to allow hostapd to exit cleanly in error case. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* AP/GO interface teardown optimizationMoshe Benji2014-03-051-1/+5
| | | | | | | | | | | | | | | This commit adds an option to optimize AP teardown by leaving the deletion of keys (including group keys) and stations to the driver. This optimization option should be used if the driver supports stations and keys removal when stopping an AP. For example, the optimization option will always be used for cfg80211 drivers since cfg80211 shall always remove stations and keys when stopping an AP (in order to support cases where the AP is disabled without the knowledge of wpa_supplicant/hostapd). Signed-off-by: Moshe Benji <moshe.benji@intel.com>
* Fix theoretical NULL dereference in debug printfEytan Lifshitz2014-02-131-1/+2
| | | | | | | | In hostapd_logger_cb(), module_str is checked for NULL (on a path that does not get executed in practice), and then possibly dereferenced in snprintf() anyway. Signed-hostap: Eytan Lifshitz <eytan.lifshitz@intel.com>
* WPS: Make UUID-from-MAC Address easily availableJouni Malinen2014-02-111-1/+27
| | | | | | | | "hostapd -u<MAC Address>" can now be used to display the UUID that will be generated based on a MAC Address (i.e., when hostapd configuration does not set a specific UUID). Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Update copyright notices for the new year 2014Jouni Malinen2014-01-071-1/+1
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* Remove hostapd dump_file functionalityJouni Malinen2014-01-021-5/+1
| | | | | | | | | | This debugging mechanism has now been deprecated by the control interface commands that can be used to fetch same internal information from hostapd in a more convenient way. Leave the empty USR1 signal handler and configuration file parameter for backwards compatibility. They can be removed in future versions of hostapd. Signed-hostap: Jouni Malinen <j@w1.fi>
* Declare wpa_debug_* variables in src/utils/wpa_debug.hJouni Malinen2013-12-311-5/+0
| | | | | | | | | These were somewhat more hidden to avoid direct use, but there are now numerous places where these are needed and more justification to make the extern int declarations available from wpa_debug.h. In addition, this avoids some warnings from sparse. Signed-hostap: Jouni Malinen <j@w1.fi>
* Declare wpa_drivers in src/drivers/driver.hJouni Malinen2013-12-311-2/+0
| | | | | | This avoids some warnings from sparse. Signed-hostap: Jouni Malinen <j@w1.fi>
* hostapd: Do not terminate process on dynamic interface add failureJouni Malinen2013-11-051-0/+1
| | | | | | | | | | Limit the calls to eloop_terminate() to happen only for the initialization failure from the interfaces that we specified on the command line. This allows hostapd process to continue operating even if a dynamically added interface fails to start up. This allows the upper layer software to fix a configuration error and retry. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Document AP mode startup functionsJouni Malinen2013-11-031-1/+20
| | | | | | | This provides some more details on how interfaces and BSSes are initialized during hostapd startup. Signed-hostap: Jouni Malinen <j@w1.fi>
* Fix AP mode QoS Map configuration to be per-BSSJouni Malinen2013-11-031-9/+0
| | | | | | | | This is a per-BSS configuration parameter and as such, needs to be configured to the driver from hostapd_setup_bss() instead of hostapd_driver_init(). Signed-hostap: Jouni Malinen <j@w1.fi>
* hostapd: Remove hostapd_interface_init2()Jouni Malinen2013-11-031-11/+2
| | | | | | | | This was an unnecessary wrapper functions for calling two functions from a single place in the code. It is cleaner to just call those two functions directly. Signed-hostap: Jouni Malinen <j@w1.fi>
* hostapd: Simplify interface initializationJouni Malinen2013-11-031-12/+0
| | | | | | | | | | Use hostapd_interface_init2() for all interfaces instead of the previously used different paths for per-interface-config and per-BSS-config cases. This moves the calls to hostapd_driver_init() and hostapd_setup_interface() to happen after all configuration files have been read. Signed-hostap: Jouni Malinen <j@w1.fi>
* hostapd: Use wpa_printf() for hostapd_logger() to stdoutJouni Malinen2013-11-021-1/+1
| | | | | | | This allows log-to-file (-f command line option) to be used to redirect these messages to the same file with all the other stdout debug. Signed-hostap: Jouni Malinen <j@w1.fi>
* hostapd: Make hostapd_interface_init_bss() available externallyKyeyoon Park2013-10-311-97/+0
| | | | Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Make hostapd_init() available externallyKyeyoon Park2013-10-311-62/+2
| | | | Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Add -T Linux tracing optionJohannes Berg2013-10-311-1/+23
| | | | | | | | Just like wpa_supplicant, give hostapd the -T option to send all debug messages into the Linux tracing buffer. Enable this option for hwsim test builds by default. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
* hostapd: Allow per-BSS (vif) configuration filesJouni Malinen2013-10-291-5/+172
| | | | | | | | | | | | | | | | | | | | This provides a new option for configuring multiple virtual interfaces (BSS) that share a single radio. The new command line parameter -b<phyname>:<config file name> is used to define one or more virtual interfaces for each PHY. The first such entry for a new PHY is used to initialize the interface structure and all consecutive parameters that have the same PHY name will be added as virtual BSS entries to that interface. The radio parameters in the configuration files have to be identical. This can be used as an alternative for the bss=<ifname> separator and multiple BSSes in a single configuration file design while still allowing hostapd to control the PHY (struct hostapd_iface) as a group of virtual interfaces (struct hostapd_data) so that common radio operations like OLBC detection and HT40 co-ex scans can be done only once per real radio. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Make hostapd_config::bss array of pointersJouni Malinen2013-10-291-4/+5
| | | | | | | | This makes it more convenient to move BSS configuration entries between struct hostapd_config instances to clean up per-BSS configuration file design. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Interworking: Add support for QoS Mapping functionality for the APKyeyoon Park2013-10-181-0/+9
| | | | | | | | This allows QoS Map Set element to be added to (Re)Association Response frames and in QoS Map Configure frame. The QoS Mapping parameters are also made available for the driver interface. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Do not set driver MAC ACL unless driver supports thisJouni Malinen2013-05-241-0/+1
| | | | | | | | This cleans up debug log by not including comments about failed operations in case the operation is known to fail due to not being supported by the driver. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Add more messages for error pathsJouni Malinen2013-04-291-3/+11
| | | | | | | Make hostapd more verbose if something goes wrong in interface initialization. Signed-hostap: Jouni Malinen <j@w1.fi>
* hostapd: Reject configuration file without interface parameterJouni Malinen2013-04-291-7/+12
| | | | | | | | | Previously, this was initialized partially, but the interface was not really started. That could result in eloop_run() returning immediately and hostapd process getting stopped without any clear indication of a failure. [Bug 479] Signed-hostap: Jouni Malinen <j@w1.fi>
* hostapd: Show more helpful message for -g and -G errorsJouni Malinen2013-04-011-2/+6
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* hostapd/wpa_s: Use driver's extended capabilitiesJohannes Berg2013-03-311-0/+3
| | | | | | | | Some extended capabilities (I'm currently interested in "Operating Mode Notification" for VHT) are implemented by the kernel driver and exported in nl80211. Use these in hostapd/wpa_supplicant. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
* hostapd: Allow ctrl_iface group to be specified on command lineJouni Malinen2013-03-291-3/+24
| | | | | | | | | The new -G<group> command line argument can now be used to set the group for the control interfaces to enable cases where hostapd is used without a configuration file and the controlling program is not running with root user privileges. Signed-hostap: Jouni Malinen <j@w1.fi>
* Update copyright notices to include year 2013Jouni Malinen2013-01-121-1/+1
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* Allow hostapd to be started without interfacesShan Palanisamy2012-08-251-6/+8
| | | | | | | | If the control interface is enabled, allow hostapd to be started without any configuration files specific on the command line since the interfaces can be added dynamically. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Add ctrl_iface for enabling/reloading/disabling interfaceShan Palanisamy2012-08-251-15/+1
| | | | Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Add global control interfaceShan Palanisamy2012-08-251-2/+35
| | | | Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Move hostapd global callback functions into hapd_interfacesJouni Malinen2012-08-251-5/+7
| | | | | | | | These function pointers are going to be the same for each interface so there is no need to keep them in struct hostapd_iface. Moving them to struct hapd_interfaces makes it easier to add interfaces at run time. Signed-hostap: Jouni Malinen <j@w1.fi>