network.h (4252B)
1 /* 2 * 3 * Wireless daemon for Linux 4 * 5 * Copyright (C) 2013-2019 Intel Corporation. All rights reserved. 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2.1 of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this library; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 * 21 */ 22 23 #include <stdbool.h> 24 #include <time.h> 25 26 enum security; 27 struct device; 28 struct station; 29 struct network; 30 struct scan_bss; 31 struct handshake_state; 32 struct erp_cache_entry; 33 struct scan_freq_set; 34 35 void network_connected(struct network *network); 36 void network_disconnected(struct network *network); 37 bool network_rankmod(const struct network *network, double *rankmod); 38 39 struct network *network_create(struct station *station, const char *ssid, 40 enum security security); 41 42 const char *network_get_ssid(const struct network *network); 43 const char *network_get_path(const struct network *network); 44 enum security network_get_security(const struct network *network); 45 bool network_set_passphrase(struct network *network, const char *passphrase); 46 int network_get_signal_strength(const struct network *network); 47 struct l_settings *network_get_settings(const struct network *network); 48 struct station *network_get_station(const struct network *network); 49 50 bool network_set_psk(struct network *network, const uint8_t *psk); 51 52 int network_set_transition_disable(struct network *network, 53 const uint8_t *td, size_t len); 54 55 int network_handshake_setup(struct network *network, struct scan_bss *bss, 56 struct handshake_state *hs); 57 58 void network_sync_settings(struct network *network); 59 60 const struct network_info *network_get_info(const struct network *network); 61 void network_set_info(struct network *network, struct network_info *info); 62 void network_set_force_default_ecc_group(struct network *network); 63 bool network_get_force_default_ecc_group(struct network *network); 64 65 bool network_update_known_frequencies(struct network *network); 66 67 int network_can_connect_bss(struct network *network, 68 const struct scan_bss *bss); 69 int network_autoconnect(struct network *network, struct scan_bss *bss); 70 void network_connect_failed(struct network *network, bool in_handshake); 71 void network_bss_list_clear(struct network *network); 72 bool network_bss_add(struct network *network, struct scan_bss *bss); 73 bool network_bss_update(struct network *network, struct scan_bss *bss); 74 const char *network_bss_get_path(const struct network *network, 75 const struct scan_bss *bss); 76 bool network_bss_list_isempty(struct network *network); 77 void network_clear_blacklist(struct network *network); 78 79 const char *__network_path_append_bss(const char *network_path, 80 const struct scan_bss *bss); 81 82 struct scan_bss *network_bss_list_pop(struct network *network); 83 struct scan_bss *network_bss_find_by_addr(struct network *network, 84 const uint8_t *addr); 85 struct scan_bss *network_bss_select(struct network *network, 86 bool fallback_to_blacklist); 87 88 bool network_register(struct network *network, const char *path); 89 90 void network_remove(struct network *network, int reason); 91 92 int network_rank_compare(const void *a, const void *b, void *user); 93 void network_rank_update(struct network *network, bool connected); 94 95 struct l_dbus_message *network_connect_new_hidden_network( 96 struct network *network, 97 struct l_dbus_message *message); 98 99 void network_blacklist_add(struct network *network, struct scan_bss *bss); 100 101 struct erp_cache_entry *network_get_erp_cache(struct network *network); 102 103 const struct l_queue_entry *network_bss_list_get_entries( 104 const struct network *network); 105 106 struct l_dbus_message *__network_connect(struct network *network, 107 struct scan_bss *bss, 108 struct l_dbus_message *message);