2016-05-05 19:13:45 +02:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Wireless daemon for Linux
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013-2016 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-09-20 03:19:34 +02:00
|
|
|
enum security;
|
2016-05-16 19:04:45 +02:00
|
|
|
struct scan_bss;
|
2016-05-16 19:26:00 +02:00
|
|
|
struct wiphy;
|
2016-06-02 00:23:33 +02:00
|
|
|
struct netdev;
|
2016-05-31 19:57:24 +02:00
|
|
|
struct device;
|
2016-05-05 19:13:45 +02:00
|
|
|
|
2016-09-14 16:31:11 +02:00
|
|
|
enum device_event {
|
|
|
|
DEVICE_EVENT_INSERTED,
|
|
|
|
DEVICE_EVENT_REMOVED,
|
|
|
|
};
|
|
|
|
|
2016-06-14 18:11:06 +02:00
|
|
|
enum device_state {
|
2016-06-20 12:42:05 +02:00
|
|
|
DEVICE_STATE_OFF = 0, /* Interface down */
|
|
|
|
DEVICE_STATE_DISCONNECTED, /* Disconnected, no auto-connect */
|
2016-06-14 18:11:06 +02:00
|
|
|
DEVICE_STATE_AUTOCONNECT, /* Disconnected, try auto-connect */
|
|
|
|
DEVICE_STATE_CONNECTING, /* Connecting */
|
|
|
|
DEVICE_STATE_CONNECTED,
|
|
|
|
DEVICE_STATE_DISCONNECTING,
|
|
|
|
};
|
|
|
|
|
2016-09-14 16:31:11 +02:00
|
|
|
typedef void (*device_watch_func_t)(struct device *device,
|
|
|
|
enum device_event event,
|
|
|
|
void *userdata);
|
2016-09-14 16:09:44 +02:00
|
|
|
typedef void (*device_state_watch_func_t)(enum device_state, void *userdata);
|
2016-05-05 19:13:45 +02:00
|
|
|
typedef void (*device_destroy_func_t)(void *userdata);
|
|
|
|
|
2016-09-14 16:31:11 +02:00
|
|
|
uint32_t device_watch_add(device_watch_func_t func,
|
2016-05-05 19:13:45 +02:00
|
|
|
void *userdata, device_destroy_func_t destroy);
|
|
|
|
bool device_watch_remove(uint32_t id);
|
|
|
|
|
2016-05-31 19:57:24 +02:00
|
|
|
struct network *device_get_connected_network(struct device *device);
|
|
|
|
const char *device_get_path(struct device *device);
|
|
|
|
bool device_is_busy(struct device *device);
|
|
|
|
struct wiphy *device_get_wiphy(struct device *device);
|
2016-09-14 18:10:10 +02:00
|
|
|
struct netdev *device_get_netdev(struct device *device);
|
2016-06-14 18:12:18 +02:00
|
|
|
uint32_t device_get_ifindex(struct device *device);
|
|
|
|
const uint8_t *device_get_address(struct device *device);
|
2016-05-12 05:27:31 +02:00
|
|
|
|
2016-09-14 16:09:44 +02:00
|
|
|
uint32_t device_add_state_watch(struct device *device,
|
|
|
|
device_state_watch_func_t func,
|
|
|
|
void *user_data,
|
|
|
|
device_destroy_func_t destroy);
|
|
|
|
bool device_remove_state_watch(struct device *device, uint32_t id);
|
|
|
|
|
2016-09-20 03:35:57 +02:00
|
|
|
void device_set_scan_results(struct device *device, struct l_queue *bss_list);
|
2016-09-20 03:19:34 +02:00
|
|
|
struct network *device_network_find(struct device *device, const char *ssid,
|
|
|
|
enum security security);
|
|
|
|
|
2016-05-31 19:57:24 +02:00
|
|
|
void device_connect_network(struct device *device, struct network *network,
|
2016-05-16 19:04:45 +02:00
|
|
|
struct scan_bss *bss,
|
|
|
|
struct l_dbus_message *message);
|
2016-07-02 16:42:32 +02:00
|
|
|
int device_disconnect(struct device *device);
|
2016-05-31 19:57:24 +02:00
|
|
|
|
2016-06-02 00:23:33 +02:00
|
|
|
struct device *device_create(struct wiphy *wiphy, struct netdev *netdev);
|
|
|
|
void device_remove(struct device *device);
|
|
|
|
|
2016-05-05 19:13:45 +02:00
|
|
|
bool device_init(void);
|
|
|
|
bool device_exit(void);
|