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 | |
| 13 | char * get_main_ifname(void); |
| 14 | char * get_station_ifname(void); |
Danny Segal | f2af39b | 2016-04-10 16:23:11 +0300 | [diff] [blame] | 15 | const char * get_p2p_ifname(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); |
Alexei Avshalom Lazar | 0c1d82d | 2018-12-23 17:02:42 +0200 | [diff] [blame] | 28 | int get_hapd_config(const char *ifname, const char *field, char *obuf, |
| 29 | size_t obuf_size); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 30 | void remove_wpa_networks(const char *ifname); |
| 31 | |
| 32 | struct wpa_ctrl * open_wpa_mon(const char *ifname); |
Alexei Avshalom Lazar | 52ec236 | 2018-12-18 15:58:31 +0200 | [diff] [blame] | 33 | struct wpa_ctrl * open_hapd_mon(const char *ifname); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 34 | int wait_ip_addr(struct sigma_dut *dut, const char *ifname, int timeout); |
| 35 | int get_wpa_cli_event(struct sigma_dut *dut, struct wpa_ctrl *mon, |
| 36 | const char *event, char *buf, size_t buf_size); |
| 37 | int get_wpa_cli_event2(struct sigma_dut *dut, struct wpa_ctrl *mon, |
| 38 | const char *event, const char *event2, |
| 39 | char *buf, size_t buf_size); |
| 40 | int get_wpa_cli_events(struct sigma_dut *dut, struct wpa_ctrl *mon, |
| 41 | const char **events, char *buf, size_t buf_size); |
| 42 | |
| 43 | int add_network(const char *ifname); |
| 44 | int set_network(const char *ifname, int id, const char *field, |
| 45 | const char *value); |
| 46 | int set_network_quoted(const char *ifname, int id, const char *field, |
| 47 | const char *value); |
| 48 | int add_cred(const char *ifname); |
| 49 | int set_cred(const char *ifname, int id, const char *field, const char *value); |
| 50 | int set_cred_quoted(const char *ifname, int id, const char *field, |
| 51 | const char *value); |
| 52 | |
| 53 | int start_sta_mode(struct sigma_dut *dut); |
| 54 | void stop_sta_mode(struct sigma_dut *dut); |
| 55 | |
| 56 | #endif /* WPA_HELPERS_H */ |