2015-06-18 12:18:26 +02:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Wireless daemon for Linux
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013-2015 Intel Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* 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>
|
2016-06-17 00:54:13 +02:00
|
|
|
#include <time.h>
|
2015-06-18 12:18:26 +02:00
|
|
|
|
2018-07-22 14:15:18 +02:00
|
|
|
enum security;
|
2016-05-31 19:57:24 +02:00
|
|
|
struct device;
|
2016-05-28 05:27:13 +02:00
|
|
|
struct network;
|
2016-06-14 18:14:45 +02:00
|
|
|
struct scan_bss;
|
2016-05-12 04:59:03 +02:00
|
|
|
|
2018-07-22 14:15:17 +02:00
|
|
|
void network_connected(struct network *network);
|
2016-06-09 19:55:18 +02:00
|
|
|
void network_disconnected(struct network *network);
|
2016-06-09 19:55:20 +02:00
|
|
|
bool network_rankmod(const struct network *network, double *rankmod);
|
2015-06-18 12:18:26 +02:00
|
|
|
|
2016-09-20 03:17:32 +02:00
|
|
|
struct network *network_create(struct device *device, const char *ssid,
|
2016-05-16 04:11:01 +02:00
|
|
|
enum security security);
|
|
|
|
|
2016-05-28 05:27:12 +02:00
|
|
|
const char *network_get_ssid(const struct network *network);
|
2016-05-31 19:57:24 +02:00
|
|
|
struct device *network_get_device(const struct network *network);
|
2016-05-28 05:27:12 +02:00
|
|
|
const char *network_get_path(const struct network *network);
|
|
|
|
enum security network_get_security(const struct network *network);
|
2016-09-21 21:38:43 +02:00
|
|
|
const uint8_t *network_get_psk(const struct network *network);
|
2018-08-07 23:29:06 +02:00
|
|
|
const char *network_get_passphrase(const struct network *network);
|
2018-04-18 07:03:34 +02:00
|
|
|
struct l_queue *network_get_secrets(const struct network *network);
|
2016-06-09 19:55:22 +02:00
|
|
|
int network_get_signal_strength(const struct network *network);
|
2016-05-28 05:27:12 +02:00
|
|
|
struct l_settings *network_get_settings(const struct network *network);
|
2016-05-12 05:00:58 +02:00
|
|
|
|
2016-09-21 23:20:09 +02:00
|
|
|
bool network_set_psk(struct network *network, const uint8_t *psk);
|
2016-05-16 04:04:02 +02:00
|
|
|
void network_sync_psk(struct network *network);
|
2016-05-16 22:43:32 +02:00
|
|
|
|
2016-05-16 21:24:21 +02:00
|
|
|
int network_autoconnect(struct network *network, struct scan_bss *bss);
|
2016-05-16 22:43:32 +02:00
|
|
|
void network_connect_failed(struct network *network);
|
2016-05-16 23:06:41 +02:00
|
|
|
bool network_bss_add(struct network *network, struct scan_bss *bss);
|
2016-05-16 23:13:36 +02:00
|
|
|
bool network_bss_list_isempty(struct network *network);
|
2016-05-16 23:13:52 +02:00
|
|
|
void network_bss_list_clear(struct network *network);
|
2016-09-20 03:26:41 +02:00
|
|
|
struct scan_bss *network_bss_find_by_addr(struct network *network,
|
|
|
|
const uint8_t *addr);
|
2016-09-21 21:00:59 +02:00
|
|
|
struct scan_bss *network_bss_select(struct network *network);
|
2016-05-16 03:47:41 +02:00
|
|
|
|
2016-05-16 04:30:10 +02:00
|
|
|
bool network_register(struct network *network, const char *path);
|
|
|
|
|
2016-06-10 11:49:34 +02:00
|
|
|
void network_remove(struct network *network, int reason);
|
2016-05-16 04:37:12 +02:00
|
|
|
|
2016-06-10 11:50:20 +02:00
|
|
|
int network_rank_compare(const void *a, const void *b, void *user);
|
|
|
|
void network_rank_update(struct network *network);
|
2016-06-17 00:54:13 +02:00
|
|
|
|
2018-07-11 00:46:55 +02:00
|
|
|
void network_connect_new_hidden_network(struct network *network,
|
|
|
|
struct l_dbus_message *message);
|
|
|
|
|
2016-06-17 00:54:13 +02:00
|
|
|
struct network_info {
|
|
|
|
char ssid[33];
|
|
|
|
enum security type;
|
|
|
|
struct timespec connected_time; /* Time last connected */
|
|
|
|
int seen_count; /* Ref count for network.info */
|
2018-06-29 06:02:52 +02:00
|
|
|
bool is_hidden:1;
|
2018-08-14 21:10:27 +02:00
|
|
|
bool is_known:1;
|
2016-06-17 00:54:13 +02:00
|
|
|
};
|
|
|
|
|
2018-08-09 16:33:45 +02:00
|
|
|
struct network_info *network_info_add_known(const char *ssid,
|
|
|
|
enum security security);
|
2018-07-22 14:15:18 +02:00
|
|
|
void network_info_forget_known(struct network_info *network);
|
|
|
|
bool network_info_match(const void *a, const void *b);
|
|
|
|
void network_info_free(void *data);
|