2018-08-31 20:24:26 +02:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Wireless daemon for Linux
|
|
|
|
*
|
2019-10-25 00:43:08 +02:00
|
|
|
* Copyright (C) 2018-2019 Intel Corporation. All rights reserved.
|
2018-08-31 20:24:26 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
struct wiphy;
|
|
|
|
struct netdev;
|
2018-09-04 23:07:03 +02:00
|
|
|
struct station;
|
2018-09-01 00:44:10 +02:00
|
|
|
enum security;
|
|
|
|
struct scan_bss;
|
2021-02-03 17:31:24 +01:00
|
|
|
struct scan_freq_set;
|
2018-09-01 00:44:10 +02:00
|
|
|
struct network;
|
2018-08-31 20:24:26 +02:00
|
|
|
|
2018-09-04 17:40:45 +02:00
|
|
|
enum station_state {
|
2019-03-22 22:17:45 +01:00
|
|
|
/* Disconnected, no auto-connect */
|
|
|
|
STATION_STATE_DISCONNECTED,
|
|
|
|
/* Disconnected, try auto-connect with quick scan */
|
|
|
|
STATION_STATE_AUTOCONNECT_QUICK,
|
|
|
|
/* Disconnected, try auto-connect with full scan */
|
|
|
|
STATION_STATE_AUTOCONNECT_FULL,
|
|
|
|
/* Connecting */
|
|
|
|
STATION_STATE_CONNECTING,
|
2021-05-24 23:09:28 +02:00
|
|
|
STATION_STATE_CONNECTING_AUTO,
|
2018-09-04 17:40:45 +02:00
|
|
|
STATION_STATE_CONNECTED,
|
|
|
|
STATION_STATE_DISCONNECTING,
|
2022-09-28 20:33:50 +02:00
|
|
|
STATION_STATE_ROAMING, /* Reassociation */
|
|
|
|
STATION_STATE_FT_ROAMING, /* Fast transition */
|
|
|
|
STATION_STATE_FW_ROAMING, /* Firmware roamed by itself */
|
2024-01-05 15:47:48 +01:00
|
|
|
STATION_STATE_NETCONFIG,
|
2018-09-04 17:40:45 +02:00
|
|
|
};
|
|
|
|
|
2021-09-15 19:36:18 +02:00
|
|
|
enum station_event {
|
|
|
|
STATION_EVENT_ANQP_STARTED,
|
|
|
|
STATION_EVENT_ANQP_FINISHED,
|
2021-09-15 19:36:19 +02:00
|
|
|
STATION_EVENT_OWE_HIDDEN_STARTED,
|
|
|
|
STATION_EVENT_OWE_HIDDEN_FINISHED,
|
2020-06-12 21:14:11 +02:00
|
|
|
};
|
|
|
|
|
2018-09-04 23:07:03 +02:00
|
|
|
typedef void (*station_foreach_func_t)(struct station *, void *data);
|
2018-09-04 17:40:45 +02:00
|
|
|
typedef void (*station_state_watch_func_t)(enum station_state, void *userdata);
|
2021-09-15 19:36:18 +02:00
|
|
|
typedef void (*station_event_watch_func_t)(enum station_event,
|
2020-06-12 21:14:11 +02:00
|
|
|
struct network *network,
|
|
|
|
void *user_data);
|
2018-09-04 17:40:45 +02:00
|
|
|
typedef void (*station_destroy_func_t)(void *userdata);
|
2019-08-15 22:15:20 +02:00
|
|
|
typedef void (*station_network_foreach_func_t)(struct network *, void *data);
|
2018-09-04 17:40:45 +02:00
|
|
|
|
2018-09-04 22:33:46 +02:00
|
|
|
struct wiphy *station_get_wiphy(struct station *station);
|
2018-09-04 22:34:17 +02:00
|
|
|
struct netdev *station_get_netdev(struct station *station);
|
2018-09-04 22:38:56 +02:00
|
|
|
struct network *station_get_connected_network(struct station *station);
|
2018-09-04 23:26:13 +02:00
|
|
|
bool station_is_busy(struct station *station);
|
2018-09-04 22:33:46 +02:00
|
|
|
|
2018-09-01 23:21:28 +02:00
|
|
|
struct network *station_network_find(struct station *station, const char *ssid,
|
|
|
|
enum security security);
|
|
|
|
|
|
|
|
void station_set_scan_results(struct station *station, struct l_queue *bss_list,
|
2021-02-03 17:31:24 +01:00
|
|
|
const struct scan_freq_set *freqs,
|
|
|
|
bool add_to_autoconnect);
|
2018-09-01 23:21:28 +02:00
|
|
|
|
2018-09-04 17:40:45 +02:00
|
|
|
enum station_state station_get_state(struct station *station);
|
|
|
|
uint32_t station_add_state_watch(struct station *station,
|
|
|
|
station_state_watch_func_t func,
|
|
|
|
void *user_data,
|
|
|
|
station_destroy_func_t destroy);
|
|
|
|
bool station_remove_state_watch(struct station *station, uint32_t id);
|
|
|
|
|
2021-09-15 19:36:18 +02:00
|
|
|
uint32_t station_add_event_watch(station_event_watch_func_t func,
|
2020-06-12 21:14:11 +02:00
|
|
|
void *user_data,
|
|
|
|
station_destroy_func_t destroy);
|
2021-09-15 19:36:18 +02:00
|
|
|
void station_remove_event_watch(uint32_t id);
|
2020-06-12 21:14:11 +02:00
|
|
|
|
2018-09-05 01:00:48 +02:00
|
|
|
bool station_set_autoconnect(struct station *station, bool autoconnect);
|
|
|
|
|
2018-09-05 06:26:54 +02:00
|
|
|
int __station_connect_network(struct station *station, struct network *network,
|
2023-10-31 19:47:46 +01:00
|
|
|
struct scan_bss *bss, enum station_state state);
|
2018-09-05 06:26:54 +02:00
|
|
|
void station_connect_network(struct station *station, struct network *network,
|
|
|
|
struct scan_bss *bss,
|
|
|
|
struct l_dbus_message *message);
|
2018-09-05 02:54:48 +02:00
|
|
|
int station_disconnect(struct station *station);
|
|
|
|
|
2018-09-05 00:32:18 +02:00
|
|
|
struct station *station_find(uint32_t ifindex);
|
2018-09-04 23:07:03 +02:00
|
|
|
void station_foreach(station_foreach_func_t func, void *user_data);
|
2019-08-15 22:15:20 +02:00
|
|
|
|
|
|
|
void station_network_foreach(struct station *station,
|
|
|
|
station_network_foreach_func_t func,
|
|
|
|
void *user_data);
|
2019-10-29 18:50:41 +01:00
|
|
|
struct l_queue *station_get_bss_list(struct station *station);
|
|
|
|
struct scan_bss *station_get_connected_bss(struct station *station);
|
2021-02-02 05:43:34 +01:00
|
|
|
|
|
|
|
int station_hide_network(struct station *station, struct network *network);
|