path: root/wpa_supplicant/wpa_cli.c
Commit message (Collapse)AuthorAgeFilesLines
* wpa_cli: Run action file in case of an AP eventJörg Krause2016-05-231-0/+4
| | | | | | | Run the action script in case of AP events "AP-ENABLED" and "AP-DISABLED". Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
* wpa_supplicant: Add wps_disabled parameter to network blockLior David2016-05-141-1/+1
| | | | | | | Add a new parameter wps_disabled to network block (wpa_ssid). This parameter allows WPS functionality to be disabled in AP mode. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
* P2P: Add P2P_GROUP_MEMBER command to fetch client interface addressPurushottam Kushwaha2016-04-181-0/+10
| | | | | | | | | | | | | | | This allows local GO to fetch the P2P Interface Address of a P2P Client in the group based on the P2P Device Address for the client. This command should be sent only on a group interface (the same peer may be in multiple concurrent groups). Usage: P2P_GROUP_MEMBER <P2P Device Address> Output: <P2P Interface Address> Signed-off-by: Purushottam Kushwaha <pkushwah@qti.qualcomm.com>
* wpa_supplicant: Add LCI and civic request to Neighbor Report RequestDavid Spinadel2016-04-161-2/+1
| | | | | | | | | | | | | | | | Add an option to request LCI and Location Civic Measurement in Neighbor Report Request frame, as described in IEEE P802.11-REVmc/D5.0, Note: This changes the encoding format of the NEIGHBOR_REP_REQUEST ssid=<val> parameter. This used to be parsed as raw SSID data which is problematic for accepting additional parameters. The new encoding allows either a string within double-quotation marks or a hexdump of the raw SSID. Thew new format: NEIGHBOR_REP_REQUEST [ssid=<SSID>] [lci] [civic] Signed-off-by: David Spinadel <david.spinadel@intel.com>
* mesh: Add support for PMKSA cachingMasashi Honma2016-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This patch add functionality of mesh SAE PMKSA caching. If the local STA already has peer's PMKSA entry in the cache, skip SAE authentication and start AMPE with the cached value. If the peer does not support PMKSA caching or does not have the local STA's PMKSA entry in the cache, AMPE will fail and the PMKSA cache entry of the peer will be removed. Then STA retries with ordinary SAE authentication. If the peer does not support PMKSA caching and the local STA uses no_auto_peer=1, the local STA can not retry SAE authentication because NEW_PEER_CANDIDATE event cannot start SAE authentication when no_auto_peer=1. So this patch extends MESH_PEER_ADD command to use duration(sec). Throughout the duration, the local STA can start SAE authentication triggered by NEW_PEER_CANDIDATE even though no_auto_peer=1. This commit requires commit 70c93963edefa37ef84b73efb9d04ea10268341c ('SAE: Fix PMKID calculation for PMKSA cache'). Without that commit, chosen PMK comparison will fail. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* mesh: Add MESH_PEER_ADD commandMasashi Honma2016-03-201-0/+10
| | | | | | | | This allows a mesh peer connection to be initiated manually in no_auto_peer mesh networks. Signed-off-by: Natsuki Itaya <Natsuki.Itaya@jp.sony.com> Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* mesh: Add MESH_PEER_REMOVE commandMasashi Honma2016-03-201-0/+10
| | | | | | | This command allows the specified mesh peer to be disconnected. Signed-off-by: Natsuki Itaya <Natsuki.Itaya@jp.sony.com> Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* wpa_cli: Support running action script on global control interfaceIlan Peer2016-03-031-0/+4
| | | | | | | | In case wpa_cli is started with an option to execute an action script, but no interface is specified, wpa_cli might crash in wpa_cli_exec() if arg1 == NULL. Fix this be setting arg1 = "global". Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* WNM: Add candidate list to BSS transition queryAvraham Stern2016-02-221-1/+1
| | | | | | | | | | Add an option to configure a candidate list to BSS transition query ("list" as the second argument to WNM_BSS_QUERY). The candidate list is built from the available scan results. If no updated scan results (< 10 sec) are available, the command fails. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* wpa_cli: Clean up logical operationJouni Malinen2016-02-161-1/+1
| | | | | | | | While '!func() == 0' here resulted in correct behavior, it is not clear and clang is starting to warn about this (-Wlogical-not-parentheses). Use 'func()' instead as the condition to clear this. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_supplicant: Basic support for PBSS/PCPLior David2016-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | PBSS (Personal Basic Service Set) is a new BSS type for DMG networks. It is similar to infrastructure BSS, having an AP-like entity called PCP (PBSS Control Point), but it has few differences. PBSS support is mandatory for IEEE 802.11ad devices. Add a new "pbss" argument to network block. The argument is used in the following scenarios: 1. When network has mode=2 (AP), when pbss flag is set will start as a PCP instead of an AP. 2. When network has mode=0 (station), when pbss flag is set will connect to PCP instead of AP. The function wpa_scan_res_match() was modified to match BSS according to the pbss flag in the network block (wpa_ssid structure). When pbss flag is set it will match only PCPs, and when it is clear it will match only APs. Signed-off-by: Lior David <qca_liord@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>
* wpa_supplicant: Add SIGNAL_MONITOR commandDmitry Shmidt2015-12-181-0/+10
| | | | | | | | | | | | | | | | | | | SIGNAL_MONITOR THRESHOLD=DD HYSTERESIS=DD command will request signal strength monitoring events based on there having been requested amount of drop in the signal strength. The threshold value is the RSSI threshold in dBm for the event to be sent. 0 threshold can be used to disable monitoring. The hysteresis value is RSSI hysteresis in dB to specify the minimum amount of change before a consecutive event is reported. With nl80211 driver interface, these values map to the NL80211_CMD_SET_CQM command with NL80211_ATTR_CQM_RSSI_THOLD and NL80211_ATTR_CQM_RSSI_HYST attributes to the driver. This command cannot be used when bgscan module is in use since that depends on being able to control the connection monitoring parameters. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* wpa_cli: Send ALL_STA command to the correct interfaceEliad Peller2015-12-171-0/+6
| | | | | | | | | | | | | | | wpa_ctrl_command_sta(), called by the "ALL_STA" handler, didn't consider ifname_prefix, resulting in various commands being sent to the global control interface, rather than the specified interface when IFNAME= prefix was used. This in turn caused the unexpected "UNKNOWN COMMAND" result be considered as valid station, resulting in infinite loop while trying to get all stations. Fix it by considering ifname_prefix, similarly to _wpa_ctrl_command(). Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
* Add control interface command for aborting an ongoing scanJouni Malinen2015-11-261-0/+10
| | | | | | | The new ABORT_SCAN command can be used to request an ongoing scan to be aborted. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* IBSS/mesh: Add support for VHT80P80 configurationAhmad Kholaif2015-11-261-1/+1
| | | | | | | | | | | A new network profile configuration parameter max_oper_chwidth=3 can be used to specify preference to enable 80+80 MHz VHT channel for IBSS. If that is set, the first 80 MHz segment is specified based on the frequency parameter in the network profile and the second segment is selected automatically (which will practically be limited to a single possibility due to DFS requirements in most countries). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_cli: Add an option to set created interface typeAvraham Stern2015-11-221-5/+8
| | | | | | | Add an option to set the interface type when creating a driver interface. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* wpa_cli: Add support for vendor_elem_* commandsPurushottam Kushwaha2015-10-311-0/+39
| | | | | | Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com> Signed-off-by: Avichal Agarwal <avichal.a@samsung.com> Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
* Allow wpa_cli/hostapd_cli client socket directory to be specifiedManikandan Mohan2015-09-011-4/+17
| | | | | | | | | 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>
* Android: Handle STATUS-NO_EVENTS command in wpa_cliDaichi Ueura2015-08-021-0/+4
| | | | | | | | | | NO_EVENTS parameter was added to STATUS command by commit a6ab82d7b409cd95c4e64452c2a672d4ce4c3c99 ('Android: Add NO_EVENTS parameter to status command'). This patch adds handling of the new parameter in wpa_cli so that "status no_events" can be used to specify this parameter. Signed-off-by: Daichi Ueura <daichi.ueura@sonymobile.com>
* Android: Make wpa_cli work on wifi.interface without extra paramsDaichi Ueura2015-08-021-8/+8
| | | | | | | | | | | | | | | | | Currently wpa_cli connects to global control interface if -i/-p parameters are not specified. wpa_cli on global control interface is not useful since the prefix like "IFNAME=wlan0 " needs to be added to some commands like "IFNAME=wlan0 scan". And, specifying -i/-p parameters every time is annoying. To improve efficiency of debugging, this patch enables to make wpa_cli work without extra parameters. If you still want to connect to global control interface, the following command can be used instead: $ wpa_cli -g@android:wpa_wlan0 (or -gwlan0) Signed-off-by: Daichi Ueura <daichi.ueura@sonymobile.com>
* mesh: Fix mesh SAE auth on low spec devicesMasashi Honma2015-08-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The mesh SAE auth often fails with master branch. By bisect I found commit eb5fee0bf50444419ac12d3c7f38f27a47523a47 ('SAE: Add side-channel protection to PWE derivation with ECC') causes this issue. This does not mean the commit has a bug. This is just a CPU resource issue. After the commit, sae_derive_pwe_ecc() spends 101(msec) on my PC (Intel Atom N270 1.6GHz). But dot11RSNASAERetransPeriod is 40(msec). So auth_sae_retransmit_timer() is always called and it can causes continuous frame exchanges. Before the commit, it was 23(msec). On the IEEE 802.11 spec, the default value of dot11RSNASAERetransPeriod is defined as 40(msec). But it looks short because generally mesh functionality will be used on low spec devices. Indeed Raspberry Pi B+ (ARM ARM1176JZF-S 700MHz) requires 287(msec) for new sae_derive_pwe_ecc(). So this patch makes the default to 1000(msec) and makes it configurable. This issue does not occur on infrastructure SAE because the dot11RSNASAERetransPeriod is not used on it. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* nl80211: Add means to query preferred channelsAhmad Kholaif2015-07-291-0/+10
| | | | | | | | Extend the QCA vendor specific nl80211 interface to query the preferred frequency list from driver and add a new wpa_cli command to query this information. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_cli: Skip action script execution when eloop termination is pendingJouni Malinen2015-07-221-0/+3
| | | | | | | | | Try to exit more quickly by avoiding execution of the action script for any pending events if the process is requested to be killed. This may help in avoiding hitting the two second SIGALRM workaround in eloop in case some of the action scripts block for long period of time. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_cli: Fix process termination in wpa_cli action mode caseJouni Malinen2015-06-181-31/+35
| | | | | | | | | | | Commit 4be9f27595f313773612d2fe534c013dfedfe679 ('wpa_cli: Use eloop during connection attempts in interactive mode') did not take into account the needs for signal processing in action mode. eloop_run() was not called in this case and the internal select() loop would block eloop processing anyway and prevent clean shutdown. Fix this by using eloop for action mode operations. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Allow the priority for the WPS networks to be configuredSunil Dutt2015-06-041-1/+1
| | | | | | | This commit adds a configurable parameter (wps_priority) to specify the priority for the networks derived through WPS connection. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_cli: Fix memory leak when tracking networksAndrei Otcheretianski2015-05-031-2/+4
| | | | | | | | Fix memory leak introduced in commit 32a097fdd26b9401fbd22054a2a01ba2d71f139a ("wpa_cli: Keep track of available networks") by tracking networks only when in interactive mode. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* TDLS: Add TDLS_LINK_STATUS command to the control interfaceOren Givon2015-05-031-0/+10
| | | | | | | | Add the TDLS_LINK_STATUS command to the control interface. This command shows what is the status of our current TDLS connection with the given peer. Also, add the TDLS_LINK_STATUS command to wpa_cli. Signed-off-by: Oren Givon <oren.givon@intel.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-4/+4
| | | | | | This makes the implementation easier to understand. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_cli: Fix a typo in usage textOla Olsson2015-04-031-1/+1
| | | | Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
* wpa_cli: Use tab as only word separator for networksMikael Kanstrup2015-03-271-11/+9
| | | | | | | White space is a valid SSID character so completion routine for networks should only use tab as word separator. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* wpa_cli: Completion routine for dup_network commandMikael Kanstrup2015-03-261-1/+26
| | | | | | Add command completion routine for dup_network command. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* wpa_cli: Completion for remove, select, disable, enable networkMikael Kanstrup2015-03-261-4/+17
| | | | | | | Add command completion routines for remove_network, select_network, disable_network, and enable_network commands. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* wpa_cli: Implement completion routine for get_network/set_networkMikael Kanstrup2015-03-261-2/+92
| | | | | | | Add command completion routine for get_network and set_network that guide user with both network id and network parameters. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* wpa_cli: Keep track of available networksMikael Kanstrup2015-03-261-3/+43
| | | | | | | Keep track of available networks for easy use in command completion routines. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* wpa_cli: Allow tab as alternative separator for cli_txt_list wordsMikael Kanstrup2015-03-261-0/+4
| | | | | | | To be able to reuse the add/del word utility functions for lines containing tabs allow both space and tab as word separators. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* Add support for virtual interface creation/deletionJithu Jance2015-03-261-4/+4
| | | | | | | | Extend interface_add and interface_remove commands via an optional argument to allow wpa_supplicant to create/delete a new virtual interface. Signed-off-by: Jithu Jance <jithu@broadcom.com>
* wpa_cli: Use .wpa_cli_history under AndroidMikael Kanstrup2015-03-261-0/+4
| | | | | | | wpa_cli already implements a command history file for easy accessing commands previously used. Enable the functionality on Android, too. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* wpa_cli: Add missing parameters for "set" command completion routineMikael Kanstrup2015-03-151-25/+47
| | | | | | | | Some config parameters were missing in the "set" command completion routine. Add missing parameters and while at it put the parameters under compiler switches so only valid ones are shown. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* wpa_cli: Add completion routine for "get" commandMikael Kanstrup2015-03-151-1/+69
| | | | | | | Add tab completion function that includes all available "get" parameters. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* Add control interface commands for fetching wpa_config valuesOla Olsson2015-02-081-0/+8
| | | | | | | The new "DUMP" and "SET <variable>" control interface commands can be used to fetch global wpa_supplicant configuration parameters. Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
* Add INTERWORKING_ADD_NETWORK commandJouni Malinen2015-02-081-0/+10
| | | | | | | | | | | | | | | | | | | | This can be used to provide more control to upper layers on network blocks generated as part of Interworking network selection. INTERWORKING_ADD_NETWORK behaves otherwise identically to INTERWORKING_CONNECT, but it does not request a new connection after having added the network block and it returns the network id of the added network. INTERWORKING_ADD_NETWORK followed by REASSOCIATE would behave more or less identically to INTERWORKING_CONNECT, but this allows the created network profile to be modified, if desired, and/or stored externally. SELECT_NETWORK can also be used with the network id returned from INTERWORKING_ADD_NETWORK to enforce that specific network profile to be used for the next connection (though, it should be noted that this behavior may not meet all Hotspot 2.0 requirements if there were other enabled networks that could have higher priority). Signed-off-by: Jouni Malinen <j@w1.fi>
* P2PS: ASP provisioning commands to control interfaceKrishna Vamsi2015-02-021-0/+20
| | | | | | | This adds new wpa_supplicant control interface commands P2P_ASP_PROVISION and P2P_ASP_PROVISION_RESP. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2PS: Add support to send ASP service requestsKrishna Vamsi2015-02-021-4/+2
| | | | | | | | This extends the P2P_SERV_DISC_REQ control interface command with a new "asp" service type. This takes service id, service string, and optional service info as arguments. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2PS: Extend add/del services logic to support ASPKrishna Vamsi2015-02-021-17/+19
| | | | | | | In addition, add a new P2P_SERVICE_REP command that can be used to replace existing ASP advertisements. 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>
* wpa_cli: Fix NULL dereference on printf string argumentEytan Lifshitz2015-01-201-2/+8
| | | | | | | | In wpa_cli_cmd_interface(), try_connection(), and main(), ctrl_ifname may be NULL and could be dereferenced depending on the printf() implementation. Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
* wpa_cli: Add MAC address randomization in scanIlan Peer2015-01-041-0/+12
| | | | Signed-off-by: Ilan Peer <ilan.peer@intel.com>