Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Sigma Control API DUT (station/AP) |
| 3 | * Copyright (c) 2010, Atheros Communications, Inc. |
Jouni Malinen | 9d7e31d | 2017-12-22 18:55:04 +0200 | [diff] [blame] | 4 | * Copyright (c) 2012-2014, 2016, Qualcomm Atheros, Inc. |
Kiran Kumar Lokere | c86d802 | 2018-10-11 13:57:12 -0700 | [diff] [blame] | 5 | * Copyright (c) 2018, The Linux Foundation |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 6 | * All Rights Reserved. |
| 7 | * Licensed under the Clear BSD license. See README for more details. |
| 8 | */ |
| 9 | |
| 10 | #ifndef WPA_HELPERS_H |
| 11 | #define WPA_HELPERS_H |
| 12 | |
Jouni Malinen | 016ae6c | 2019-11-04 17:00:01 +0200 | [diff] [blame] | 13 | const char * get_main_ifname(struct sigma_dut *dut); |
| 14 | const char * get_station_ifname(struct sigma_dut *dut); |
| 15 | const char * get_p2p_ifname(struct sigma_dut *dut, const char *primary_ifname); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 16 | void dut_ifc_reset(struct sigma_dut *dut); |
| 17 | |
| 18 | int wpa_command(const char *ifname, const char *cmd); |
Alexei Avshalom Lazar | dc7bf05 | 2018-12-23 16:49:49 +0200 | [diff] [blame] | 19 | int hapd_command(const char *ifname, const char *cmd); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 20 | int wpa_command_resp(const char *ifname, const char *cmd, |
| 21 | char *resp, size_t resp_size); |
Alexei Avshalom Lazar | dc7bf05 | 2018-12-23 16:49:49 +0200 | [diff] [blame] | 22 | int hapd_command_resp(const char *ifname, const char *cmd, |
| 23 | char *resp, size_t resp_size); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 24 | int get_wpa_status(const char *ifname, const char *field, char *obuf, |
| 25 | size_t obuf_size); |
Kiran Kumar Lokere | c86d802 | 2018-10-11 13:57:12 -0700 | [diff] [blame] | 26 | int get_wpa_signal_poll(struct sigma_dut *dut, const char *ifname, |
| 27 | const char *field, char *obuf, size_t obuf_size); |
Arif Hussain | 66a4af0 | 2019-02-07 15:04:51 -0800 | [diff] [blame] | 28 | int get_wpa_ssid_bssid(struct sigma_dut *dut, const char *ifname, |
| 29 | char *buf, size_t buf_size); |
Alexei Avshalom Lazar | 0c1d82d | 2018-12-23 17:02:42 +0200 | [diff] [blame] | 30 | int get_hapd_config(const char *ifname, const char *field, char *obuf, |
| 31 | size_t obuf_size); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 32 | void remove_wpa_networks(const char *ifname); |
| 33 | |
| 34 | struct wpa_ctrl * open_wpa_mon(const char *ifname); |
Alexei Avshalom Lazar | 52ec236 | 2018-12-18 15:58:31 +0200 | [diff] [blame] | 35 | struct wpa_ctrl * open_hapd_mon(const char *ifname); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 36 | int wait_ip_addr(struct sigma_dut *dut, const char *ifname, int timeout); |
| 37 | int get_wpa_cli_event(struct sigma_dut *dut, struct wpa_ctrl *mon, |
| 38 | const char *event, char *buf, size_t buf_size); |
| 39 | int get_wpa_cli_event2(struct sigma_dut *dut, struct wpa_ctrl *mon, |
| 40 | const char *event, const char *event2, |
| 41 | char *buf, size_t buf_size); |
| 42 | int get_wpa_cli_events(struct sigma_dut *dut, struct wpa_ctrl *mon, |
| 43 | const char **events, char *buf, size_t buf_size); |
| 44 | |
| 45 | int add_network(const char *ifname); |
| 46 | int set_network(const char *ifname, int id, const char *field, |
| 47 | const char *value); |
| 48 | int set_network_quoted(const char *ifname, int id, const char *field, |
| 49 | const char *value); |
| 50 | int add_cred(const char *ifname); |
| 51 | int set_cred(const char *ifname, int id, const char *field, const char *value); |
| 52 | int set_cred_quoted(const char *ifname, int id, const char *field, |
| 53 | const char *value); |
| 54 | |
Alexei Avshalom Lazar | c9bc15d | 2020-01-29 10:52:13 +0200 | [diff] [blame] | 55 | const char * concat_sigma_tmpdir(struct sigma_dut *dut, const char *src, |
| 56 | char *dst, size_t len); |
| 57 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 58 | int start_sta_mode(struct sigma_dut *dut); |
| 59 | void stop_sta_mode(struct sigma_dut *dut); |
| 60 | |
| 61 | #endif /* WPA_HELPERS_H */ |