aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd_cli.c
Commit message (Collapse)AuthorAgeFilesLines
* hostapd: Add FTM range requestDavid Spinadel2016-04-171-0/+13
| | | | | | | | | | | | | | | | | | | | Add FTM range request via RRM. The AP sends Radio measurement request with FTM range request as a request for the receiving STA to send FTM requests to the given list of APs. The neighbor report part of the request is taken from the neighbor database. The control interface command is: REQ_RANGE <dst addr> <rand_int> <min_ap> <responder> [<responder>..] dst addr: MAC address of an associated STA rand_int: Randomization Interval (0..65535) in TUs min_ap: Minimum AP Count (1..15); minimum number of requested FTM ranges between the associated STA and the listed APs responder: List of BSSIDs for neighboring APs for which a measurement is requested Signed-off-by: David Spinadel <david.spinadel@intel.com>
* hostapd: Add LCI requestDavid Spinadel2016-04-171-0/+21
| | | | | | | Add a hostapd control interface command REQ_LCI to request LCI from an associated station using radio measurement. Signed-off-by: David Spinadel <david.spinadel@intel.com>
* hostapd: Add a database of neighboring APsDavid Spinadel2016-04-161-0/+45
| | | | | | | | | | | | | | | | | Add a configurable neighbor database that includes the content of Nighbor Report element, LCI and Location Civic subelements and SSID. All parameters for a neighbor must be updated at once; Neighbor Report element and SSID are mandatory, LCI and civic are optional. The age of LCI is set to the time of neighbor update. The control interface API is: SET_NEIGHBOR <BSSID> <ssid=SSID> <nr=data> [lci=<data>] [civic=<data>] To delete a neighbor use: REMOVE_NEIGHBOR <BSSID> <SSID> Signed-off-by: David Spinadel <david.spinadel@intel.com>
* PMKSA: Flush AP/mesh PMKSA cache by PMKSA_FLUSH commandMasashi Honma2016-03-201-0/+8
| | | | | | | | | This extends the wpa_supplicant PMKSA_FLUSH control interface command to allow the PMKSA list from the authenticator side to be flushed for AP and mesh mode. In addition, this adds a hostapd PMKSA_FLUSH control interface command to flush the PMKSA entries. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* PMKSA: Show AP/mesh PMKSA list in PMKSA commandMasashi Honma2016-03-201-0/+7
| | | | | | | | | This extends the wpa_supplicant PMKSA control interface command to allow the PMKSA list from the authenticator side to be listed for AP and mesh mode. In addition, this adds a hostapd PMKSA control interface command to show the same list for the AP case. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* hostapd: Add UDP support for ctrl_ifaceJanusz Dziedzic2016-03-051-0/+17
| | | | | | | | | | | | | | | Add UDP support for ctrl_iface: New config option could be set: CONFIG_CTRL_IFACE=udp CONFIG_CTRL_IFACE=udp-remote CONFIG_CTRL_IFACE=udp6 CONFIG_CTRL_IFACE=udp6-remote And hostapd_cli usage: hostapd_cli -i localhost:8877 Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
* hostapd_cli: Add support for RAW commandDedy Lansky2016-02-221-0/+55
| | | | | | | Same as for wpa_cli, RAW command is a passthrough to hostapd control interface. Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
* eloop: Add eloop_sock_requeue()Roy Marples2016-02-071-1/+1
| | | | | | | 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>
* Allow wpa_cli/hostapd_cli client socket directory to be specifiedManikandan Mohan2015-09-011-2/+15
| | | | | | | | | This adds a new helper function wpa_ctrl_open2() that can be used instead of wpa_ctrl_open() to override the default client socket directory. Add optional -s<directory path> argument to hostapd_cli and wpa_cli to allow the client socket directory to be specified. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Add support to configure debug log level at runtimeSrinivas Dasari2015-08-031-0/+20
| | | | | | | | Add support to read/configure log_level using hostapd control interface LOG_LEVEL command similarly to what was already supported in wpa_supplicant. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd_cli: Allow PID file to be specifiedMohammed Shafi Shajakhan2015-07-171-2/+5
| | | | | | | This can help when running multiple hostapd_cli instances per interface and need to kill them correspondingly. Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
* FST: Add hostapd_cli fst commandAnton Nayshtut2015-07-161-0/+32
| | | | | | This can be used to issue FST-MANAGER control interface commands. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Declare all read only data structures as constMikael Kanstrup2015-04-251-6/+6
| | | | | | | | By analysing objdump output some read only structures were found in .data section. To help compiler further optimize code declare these as const. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* Use SSID_MAX_LEN define instead of value 32 when comparing SSID lengthJouni Malinen2015-04-221-2/+3
| | | | | | This makes the implementation easier to understand. 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>
* ERP: Add ERP_FLUSH for hostapdJouni Malinen2014-12-141-0/+8
| | | | | | | This can be used to drop any pending ERP key from both the internal AP authentication server and RADIUS server use of hostapd. Signed-off-by: Jouni Malinen <j@w1.fi>
* Check os_snprintf() result more consistently - automatic 3Jouni Malinen2014-12-081-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts os_snprintf() result validation cases to use os_snprintf_error() where the comparison was 'res > size' instead of 'res >= size - 1'. These changes were done automatically with spatch using the following semantic patch: @@ identifier E1; expression E2,E3,E4,E5,E6; statement S1; @@ ( E1 = os_snprintf(E2, E3, ...); | int E1 = os_snprintf(E2, E3, ...); | if (E5) E1 = os_snprintf(E2, E3, ...); else E1 = os_snprintf(E2, E3, ...); | if (E5) E1 = os_snprintf(E2, E3, ...); else if (E6) E1 = os_snprintf(E2, E3, ...); else E1 = 0; | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else { ... return -1; } | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else if (E6) { ... E1 = os_snprintf(E2, E3, ...); } else { ... return -1; } | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else { ... E1 = os_snprintf(E2, E3, ...); } ) ? os_free(E4); - if (E1 < 0 || (size_t) E1 >= E3 - 1) + if (os_snprintf_error(E3, E1)) ( S1 | { ... } ) Signed-off-by: Jouni Malinen <j@w1.fi>
* Check os_snprintf() result more consistently - automatic 1Jouni Malinen2014-12-081-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts os_snprintf() result validation cases to use os_snprintf_error() where the exact rule used in os_snprintf_error() was used. These changes were done automatically with spatch using the following semantic patch: @@ identifier E1; expression E2,E3,E4,E5,E6; statement S1; @@ ( E1 = os_snprintf(E2, E3, ...); | int E1 = os_snprintf(E2, E3, ...); | if (E5) E1 = os_snprintf(E2, E3, ...); else E1 = os_snprintf(E2, E3, ...); | if (E5) E1 = os_snprintf(E2, E3, ...); else if (E6) E1 = os_snprintf(E2, E3, ...); else E1 = 0; | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else { ... return -1; } | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else if (E6) { ... E1 = os_snprintf(E2, E3, ...); } else { ... return -1; } | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else { ... E1 = os_snprintf(E2, E3, ...); } ) ? os_free(E4); - if (E1 < 0 || \( E1 >= E3 \| (size_t) E1 >= E3 \| (unsigned int) E1 >= E3 \| E1 >= (int) E3 \)) + if (os_snprintf_error(E3, E1)) ( S1 | { ... } ) Signed-off-by: Jouni Malinen <j@w1.fi>
* Add BSS_TM_REQ command to send BSS Transition Management RequestJouni Malinen2014-11-221-0/+28
| | | | | | | hostapd control interface can now be used to request transmission of a BSS Transition Management Request frame to a specified station. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd_cli: Add CLI commands enable, reload, and disableCedric Baudelet2014-10-121-0/+24
| | | | | | | | Commands are already present in ctrl_iface.c (and parsed in hostapd_ctrl_iface_receive() function) but not in hostapd_cli.c. This patch updates hostapd_cli.c with matching functions. Signed-off-by: Cedric Baudelet <cedric.baudelet@intel.com>
* hostapd_cli: Use os_exec() for action script executionJouni Malinen2014-10-091-17/+8
| | | | | | | | | Use os_exec() to run the action script operations to avoid undesired command line processing for control interface event strings. Previously, it could have been possible for some of the event strings to include unsanitized data which is not suitable for system() use. (CVE-2014-3686) Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Add printf NULL checks to silence static analyzerSrinivas Girigowda2014-08-281-0/+2
| | | | | | | | 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>
* hostapd_cli: Fix segmentation fault with interface commandEduardo Abinader2014-05-301-2/+2
| | | | | | | | | ctrl_ifname was not being freed and allocated consistently by using proper functions: os_free() and os_strdup(). This can result in segmentation fault when these OS specific wrappers use different implementation (e.g., with CONFIG_WPA_TRACE=y). Signed-off-by: Eduardo Abinader <eduardo.abinader@openbossa.org>
* hostapd: Add vendor command supportAvraham Stern2014-03-271-0/+22
| | | | | | | | | | | Add support of vendor command to hostapd ctrl_iface. Vendor command's format: VENDOR <vendor id> <sub command id> [<hex formatted data>] The 3rd argument will be converted to binary data and then passed as argument to the sub command. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* HS 2.0R2 AP: Add support for deauthentication requestJouni Malinen2014-02-251-0/+26
| | | | | | | | | | | | | If the RADIUS server includes deauthentication request in Access-Accept, send a WNM-Notification frame to the station after 4-way handshake and disconnect the station after configurable timeout. A new control interface command, WNM_DEAUTH_REQ, is added for testing purposes to allow the notification frame to sent based on local request. This case does not disconnect the station automatically, i.e., a separate control interface command would be needed for that. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0R2 AP: Add WNM-Notification Request for Subscription RemediationJouni Malinen2014-02-251-0/+21
| | | | | | | Subscription remediation notification can now be sent from hostapd with: hostapd_cli hs20_wnm_notif 02:00:00:00:00:00 http://example.com/foo/ 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>
* Add DRIVER-STATUS command for hostapdJouni Malinen2014-01-071-1/+3
| | | | | | | | This is just like the same command in wpa_supplicant, i.e., "hostapd_cli status driver" can be used to fetch information about the driver status and capabilities. Signed-hostap: Jouni Malinen <j@w1.fi>
* Make EAPOL dump data available through ctrl_iface STA commandJouni Malinen2014-01-021-3/+6
| | | | | | | The per-STA/Supplicant state information from the EAPOL authenticator is now available through "STA <MAC Address> eapol" command. Signed-hostap: Jouni Malinen <j@w1.fi>
* Make RADIUS server MIB available through control interfaceJouni Malinen2014-01-021-0/+5
| | | | | | | "MIB radius_server" control interface can now be used to fetch the RADIUS server MIB data from hostapd. Signed-hostap: Jouni Malinen <j@w1.fi>
* Add chan_switch to ctrl interface of wpa_supplicant and hostapdAndrei Otcheretianski2013-11-171-0/+40
| | | | | | | Add chan_switch to the control interface of wpa_supplicant and hostapd, and also to wpa_cli and hostapd_cli. Signed-hostap: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* hostapd: Allow hostapd_cli to work on AndroidJeff Johnson2013-11-071-1/+6
| | | | | | | | Add definitions of the Android specific directories used for control interface sockets so that hostapd_cli can connect to the Android hostapd. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Add ctrl_iface STATUS commandJouni Malinen2013-11-031-1/+8
| | | | | | This can be used to fetch runtime information about hostapd interfaces. Signed-hostap: Jouni Malinen <j@w1.fi>
* Interworking: Add support for QoS Mapping functionality for the APKyeyoon Park2013-10-181-0/+41
| | | | | | | | 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>
* WPS: Add control interface command for fetching latest statusJeffin Mammen2013-08-231-0/+9
| | | | | | | The new wps_get_status command can be used to fetch the result of the latest WPS operation and the current PBC state from hostapd. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WNM: Add disassociation timeout processing for ESS_DISASSOCKyeyoon Park2013-05-201-5/+5
| | | | | | | | The hostapd_cli ess_disassoc command now takes three arguments (STA MAC address, timeout in ms, URL) and the STA is disconnected after the specified timeout. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Add command for fetching carrier record for NFC handoverJouni Malinen2013-02-101-0/+24
| | | | | | | Control interface command "NFC_GET_HANDOVER_SEL NDEF WPS-CR" can now be used to fetch WPS carrier record from hostapd. 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>
* WNM: Additional BSS Transition Management capabilityJouni Malinen2012-12-221-0/+21
| | | | | | | | | | | | | | | Add some more functionality for BSS Transition Management: - advertise support for BSS Transition Management in extended capabilities element - add hostapd.conf parameter bss_transition=1 for enabling support for BSS Transition Management - add "hostapd_cli disassoc_imminent <STA> <num TBTTs>" for sending disassociation imminent notifications for testing purposes - wpa_supplicant: trigger a new scan to find another BSS if the current AP indicates disassociation imminent (TODO: the old AP needs to be marked to use lower priority to avoid re-selecting it) Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Remove deprecated UFD config method and OOB ctrl_ifaceJouni Malinen2012-11-111-34/+0
| | | | | | | | | | The UFD (USB flash drive) configuration method was deprecated in WSC 2.0. Since this is not known to be used, remove the UFD implementation from hostapd and wpa_supplicant to allow the WPS implementation to be cleaned up. This removes the now unused OOB operations and ctrl_iface commands that had already been deprecated by the new NFC operations. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Remove old OOB NFC interfaceJouni Malinen2012-10-281-12/+6
| | | | | | | | | | The old WPS interface for using NFC has no known deployments and even the binary libraries referenced here are not easily available anymore. Since the new interface for using NFC with WPS covers the same functionality, remove the old implementation to clean up WPS implementation. Signed-hostap: Jouni Malinen <j@w1.fi>
* Add wps_cancel to hostapd_cli help textAnirban Sirkhell2012-08-241-0/+1
| | | | | | | | Commit 4c374cde2f0b789d5aa1180667173358b71d492c added a new wps_cancel command, but didn't add it to the usage text in hostapd_cli. Add an entry for this command. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* edit: Add support for setting prompt stringJanusz Dziedzic2012-08-051-1/+1
| | | | Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>
* WPS: Add support for NCF password token from APJouni Malinen2012-06-281-0/+23
| | | | | | | | | | | | | | | | The new hostapd ctrl_iface command WPS_NFC_TOKEN can now be used to manage AP-as-Enrollee operations with NFC password token. WPS/NDEF parameters to this command can be used to generate a new NFC password token. enable/disable parameters can be used to enable/disable use of NFC password token (instead of AP PIN) for external Registrars. A preconfigured NFS password token can be used by providing its parameters with new hostapd.conf fields wps_nfc_dev_pw_id, wps_nfc_dh_pubkey, wps_nfc_dh_privkey, and wps_nfc_dev_pw. This use will also depend on WPS_NFC_TOKEN enable/disable commands, i.e., the configured NFS password token is disabled by default. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Add new mechanism for generation NFC configuration tokenJouni Malinen2012-06-281-0/+24
| | | | | | | | The new hostapd ctrl_iface command WPS_NFC_CONFIG_TOKEN can now be used to fetch payload for an NFC configuration token so that an external program can be used to write this on an NFC tag. Signed-hostap: Jouni Malinen <j@w1.fi>
* WPS: Add new mechanism for communicating NFC tag read eventsJouni Malinen2012-06-271-1/+35
| | | | | | | | | | | hostapd ctrl_iface can now be used to deliver payload from read operation of an NFC tag. This allows operations without having to have low-level NFC code within hostapd. For now, the new wps_nfc_tag_read command can be used with NFC password tokens for the case where the AP has an NFC device that is used to read an NFC tag from the station Enrollee. Signed-hostap: Jouni Malinen <j@w1.fi>
* Add wps_cancel for hostapd_cliAnirban Sirkhell2012-03-301-0/+8
| | | | | | | Implement wps_cancel for hostapd similarly to how it was already supported in wpa_supplicant AP mode. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Remove the GPL notification from files contributed by Jouni MalinenJouni Malinen2012-02-111-8/+2
| | | | | | | Remove the GPL notification text from the files that were initially contributed by myself. Signed-hostap: Jouni Malinen <j@w1.fi>
* Select the BSD license terms as the only license alternativeJouni Malinen2012-02-111-20/+3
| | | | | | | | | | | | | | | Simplify licensing terms for hostap.git by selecting the BSD license alternative for any future distribution. This drops the GPL v2 alternative from distribution terms and from contribution requirements. The BSD license alternative that has been used in hostap.git (the one with advertisement clause removed) is compatible with GPL and as such the software in hostap.git can still be used with GPL projects. In addition, any new contribution to hostap.git is expected to be licensed under the BSD terms that allow the changes to be merged into older hostap repositories that still include the GPL v2 alternative. Signed-hostap: Jouni Malinen <j@w1.fi>