Commit Graph

131 Commits (vlan_per_psk)

Author SHA1 Message Date
Sunil Dutt 3a05f89edc Android: Add DRIVER command support on hostapd and hostapd_cli
Add DRIVER command support on hostapd and hostapd_cli on Android
similarly to the way this previously enabled in wpa_supplicant and
wpa_cli.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
3 years ago
Disha Das b709bb40fd DPP2: Add DPP_CONTROLLER commands to hostapd_cli and wpa_cli
Add the DPP control interface DPP_CONTROLLER_START and
DPP_CONTROLLER_STOP commands to the CLIs.

Signed-off-by: Disha Das <dishad@codeaurora.org>
3 years ago
Vinita S. Maloo c2c4686228 Set NLA_F_NESTED flag with NL80211_ATTR_VENDOR_DATA conditionally
The newer kernel versions enforce strict netlink attribute policy
validation and will cause cfg80211 to reject vendor commands with
NL80211_ATTR_VENDOR_DATA if NLA_F_NESTED attribute is not set but
if the vendor command is expecting nested data within
NL80211_ATTR_VENDOR_DATA attribute.

Most of the earlier instances were addressed by adding NLA_F_NESTED
flag in nla_nest_start(). This commit addresses the remaining
instance in which NL80211_ATTR_VENDOR_DATA is populated using data
set by user through the control interface.

Enhance the control interface VENDOR command to indicate whether the
vendor subcommand uses nested attributes within NL80211_ATTR_VENDOR_DATA
attribute or not.

Set NLA_F_NESTED flag for existing QCA vendor commands which use nested
attributes within the NL80211_ATTR_VENDOR_DATA attributes so that the
old frameworks implementations for already existing commands work
without any issues.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
4 years ago
Yegor Yefremov d720de929f hostapd: Fix typos
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
4 years ago
Wystan Schmidt e3b47cdf86 DPP2: Add DPP_CHIRP commands to hostapd_cli and wpa_cli
Add the DPP control interface chirp commands to the CLIs for greater
visibility and ease of use.

Signed-off-by: Wystan Schmidt <wystan.schmidt@charter.com>
4 years ago
Andrew Beltrano 1a0169695b hostapd_cli: Add dpp_bootstrap_set command
Expose DPP_BOOTSTRAP_SET through hostapd_cli command
dpp_bootstrap_set <id> <configurator params..>

Signed-off-by: Andrew Beltrano <anbeltra@microsoft.com>
4 years ago
Ben Greear ee48f48ba1 hostapd: Support showing neighbor list through hostapd_cli
This lets one know the current neighbor list, and could be used
to populate the neighbor list of other hostapd processes.

For instance:

$ hostapd_cli -i vap0001 show_neighbor
04:f0:21:1e:ae:b0 ssid=04f0211eaeb0af190000802809 nr=04f0211eaeb0af1900008028090603022a00
$ hostapd_cli -i vap0000 set_neighbor 04:f0:21:1e:ae:b0 ssid=04f0211eaeb0af190000802809 nr=04f0211eaeb0af1900008028090603022a00
OK
$ hostapd_cli -i vap0000 show_neighbor
04:f0:21:1e:ae:b0 ssid=04f0211eaeb0af190000802809 nr=04f0211eaeb0af1900008028090603022a00
04:f0:21:c3:b2:b0 ssid=04f021c3b2b0af190000802809 nr=04f021c3b2b0af1900008028090603022a00

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years ago
Ben Greear 70755e6587 Allow removing neighbor DB entries by BSSID alone
Let users delete a neighbor by BSSID alone if they prefer. The
underlying code already properly handled a NULL SSID, so just relax the
control interface command calling restrictions.

Signed-off-by: Ben Greear <greearb@candelatech.com>
4 years ago
Bilal Hatipoglu 0b1839405e Add "reconnect" cmdline argument to hostapd_cli/wpa_cli
When the newly added "-r" parameter is used, both clis will try to
reconnect forever on connection lost until signalled (ctrl+c) or
terminated. This is useful only when used with -a to take action to
retrieve events or get status and the cli process stays even if
hostapd/wpa_supplicant daemons restart for some reason (e.g.,
configuration change).

Signed-off-by: Veli Demirel <veli.demirel@airties.com>
Signed-off-by: Bilal Hatipoglu <bilal.hatipoglu@airties.com>
4 years ago
Jouni Malinen 7d2ed8bae8 Remove CONFIG_IEEE80211W build parameter
Hardcode this to be defined and remove the separate build options for
PMF since this functionality is needed with large number of newer
protocol extensions and is also something that should be enabled in all
WPA2/WPA3 networks.

Signed-off-by: Jouni Malinen <j@w1.fi>
5 years ago
Alona Solntseva 6b43264e79 hostapd_cli: Add update_beacon command
Add ability to use UPDATE_BEACON with hostapd_cli. The option has been
exposed in ctrl_iface already.

Signed-off-by: Alona Solntseva <alona.solntseva@tandemg.com>
Signed-off-by: Simon Dinkin <simon.dinkin@tandemg.com>
5 years ago
Michal Kazior 83c8608132 AP: Add wpa_psk_file reloading in runtime
The wpa_psk_file can now be modified and hostapd can be told to re-read
it with the control interface RELOAD_WPA_PSK command:

 $ hostapd_cli reload_wpa_psk

It must be noted special care must be taken if WPS is configured
(wps_state=2, eap_server=1) because WPS appends PMKs to the
wpa_psk_file.

Signed-off-by: Michal Kazior <michal@plume.com>
5 years ago
Avraham Stern d6e7d4dede hostapd_cli: Add option to send beacon report request
This new 'req_beacon' command is useful for testing.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
5 years ago
Jouni Malinen cc58a35735 Update copyright notices for the new year 2019
Signed-off-by: Jouni Malinen <j@w1.fi>
5 years ago
Prasad, Jagadeesh (Contractor) d2b5138116 DPP: Add self configuration command in hostapd_cli and wpa_cli
The back-end support for DPP self configuration was already present in
hostapd and wpa_supplicant. However, the command to invoke DPP self
configuration was not available in hostapd_cli and wpa_cli. Add the
command "dpp_configurator_sign" in them.

Signed-off-by: Prasad, Jagadeesh <Jagadeesh_Prasad@comcast.com>
5 years ago
Jouni Malinen c2c6c01bb8 Update version to v2.7 and copyright years to include 2018
Also add the ChangeLog entries for both hostapd and wpa_supplicant to
describe main changes between v2.6 and v2.7.

Signed-off-by: Jouni Malinen <j@w1.fi>
6 years ago
Damodaran, Rohit (Contractor) cd676ae34c Fix dpp_configurator_get_key command name in hostapd_cli
The option to get DPP configurator key in hostapd_cli was named
incorrectly. It was wrongly pointing to dpp_configurator_remove. Fix
this by using the correct name.

Signed-off-by: Rohit Damodaran <Rohit_Damodaran@comcast.com>
6 years ago
Bhagavathi Perumal S 2df73f52e8 Add hostapd_cli poll_sta command
This uses the already existing POLL_STA control interface to poll an
associated station to check connectivity.

Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
6 years ago
Purushottam Kushwaha 8179ae3a2a DPP: Support retrieving of configurator's private key
To retain configurator information across hostapd/wpa_supplicant
restart, private key need to be maintained to generate a valid pair of
authentication keys (connector, netaccess_key, csign) for new enrollees
in the network.

Add a DPP_CONFIGURATOR_GET_KEY control interface API through which the
private key of an existing configurator can be fetched.

Command format:
DPP_CONFIGURATOR_GET_KEY <configurator_id>

The output from this command can then be used with
"DPP_CONFIGURATOR_ADD key=<hexdump>" to create the same key again.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
6 years ago
Tamizh chelvam 3988046de5 hostapd: Dynamic MAC ACL management over control interface
Previously, MAC ACL could be modified only through file operations
(modify accept/deny_mac_file and reload it to hostapd). Extend this to
allow MAC ACL to be modified and displayed through new control interface
commands:

ACCEPT_ACL <subcmd> [argument]
DENY_ACL <subcmd> [argument]

subcmd: ADD_MAC <addr>[ VLAN_ID=<id>]|DEL_MAC <addr>|SHOW|CLEAR

Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
6 years ago
Jouni Malinen dff5ab97eb hostapd_cli: Add dpp_listen and dpp_stop_listen
Now that hostapd exposes the DPP_LISTEN and DPP_STOP_LISTEN commands
similarly to wpa_supplicant, expose these through proper hostapd_cli
commands as well to match wpa_cli functionality.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years ago
Jouni Malinen dc7fc09ccd DPP: Add control interface commands into hostapd_cli
These are copied from wpa_cli.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years ago
Jouni Malinen 0c7cf1f508 DPP: Increase hostapd_cli buffer limits
This is needed for DPP events/commands.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years ago
Jouni Malinen 6774c6a9fe Update copyright notices for the new year 2017
Signed-off-by: Jouni Malinen <j@w1.fi>
7 years ago
Mikael Kanstrup c04a67deb0 hostapd_cli: Add completion for get command
Add command completion support for get command.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup bf4167b9d5 hostapd_cli: Add completion for set command
Add command completion support for set command.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup 86adff09e9 hostapd_cli: Completion for further commands with STA parameter
Yet some more commands take STA address as the only parameter. Add
command completion support for the following commands:

signature, sa_query, send_qos_map_conf and req_lci

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup 4f59ad0699 hostapd_cli: Use common completion for commands that use stations
More than one command takes STA address as the only parameter. Make use
of a common completion routine.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup 62b95eb67e hostapd_cli: Add missing command help descriptions
Some commands are missing help description making them not show up in
the list of supported commands. Add command help description for all
missing commands.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
David Spinadel 451a27b1ad hostapd: Add a configuration to set an AP as stationary
Add a configuration option in hostapd.conf and in neighbor report that
sets an AP as stationary. To enable this option on the current AP set
the config option stationary_ap to 1. To set a neighbor entry to be
marked as stationary add the word stat to the SET_NEIGHBOR command. This
option tells hostapd to send LCI data even if it is older than requested
by max age subelement in RRM request.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
8 years ago
Dmitry Shmidt 3765c9705c hostapd_cli: Remove duplicate const in hostapd_cli_cmd()
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
8 years ago
Jouni Malinen e097556eef hostapd_cli: Mark number of char *cmd constant
Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Mikael Kanstrup 4c43f44b29 cli: Add list_sta command
Add list_sta command to print addresses of all stations. Command
added to both wpa_cli and hostapd_cli.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup 85bab32522 hostapd_cli: Process events received following control iface commands
Events received as an immediate result of control interface commands
end up on the control request message callback function instead of
the registered read socket. This makes for example the station list
used for complete functions for disassociate and deauthenticate out
of sync. Process events in the message callback function too to ensure
no events are missed.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup e054a4333e hostapd_cli: Refactor control iface reconnects with common helper
Code for connecting/reconnecting to the hostapd control interface
is found duplicated a number of times. Create a common reconnect
helper function to avoid code duplication.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup aa2ab916ef hostapd_cli: Refresh stations list on control interface reconnect
Whenever reconnecting the control interface the hostapd station list
is unknown as stations might have dropped or connected. Refresh the
list of stations used for command completion on cli connect, reconnect
and interface change.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup 839e4a8a98 hostapd_cli: Add completion for sta command
Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup cf296a23d5 hostapd_cli: Add support for cli history file
Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Denton Gentry 04059ab844 Passive Client Taxonomy
Implement the signature mechanism described in the paper
"Passive Taxonomy of Wifi Clients using MLME Frame Contents"
published by Denton Gentry and Avery Pennarun.

http://research.google.com/pubs/pub45429.html
https://arxiv.org/abs/1608.01725

This involves:
1. Add a CONFIG_TAXONOMY compile option. Enabling taxonomy incurs
   a memory overhead of up to several kilobytes per associated
   station.
2. If enabled, store the Probe Request and (Re)Associate Request frame in
   struct sta_info.
3. Implement code to extract the ID of each Information Element,
   plus selected fields and bitmasks from certain IEs, into a
   descriptive text string. This is done in a new source file,
   src/ap/taxonomy.c.
4. Implement a "signature qq:rr:ss:tt:uu:vv" command
   in hostapd_cli to retrieve the signature.

Signatures take the form of a text string. For example, a signature
for the Nexus 5X is:
  wifi4|probe:0,1,127,45,191,htcap:01ef,htagg:03,htmcs:0000ffff,vhtcap:338061b2,
  vhtrxmcs:030cfffa,vhttxmcs:030cfffa,extcap:00000a0201000040|assoc:0,1,48,45,
  221(0050f2,2),191,127,htcap:01ef,htagg:03,htmcs:0000ffff,vhtcap:339071b2,
  vhtrxmcs:030cfffa,vhttxmcs:030cfffa,extcap:0000000000000040

Signed-off-by: dgentry@google.com (Denton Gentry)
Signed-off-by: denny@geekhold.com (Denton Gentry)
Signed-off-by: rofrankel@google.com (Richard Frankel)
Signed-off-by: richard@frankel.tv (Richard Frankel)
8 years ago
Jouni Malinen ac81b3948b cli: Share a common tokenize_cmd() implementation
wpa_cli and hostapd_cli had identical copies of this function.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen 980afcce53 cli: Share a common write_cmd() implementation
wpa_cli and hostapd_cli had identical copies of this function.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen fcc84b48b2 cli: Share a common get_cmd_arg_num() implementation
wpa_cli and hostapd_cli had identical copies of this function.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Jouni Malinen e55df99ee6 Share a single str_starts() implementation
No need to define this as a static function in multiple files.

Signed-off-by: Jouni Malinen <j@w1.fi>
8 years ago
Mikael Kanstrup 23c130e9b7 Use a common license string for hostapd_cli and wpa_cli
Move the license strings for hostapd_cli and wpa_cli to common.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup b90c13d934 hostapd_cli: Completion for interface command
Implement command completion for interface command

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup 8b73c6aa11 hostapd_cli: Completion for disassociate and deauthenticate
Command completion routine for disassociate and deauthenticate
commands implemented. Tracks AP-STA-CONNECTED/AP-STA-DISCONNECTED
events for easy station MAC address lookup.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup 1cef253aab hostapd_cli: Implement event handler
Add an empty event handler in preparation for additional command
completion routines that will need to dynamically build parameters
based on events received.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup 977c0796f9 Move parts of wpa_cli to a new common file
In preparation for adding further command completion support
to hostapd_cli move some cli related utility functions out of
wpa_cli into a new common cli file.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup 6cad0bff06 hostapd_cli: Add completion for help command
Implement command completion support for help command.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago
Mikael Kanstrup 01938838b5 hostapd_cli: Replace static usage string with print_help() function
Replace the static commands usage string with a print_help() function
that reads commands and help text from the array of defined cli
commands.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
8 years ago