| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef __CONNMAN_INTERFACE_H__ |
| 23 |
#define __CONNMAN_INTERFACE_H__ |
| 24 |
|
| 25 |
#include <errno.h> |
| 26 |
#include <stdbool.h> |
| 27 |
#include <stdint.h> |
| 28 |
|
| 29 |
#include <glib.h> |
| 30 |
|
| 31 |
|
| 32 |
#include <stdio.h> |
| 33 |
|
| 34 |
|
| 35 |
enum connman_state { |
| 36 |
CONNMAN_STATE_UNKNOWN = 0, |
| 37 |
CONNMAN_STATE_OFFLINE = 1, |
| 38 |
CONNMAN_STATE_IDLE = 2, |
| 39 |
CONNMAN_STATE_READY = 3, |
| 40 |
CONNMAN_STATE_ONLINE = 4, |
| 41 |
CONNMAN_STATE_FAILURE = 5, |
| 42 |
}; |
| 43 |
|
| 44 |
struct connman_ipv4 { |
| 45 |
char *method; |
| 46 |
char *address; |
| 47 |
char *netmask; |
| 48 |
char *gateway; |
| 49 |
}; |
| 50 |
|
| 51 |
struct connman_ipv6 { |
| 52 |
char *method; |
| 53 |
char *address; |
| 54 |
uint8_t prefix; |
| 55 |
char *gateway; |
| 56 |
char *privacy; |
| 57 |
}; |
| 58 |
|
| 59 |
struct connman_proxy { |
| 60 |
char *method; |
| 61 |
char *url; |
| 62 |
char *servers; |
| 63 |
char *excludes; |
| 64 |
}; |
| 65 |
|
| 66 |
struct connman_provider { |
| 67 |
char *host; |
| 68 |
char *domain; |
| 69 |
char *name; |
| 70 |
char *type; |
| 71 |
}; |
| 72 |
|
| 73 |
struct connman_ethernet { |
| 74 |
char *method; |
| 75 |
char *interface; |
| 76 |
char *address; |
| 77 |
uint16_t mtu; |
| 78 |
uint16_t speed; |
| 79 |
char *duplex; |
| 80 |
}; |
| 81 |
|
| 82 |
typedef void (*connman_interface_cb_f)(void *user_data); |
| 83 |
typedef void (*connman_scan_cb_f)(void *user_data); |
| 84 |
typedef void (*connman_refresh_cb_f)(void *user_data); |
| 85 |
typedef void (*connman_property_changed_cb_f)(const char *path, |
| 86 |
const char *property, |
| 87 |
void *user_data); |
| 88 |
typedef void (*connman_property_set_cb_f)(const char *path, |
| 89 |
const char *property, |
| 90 |
int error, |
| 91 |
void *user_data); |
| 92 |
typedef void (*connman_path_changed_cb_f)(const char *path); |
| 93 |
|
| 94 |
typedef void (*agent_error_cb_f)(const char *path, const char *error); |
| 95 |
typedef void (*agent_browser_cb_f)(const char *path, const char *url); |
| 96 |
typedef void (*agent_input_cb_f)(const char *path, gboolean hidden, |
| 97 |
gboolean identity, gboolean passphrase, |
| 98 |
const char *previous_passphrase, gboolean wpspin, |
| 99 |
const char *previous_wpspin, gboolean login); |
| 100 |
typedef void (*agent_cancel_cb_f)(void); |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
int connman_interface_init(connman_interface_cb_f interface_connected_cb, |
| 107 |
connman_interface_cb_f interface_disconnected_cb, |
| 108 |
void *user_data); |
| 109 |
|
| 110 |
void connman_interface_finalize(void); |
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
int connman_manager_init(connman_property_changed_cb_f property_changed_cb, |
| 118 |
void *user_data); |
| 119 |
void connman_manager_finalize(void); |
| 120 |
|
| 121 |
int connman_manager_set_offlinemode(gboolean offlinemode); |
| 122 |
|
| 123 |
enum connman_state connman_manager_get_state(void); |
| 124 |
gboolean connman_manager_get_offlinemode(void); |
| 125 |
|
| 126 |
void connman_manager_register_agent(const char *path); |
| 127 |
void connman_manager_unregister_agent(const char *path); |
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
int connman_technology_init(void); |
| 134 |
void connman_technology_finalize(void); |
| 135 |
|
| 136 |
void connman_technology_set_global_property_callback( |
| 137 |
connman_property_changed_cb_f property_changed_cb, |
| 138 |
void *user_data); |
| 139 |
void connman_technology_set_property_changed_callback(const char *path, |
| 140 |
connman_property_changed_cb_f property_changed_cb, |
| 141 |
void *user_data); |
| 142 |
void connman_technology_set_property_error_callback(const char *path, |
| 143 |
connman_property_set_cb_f property_set_cb, |
| 144 |
void *user_data); |
| 145 |
void connman_technology_set_removed_callback( |
| 146 |
connman_path_changed_cb_f removed_cb); |
| 147 |
void connman_technology_set_added_callback(connman_path_changed_cb_f added_cb); |
| 148 |
|
| 149 |
GList *connman_technology_get_technologies(void); |
| 150 |
int connman_technology_scan(const char *path, |
| 151 |
connman_scan_cb_f callback, void *user_data); |
| 152 |
int connman_technology_enable(const char *path, gboolean enable); |
| 153 |
int connman_technology_tether(const char *path, gboolean tethering); |
| 154 |
|
| 155 |
int connman_technology_set_tethering_identifier(const char *path, |
| 156 |
const char *identifier); |
| 157 |
int connman_technology_set_tethering_passphrase(const char *path, |
| 158 |
const char *passphrase); |
| 159 |
|
| 160 |
const char *connman_technology_get_name(const char *path); |
| 161 |
const char *connman_technology_get_type(const char *path); |
| 162 |
gboolean connman_technology_is_enabled(const char *path); |
| 163 |
gboolean connman_technology_is_tethering(const char *path); |
| 164 |
const char *connman_technology_get_tethering_identifier(const char *path); |
| 165 |
const char *connman_technology_get_tethering_passphrase(const char *path); |
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
int connman_service_init(void); |
| 173 |
void connman_service_finalize(void); |
| 174 |
|
| 175 |
int connman_service_refresh_services_list(connman_refresh_cb_f refresh_cb, |
| 176 |
connman_scan_cb_f scan_cb, void *user_data); |
| 177 |
GSList *connman_service_get_services(void); |
| 178 |
void connman_service_free_services_list(void); |
| 179 |
void connman_service_set_property_changed_callback(const char *path, |
| 180 |
connman_property_changed_cb_f property_changed_cb, |
| 181 |
void *user_data); |
| 182 |
void connman_service_set_property_error_callback(const char *path, |
| 183 |
connman_property_set_cb_f property_set_cb, |
| 184 |
void *user_data); |
| 185 |
void connman_service_set_removed_callback( |
| 186 |
connman_path_changed_cb_f removed_cb); |
| 187 |
|
| 188 |
const char *connman_service_get_name(const char *path); |
| 189 |
const char *connman_service_get_type(const char *path); |
| 190 |
enum connman_state connman_service_get_state(const char *path); |
| 191 |
const char *connman_service_get_error(const char *path); |
| 192 |
const char *connman_service_get_security(const char *path); |
| 193 |
uint8_t connman_service_get_strength(const char *path); |
| 194 |
gboolean connman_service_is_favorite(const char *path); |
| 195 |
gboolean connman_service_is_immutable(const char *path); |
| 196 |
gboolean connman_service_is_autoconnect(const char *path); |
| 197 |
gboolean connman_service_is_roaming(const char *path); |
| 198 |
const char *connman_service_get_nameservers(const char *path); |
| 199 |
const char *connman_service_get_nameservers_config(const char *path); |
| 200 |
const char *connman_service_get_domains(const char *path); |
| 201 |
const char *connman_service_get_domains_config(const char *path); |
| 202 |
const char *connman_service_get_timeservers(const char *path); |
| 203 |
const char *connman_service_get_timeservers_config(const char *path); |
| 204 |
const struct connman_ipv4 *connman_service_get_ipv4(const char *path); |
| 205 |
const struct connman_ipv4 *connman_service_get_ipv4_config(const char *path); |
| 206 |
const struct connman_ipv6 *connman_service_get_ipv6(const char *path); |
| 207 |
const struct connman_ipv6 *connman_service_get_ipv6_config(const char *path); |
| 208 |
const struct connman_proxy *connman_service_get_proxy(const char *path); |
| 209 |
const struct connman_proxy *connman_service_get_proxy_config(const char *path); |
| 210 |
const struct connman_provider *connman_service_get_provider(const char *path); |
| 211 |
const struct connman_ethernet *connman_service_get_ethernet(const char *path); |
| 212 |
|
| 213 |
gboolean connman_service_is_connected(const char *path); |
| 214 |
|
| 215 |
int connman_service_select(const char *path); |
| 216 |
void connman_service_deselect(void); |
| 217 |
|
| 218 |
int connman_service_connect(const char *path); |
| 219 |
int connman_service_disconnect(const char *path); |
| 220 |
int connman_service_remove(const char *path); |
| 221 |
int connman_service_set_autoconnectable(const char *path, gboolean enable); |
| 222 |
int connman_service_set_ipv4_config(const char *path, |
| 223 |
const struct connman_ipv4 *ipv4_config); |
| 224 |
int connman_service_set_ipv6_config(const char *path, |
| 225 |
const struct connman_ipv6 *ipv6_config); |
| 226 |
int connman_service_set_proxy_config(const char *path, |
| 227 |
const struct connman_proxy *proxy_config); |
| 228 |
int connman_service_set_nameservers_config(const char *path, |
| 229 |
const char *nameservers_config); |
| 230 |
int connman_service_set_domains_config(const char *path, |
| 231 |
const char *domains_config); |
| 232 |
int connman_service_set_timeservers_config(const char *path, |
| 233 |
const char *timeservers_config); |
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
int connman_agent_init(void); |
| 240 |
void connman_agent_finalize(void); |
| 241 |
|
| 242 |
int connman_agent_set_error_cb(agent_error_cb_f error_cb); |
| 243 |
int connman_agent_set_browser_cb(agent_browser_cb_f browser_cb); |
| 244 |
int connman_agent_set_input_cb(agent_input_cb_f input_cb); |
| 245 |
int connman_agent_set_cancel_cb(agent_cancel_cb_f cancel_cb); |
| 246 |
|
| 247 |
void connman_agent_reply_retry(void); |
| 248 |
void connman_agent_reply_canceled(void); |
| 249 |
void connman_agent_reply_launch_browser(void); |
| 250 |
int connman_agent_reply_identity(const char *identity, const char *passphrase); |
| 251 |
int connman_agent_reply_passphrase(const char *hidden_name, |
| 252 |
const char *passphrase, gboolean wps, const char *wpspin); |
| 253 |
int connman_agent_reply_login(const char *username, const char *password); |
| 254 |
|
| 255 |
#endif |