Commit graph

118 commits

Author SHA1 Message Date
Dan Williams 7de5688d68 Make control response processing available to other control interfaces
The D-Bus interface wants to use it too, so it makes sense
to have it generic.

Signed-off-by: Dan Williams <dcbw@redhat.com>
2011-10-30 12:04:24 +02:00
Arik Nemtsov 2d565a61f2 TDLS: Support mgmt-frame Tx for ctrl-iface operations
Use capability information to decide whether to perform a given TDLS
operation internally or through mgmt-frame Tx.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:20:43 +03:00
Dmitry Shmidt 9aa10e2b27 Add blacklist command
This command allows an external program manage the BSS blacklist
and display its current contents.

Note: The blacklist is considered to be internal mechanism within
wpa_supplicant and changing it can have unexpected results.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-21 18:59:16 +03:00
Dmitry Shmidt 0597a5b59d Add log_level command
This can be used to display the current debugging level and to change
the log level during run time.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-18 22:53:46 +03:00
Jouni Malinen b02fe7ff32 Interworking: Add commands for network selection
This adds the basic mechanism for running through network selection:
scan, ANQP fetch, network selection, and connection. Actual rules for
network selection and the creation of the network block are still
missing, but will be added in separate commits.
2011-10-16 23:55:34 +03:00
Jouni Malinen afc064fe7a Interworking: Add ANQP query requests
Add mechanism for using GAS/ANQP to query Interworking related
information from APs. The received information is stored in the BSS
table and can be viewed with ctrl_iface BSS command.

New ctrl_iface command ANQP_GET can be used to fetch ANQP elements from
a specific AP. Additional commands FETCH_ANQP and STOP_FETCH_ANQP can be
used to initiate and stop an iteration through all APs in the BSS table
that indicate support Interworking to fetch ANQP elements from them.
2011-10-16 23:55:34 +03:00
Jouni Malinen cc81110d55 Fix location of P2P indication flag in BSS ctrl_iface output 2011-10-16 18:25:35 +03:00
Jouni Malinen 07fecd3915 P2P: Remove Label config method
The P2P specification (3.1.4.3) disallows use of the Label configuration
method between two P2P devices. This was previously enforced at upper
level, but the obsolete code can be removed from wpa_supplicant. This
adds a bit more strict enforcement of the policy, but should not result
in practical differences since no known P2P implementation uses Label
config method.
2011-09-08 16:40:03 +03:00
Jouni Malinen d8a790b922 Flush PMKSA cache entries and invalidate EAP state on network changes
If a network configuration block is removed or modified, flush
all PMKSA cache entries that were created using that network
configuration. Similarly, invalidate EAP state (fast re-auth).

The special case for OKC on wpa_supplicant reconfiguration
(network_ctx pointer change) is now addressed as part of the
PMKSA cache flushing, so it does not need a separate mechanism
for clearing the network_ctx values in the PMKSA cache.
2011-09-07 17:46:00 +03:00
Jouni Malinen f3857c2e6a Call wpas_notify_network_removed() on REMOVE_NETWORK
This was done for the case where all networks are being removed,
but the case where a single network is removed was forgotten.
2011-09-07 17:44:00 +03:00
Jouni Malinen 98aa7ca5d8 WPS: Add 'wpa_cli wps_pin get' for generating random PINs
This can be used, e.g., in a UI to generate a PIN without
starting WPS (or P2P) operation.
2011-09-02 21:29:06 +03:00
Jouni Malinen f4a0a82ca6 Reduce debug verbosity on global ctrl_iface PING command
This matches with the earlier change that did the same for the
per-interface ctrl_iface commands.
2011-09-01 18:16:37 +03:00
Jouni Malinen 20a0b03deb Clear WPA and EAPOL state machine config pointer on network removal
Make sure that the WPA and EAPOL state machines do not hold a pointer
to a network configuration that is about to be freed. This can fix
potential issues with references to freed memory.
2011-06-27 19:02:24 +03:00
Jouni Malinen 634ce80246 Fix CONFIG_AP=y build without CONFIG_P2P=y 2011-06-20 08:58:32 +03:00
Jouni Malinen ceb34f250a Remove compiler warning for non-P2P builds 2011-05-27 19:06:05 +03:00
Dmitry Shmidt 60b24b0de4 Add 'signal_poll' command interface
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-04-15 18:52:01 +03:00
Dmitry Shmidt 746bba1a5e Prevent explicit scan command during scan or association
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-04-15 18:40:29 +03:00
Dmitry Shmidt 67b9bd089b Make scan interval configurable
It is now possible to configure the the time in seconds that
wpa_supplicant waits before requesting a new scan after failing to find
a suitable network in scan results.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-04-11 23:14:38 +03:00
Jouni Malinen b8f64582e3 TDLS: Allow TDLS to be disabled at runtime for testing purposes
Control interface command 'SET tdls_disabled <1/0>' can now be used
to disable/enable TDLS at runtime. This is mainly for testing
purposes.
2011-03-24 20:44:17 +02:00
Sam Leffler 78633c3709 wpa_supplicant: Parameterize BSS table expiration age + count
Replace compile-time BSS cache expiration age and scan count by config
parameters that can be set via wpa_cli and the new D-Bus API. The latter
is done with interface properties BSSExpireAge and BSSExpireCount.
2011-03-20 12:40:59 +02:00
Jean-Michel Bachot 046ef4aa67 P2P: Add option for requested device type in P2P search/scan
With this, p2p_find can be extended to find certain requested device
types.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-03-19 12:57:46 +02:00
Chao-Wen Yang 3152ff421e WPS: Indicate PBC session overlap in wps_pbc return value
Use a specific return value, WPS-PBC-OVERLAP, to indicate a reason
for rejecting a wps_pbc command in wpa_supplicant AP mode if the
PBC mode cannot be started due to PBC session overlap having been
detected during monitor time.
2011-03-10 18:59:51 +02:00
Jouni Malinen 94377fbc52 TDLS: Allow wpa_cli tdls_setup to start renegotiation
If there is already a link the requested peer, request start of
renegotiation instead of completely new link. This seems to be needed
to allow some driver to accept the trigger for a new negotiation.
2011-03-06 14:54:44 +02:00
Jouni Malinen 5b0e6ece54 TDLS: Add a special testing feature for changing TDLS behavior
These special test cases can be configured at run time with "wpa_cli
tdls_testing <value>" where <value> is an integer (either as a decimal
or as a hex value with 0x prefix) bitmap of special features with
following bits available at this point:
bit 0 = long frame (add dummy subelement to make FTIE very long)
bit 1 = use alternative RSN IE (different RSN capab value and no extra
replay counters)
bit 2 = send incorrect BSSID in Link Identifier of TDLS Setup Request
(e.g., 1 = long FTIE, 2 = different RSN IE, 3 = both of those)

This is disabled by default and can be enabled for the build by
adding the following line to .config:
CFLAGS += -DCONFIG_TDLS_TESTING
2011-03-06 14:53:54 +02:00
Ganesh Prasadh 281ff0aa76 TDLS: Add initial support for TDLS (IEEE Std 802.11z-2010) 2011-03-06 14:53:49 +02:00
Dmitry Shmidt fb0e5bd7df ctrl_iface: Return only finished line for scan results
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-02-26 13:16:04 +02:00
Jouni Malinen 9526fd293f P2P: Handle P2P-not-supported without segfaults
Previous code was assuming that the P2P module is always initialized.
However, that is not the case anymore with drivers that do not support
P2P. Add verification of whether P2P is enabled before trying to execute
P2P commands.
2011-02-24 21:13:30 +02:00
Jouni Malinen d601247ca9 P2P: Allow WPS_PBC command on GO to select on P2P Device Address
An optional parameter, p2p_dev_addr, can now be given to WPS_PBC
command on P2P GO to indicate that only the P2P device with the
specified P2P Device Address is allowed to connect using PBC. If
any other device tries to use PBC, a session overlap is indicated
and the negotiation is rejected with M2D. The command format for
specifying the address is "WPS_PBC p2p_dev_addr=<address>", e.g.,
WPS_PBC p2p_dev_addr=02:03:04:05:06:07

In addition, show the PBC session overlap indication as a WPS failure
event on an AP/GO interface. This particular new case shows up as
"WPS-FAIL msg=4 config_error=12".
2011-02-07 18:28:36 +02:00
Ben Greear ac6912b5d1 wpa_supplicant: Support 'relog' command to re-open log files
This allows rolling log files:

mv log.txt log.txt.1
wpa_cli relog

Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-02-06 20:15:19 +02:00
Masashi Honma 6c714cd7d4 P2P: Show "FAIL" for failed p2p_find operation
I tried these commands:

./wpa_cli -i wlan0 p2p_group_add
./wpa_cli -i wlan0 p2p_find

The second one results in following messages because it is invalid
operation.

-------
nl80211: Scan trigger failed: ret=-95 (Operation not supported)
P2P: Failed to start p2p_scan
-------

But the second one shows "OK" on control console.

This patch makes it to show "FAIL".
2011-01-31 17:29:31 +02:00
Jouni Malinen 0382097ef3 Use set_key addr to distinguish default and multicast keys
Previously, both NULL and ff:ff:ff:ff:ff:ff addr were used in various
places to indicate default/broadcast keys. Make this more consistent
and useful by defining NULL to mean default key (i.e., used both for
unicast and broadcast) and ff:ff:ff:ff:ff:ff to indicate broadcast
key (i.e., used only with broadcast).
2011-01-09 19:44:28 +02:00
Johannes Berg 0423d090ce P2P: Fix some int size warnings
When u64 != unsigned long, the compiler will give
some warnings. Fix these.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2010-12-17 17:09:50 +02:00
Sudhakar Swaminathan 9d562b7946 P2P: Add p2p_unauthorize command
This can be used to remove authorization from a previous p2p_connect
commands that has not yet resulted in completed GO Negotiation.
2010-11-25 13:09:50 +02:00
Jouni Malinen b21e2c84f1 Include own MAC address in status info even in non-P2P builds 2010-11-21 12:35:49 +02:00
Jouni Malinen 70d84f11fe WPS: Add wps_ap_pin ctrl_iface command for wpa_supplicant AP mode
This can be used to control the AP PIN in wpa_supplicant AP mode
in the same way as the identical command in hostapd ctrl_iface.
2010-11-17 16:46:55 +02:00
Jouni Malinen acec8d3203 Add ctrl_iface command 'GET version'
This can be used to fetch the wpa_supplicant/hostapd version
string.
2010-10-31 17:07:31 +02:00
Jouni Malinen d25f7212da Fix copy-paste bug in p2p_serv_disc_resp handling
The destination address for p2p_serv_disc_resp must always be set
to an individual MAC address unlike p2p_serv_disc_req which may use
00:00:00:00:00:00 to indicate wildcard query. As such, we should not
try to check for this special case here.
2010-10-31 12:17:30 +02:00
Jouni Malinen ed159ad41b WPS ER: Add more details to wps_er_pbc failure returns
Indicate the reason for the failure when wps_er_pbc is rejected.
2010-10-25 21:59:25 +03:00
Jouni Malinen 129eb428b1 WPS: Fix wps_reg command documentation to require BSSID
Replacing the BSSID with 'any' has never worked with wps_reg
command, so better not claim it could work. In addition, reject
this is wpa_supplicant to make it clearer that the operation
fails.
2010-10-25 18:56:49 +03:00
Jouni Malinen ef10f4733f WPS ER: Add wps_er_set_config to use local configuration
This command can be used to enroll a network based on a local
network configuration block instead of having to (re-)learn the
current AP settings with wps_er_learn.
2010-10-20 13:37:01 +03:00
Jouni Malinen 59eba7a2b3 P2P: Add p2p_cancel command for cancelling ongoing group formation 2010-10-19 15:53:28 +03:00
Jouni Malinen d054a4622c P2P: Reject multi-channel concurrent operations depending on driver
The driver wrapper can now indicate whether the driver supports
concurrent operations on multiple channels (e.g., infra STA connection
on 5 GHz channel 36 and P2P group on 2.4 GHz channel 1). If not,
P2P_CONNECT commands will be rejected if they would require
multi-channel concurrency.

The new failure codes for P2P_CONNECT:

FAIL-CHANNEL-UNAVAILABLE:
The requested/needed channel is not currently available (i.e., user has
an option of disconnecting another interface to make the channel
available).

FAIL-CHANNEL-UNSUPPORTED:
The request channel is not available for P2P.
2010-10-14 14:24:56 +03:00
Jouni Malinen 235f69fcd6 Mark ctrl_iface RX debug for PING commands excessive
This cleans up debug log from unnecessary entries when using
wpa_cli/hostapd_cli or other ctrl_iface monitors that PING
periodically to check connectivity.
2010-09-24 15:50:13 -07:00
Jouni Malinen 3981cb3cb8 WPS: Add wps_check_pin command for processing PIN from user input
UIs can use this command to process a PIN entered by a user and to
validate the checksum digit (if present).
2010-09-23 10:30:52 -07:00
Jouni Malinen b4e34f2fdf WPS: Make testing operations configurable at runtime
Instead of build time options (CONFIG_WPS_TESTING_EXTRA_CRED and
CONFIG_WPS_EXTENSIBILITY_TESTING), use a single build option
(CONFIG_WPS_TESTING) and runtime configuration of which testing
operations are enabled. This allows a single binary to be used
for various tests.

The runtime configuration can be done through control interface
with wpa_cli/hostapd_cli commands:
Enable extensibility tests:
set wps_version_number 0x57
Disable extensibility tests (WPS2 build):
set wps_version_number 0x20
Enable extra credential tests:
set wps_testing_dummy_cred 1
Disable extra credential tests:
set wps_testing_dummy_cred 0
2010-09-21 19:51:23 -07:00
Ardong Chen 0d0a8ca1cc Add option for disabling automatic reconnection on disconnection
ctrl_interface STA_AUTOCONNECT command can now be used to disable
automatic reconnection on receiving disconnection event. The default
behavior is for wpa_supplicant to try to reconnect automatically, i.e.,
to maintain previous behavior.
2010-09-10 10:30:26 -07:00
Ardong Chen 2f9929ffcc WPS: Allow pending WPS operation to be cancelled
A new ctrl_interface command, WPS_CANCEL, can now be used to cancel
a pending or ongoing WPS operation. For now, this is only available
with wpa_supplicant (either in station or AP mode). Similar
functionality should be added for hostapd, too.
2010-09-10 10:30:25 -07:00
Jouni Malinen b6c79a998f Add test command for disabling/enabling A-MPDU aggregation
ctrl_iface command "SET ampdu <0/1>" can now be used to
disable/enable A-MPDU aggregation.
2010-09-09 07:17:21 -07:00
Jouni Malinen eea2fd9eff P2P: Add mechanism for configuring UAPSD parameters for group
This is needed to be able to change parameters for dynamically
created interfaces between the creation of the interface and
association/start AP commands.

Following ctrl_interface commands can now be used:

P2P_SET client_apsd disable
- disable configuration (i.e., use driver default) in client mode

P2P_SET client_apsd <BE>,<BK>,<VI>,<VO>;<max SP Length>
- enable UASPD with specific trigger configuration (0/1) per AC
  (max SP Length is currently ignored)

P2P_SET go_apsd disable
- disable configuration (i.e., use driver default) in AP mode

P2P_SET go_apsd <0/1>
- disable/enable APSD in AP mode
2010-09-09 07:17:21 -07:00
Jouni Malinen 72044390f3 P2P: Add support for cross connection
If enabled, cross connection allows GO to forward IPv4 packets
using masquerading NAT from the P2P clients in the group to an
uplink WLAN connection. This is disabled by default and can be
enabled with "wpa_cli p2p_set cross_connect 1" on the P2P device
interface.
2010-09-09 07:17:20 -07:00