blob: 8e6ff372ec5fa5c08ffd64e8598d6d0e97f47def [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.
Jouni Malinencd4e3c32015-10-29 12:39:56 +02005 * All Rights Reserved.
6 * Licensed under the Clear BSD license. See README for more details.
7 */
8
9#ifndef WPA_HELPERS_H
10#define WPA_HELPERS_H
11
12char * get_main_ifname(void);
13char * get_station_ifname(void);
Danny Segalf2af39b2016-04-10 16:23:11 +030014const char * get_p2p_ifname(const char *primary_ifname);
Jouni Malinencd4e3c32015-10-29 12:39:56 +020015void dut_ifc_reset(struct sigma_dut *dut);
16
17int wpa_command(const char *ifname, const char *cmd);
18int wpa_command_resp(const char *ifname, const char *cmd,
19 char *resp, size_t resp_size);
20int get_wpa_status(const char *ifname, const char *field, char *obuf,
21 size_t obuf_size);
22void remove_wpa_networks(const char *ifname);
23
24struct wpa_ctrl * open_wpa_mon(const char *ifname);
25int wait_ip_addr(struct sigma_dut *dut, const char *ifname, int timeout);
26int get_wpa_cli_event(struct sigma_dut *dut, struct wpa_ctrl *mon,
27 const char *event, char *buf, size_t buf_size);
28int get_wpa_cli_event2(struct sigma_dut *dut, struct wpa_ctrl *mon,
29 const char *event, const char *event2,
30 char *buf, size_t buf_size);
31int get_wpa_cli_events(struct sigma_dut *dut, struct wpa_ctrl *mon,
32 const char **events, char *buf, size_t buf_size);
33
34int add_network(const char *ifname);
35int set_network(const char *ifname, int id, const char *field,
36 const char *value);
37int set_network_quoted(const char *ifname, int id, const char *field,
38 const char *value);
39int add_cred(const char *ifname);
40int set_cred(const char *ifname, int id, const char *field, const char *value);
41int set_cred_quoted(const char *ifname, int id, const char *field,
42 const char *value);
43
44int start_sta_mode(struct sigma_dut *dut);
45void stop_sta_mode(struct sigma_dut *dut);
46
47#endif /* WPA_HELPERS_H */