blob: 44f63f13d275d432a7d00bb47364458bf7f8a105 [file] [log] [blame]
Jouni Malinencd4e3c32015-10-29 12:39:56 +02001/*
2 * Sigma Control API DUT (station/AP)
3 * Copyright (c) 2010, Atheros Communications, Inc.
Jouni Malinen9d7e31d2017-12-22 18:55:04 +02004 * Copyright (c) 2012-2014, 2016, Qualcomm Atheros, Inc.
Kiran Kumar Lokerec86d8022018-10-11 13:57:12 -07005 * Copyright (c) 2018, The Linux Foundation
Jouni Malinencd4e3c32015-10-29 12:39:56 +02006 * 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 Malinen016ae6c2019-11-04 17:00:01 +020013const char * get_main_ifname(struct sigma_dut *dut);
14const char * get_station_ifname(struct sigma_dut *dut);
15const char * get_p2p_ifname(struct sigma_dut *dut, const char *primary_ifname);
Jouni Malinencd4e3c32015-10-29 12:39:56 +020016void dut_ifc_reset(struct sigma_dut *dut);
17
18int wpa_command(const char *ifname, const char *cmd);
Alexei Avshalom Lazardc7bf052018-12-23 16:49:49 +020019int hapd_command(const char *ifname, const char *cmd);
Jouni Malinencd4e3c32015-10-29 12:39:56 +020020int wpa_command_resp(const char *ifname, const char *cmd,
21 char *resp, size_t resp_size);
Alexei Avshalom Lazardc7bf052018-12-23 16:49:49 +020022int hapd_command_resp(const char *ifname, const char *cmd,
23 char *resp, size_t resp_size);
Jouni Malinencd4e3c32015-10-29 12:39:56 +020024int get_wpa_status(const char *ifname, const char *field, char *obuf,
25 size_t obuf_size);
Kiran Kumar Lokerec86d8022018-10-11 13:57:12 -070026int get_wpa_signal_poll(struct sigma_dut *dut, const char *ifname,
27 const char *field, char *obuf, size_t obuf_size);
Arif Hussain66a4af02019-02-07 15:04:51 -080028int get_wpa_ssid_bssid(struct sigma_dut *dut, const char *ifname,
29 char *buf, size_t buf_size);
Alexei Avshalom Lazar0c1d82d2018-12-23 17:02:42 +020030int get_hapd_config(const char *ifname, const char *field, char *obuf,
31 size_t obuf_size);
Jouni Malinencd4e3c32015-10-29 12:39:56 +020032void remove_wpa_networks(const char *ifname);
33
34struct wpa_ctrl * open_wpa_mon(const char *ifname);
Alexei Avshalom Lazar52ec2362018-12-18 15:58:31 +020035struct wpa_ctrl * open_hapd_mon(const char *ifname);
Jouni Malinencd4e3c32015-10-29 12:39:56 +020036int wait_ip_addr(struct sigma_dut *dut, const char *ifname, int timeout);
37int get_wpa_cli_event(struct sigma_dut *dut, struct wpa_ctrl *mon,
38 const char *event, char *buf, size_t buf_size);
39int 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);
42int get_wpa_cli_events(struct sigma_dut *dut, struct wpa_ctrl *mon,
43 const char **events, char *buf, size_t buf_size);
44
45int add_network(const char *ifname);
46int set_network(const char *ifname, int id, const char *field,
47 const char *value);
48int set_network_quoted(const char *ifname, int id, const char *field,
49 const char *value);
50int add_cred(const char *ifname);
51int set_cred(const char *ifname, int id, const char *field, const char *value);
52int set_cred_quoted(const char *ifname, int id, const char *field,
53 const char *value);
54
Alexei Avshalom Lazarc9bc15d2020-01-29 10:52:13 +020055const char * concat_sigma_tmpdir(struct sigma_dut *dut, const char *src,
56 char *dst, size_t len);
57
Jouni Malinencd4e3c32015-10-29 12:39:56 +020058int start_sta_mode(struct sigma_dut *dut);
59void stop_sta_mode(struct sigma_dut *dut);
60
61#endif /* WPA_HELPERS_H */