5 * Copyright (C) 2007-2012 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #define CONNMAN_API_SUBJECT_TO_CHANGE
26 #include <connman/dbus.h>
28 dbus_bool_t __connman_dbus_append_objpath_dict_array(DBusMessage *msg,
29 connman_dbus_append_cb_t function, void *user_data);
30 int __connman_dbus_init(DBusConnection *conn);
31 void __connman_dbus_cleanup(void);
33 DBusMessage *__connman_error_failed(DBusMessage *msg, int errnum);
34 DBusMessage *__connman_error_invalid_arguments(DBusMessage *msg);
35 DBusMessage *__connman_error_permission_denied(DBusMessage *msg);
36 DBusMessage *__connman_error_passphrase_required(DBusMessage *msg);
37 DBusMessage *__connman_error_not_registered(DBusMessage *msg);
38 DBusMessage *__connman_error_not_unique(DBusMessage *msg);
39 DBusMessage *__connman_error_not_supported(DBusMessage *msg);
40 DBusMessage *__connman_error_not_implemented(DBusMessage *msg);
41 DBusMessage *__connman_error_not_found(DBusMessage *msg);
42 DBusMessage *__connman_error_no_carrier(DBusMessage *msg);
43 DBusMessage *__connman_error_in_progress(DBusMessage *msg);
44 DBusMessage *__connman_error_already_exists(DBusMessage *msg);
45 DBusMessage *__connman_error_already_enabled(DBusMessage *msg);
46 DBusMessage *__connman_error_already_disabled(DBusMessage *msg);
47 DBusMessage *__connman_error_already_connected(DBusMessage *msg);
48 DBusMessage *__connman_error_not_connected(DBusMessage *msg);
49 DBusMessage *__connman_error_operation_aborted(DBusMessage *msg);
50 DBusMessage *__connman_error_operation_timeout(DBusMessage *msg);
51 DBusMessage *__connman_error_invalid_service(DBusMessage *msg);
52 DBusMessage *__connman_error_invalid_property(DBusMessage *msg);
54 #include <connman/types.h>
56 int __connman_manager_init(void);
57 void __connman_manager_cleanup(void);
59 int __connman_clock_init(void);
60 void __connman_clock_cleanup(void);
62 void __connman_clock_update_timezone(void);
64 int __connman_timezone_init(void);
65 void __connman_timezone_cleanup(void);
67 char *__connman_timezone_lookup(void);
68 int __connman_timezone_change(const char *zone);
70 int __connman_agent_init(void);
71 void __connman_agent_cleanup(void);
73 void __connman_counter_send_usage(const char *path,
74 DBusMessage *message);
75 int __connman_counter_register(const char *owner, const char *path,
76 unsigned int interval);
77 int __connman_counter_unregister(const char *owner, const char *path);
79 int __connman_counter_init(void);
80 void __connman_counter_cleanup(void);
82 struct connman_service;
84 void __connman_agent_cancel(struct connman_service *service);
86 int __connman_service_add_passphrase(struct connman_service *service,
87 const gchar *passphrase);
88 typedef void (* authentication_cb_t) (struct connman_service *service,
89 connman_bool_t values_received,
90 const char *name, int name_len,
91 const char *identifier, const char *secret,
92 gboolean wps, const char *wpspin,
93 const char *error, void *user_data);
94 typedef void (* browser_authentication_cb_t) (struct connman_service *service,
95 connman_bool_t authentication_done,
96 const char *error, void *user_data);
97 int __connman_agent_request_passphrase_input(struct connman_service *service,
98 authentication_cb_t callback, void *user_data);
99 int __connman_agent_request_login_input(struct connman_service *service,
100 authentication_cb_t callback, void *user_data);
101 int __connman_agent_request_browser(struct connman_service *service,
102 browser_authentication_cb_t callback,
103 const char *url, void *user_data);
105 #include <connman/log.h>
107 int __connman_log_init(const char *program, const char *debug,
108 connman_bool_t detach, connman_bool_t backtrace,
109 const char *program_name, const char *program_version);
110 void __connman_log_cleanup(connman_bool_t backtrace);
111 void __connman_log_enable(struct connman_debug_desc *start,
112 struct connman_debug_desc *stop);
114 #include <connman/option.h>
116 #include <connman/setting.h>
118 #include <connman/plugin.h>
120 int __connman_plugin_init(const char *pattern, const char *exclude);
121 void __connman_plugin_cleanup(void);
123 #include <connman/task.h>
125 int __connman_task_init(void);
126 void __connman_task_cleanup(void);
128 #include <connman/inet.h>
130 char **__connman_inet_get_running_interfaces(void);
131 int __connman_inet_modify_address(int cmd, int flags, int index, int family,
134 unsigned char prefixlen,
135 const char *broadcast);
137 #include <netinet/ip6.h>
138 #include <netinet/icmp6.h>
140 typedef void (*__connman_inet_rs_cb_t) (struct nd_router_advert *reply,
141 unsigned int length, void *user_data);
143 int __connman_inet_ipv6_send_rs(int index, int timeout,
144 __connman_inet_rs_cb_t callback, void *user_data);
146 int __connman_refresh_rs_ipv6(struct connman_network *network, int index);
148 GSList *__connman_inet_ipv6_get_prefixes(struct nd_router_advert *hdr,
149 unsigned int length);
150 typedef void (*connman_inet_addr_cb_t) (const char *src_address, int index,
152 int __connman_inet_get_route(const char *dst_address,
153 connman_inet_addr_cb_t callback, void *user_data);
155 struct __connman_inet_rtnl_handle {
157 struct sockaddr_nl local;
158 struct sockaddr_nl peer;
169 struct ifaddrmsg ifa;
176 int __connman_inet_rtnl_open(struct __connman_inet_rtnl_handle *rth);
177 typedef void (*__connman_inet_rtnl_cb_t) (struct nlmsghdr *answer,
179 int __connman_inet_rtnl_talk(struct __connman_inet_rtnl_handle *rtnl,
180 struct nlmsghdr *n, int timeout,
181 __connman_inet_rtnl_cb_t callback, void *user_data);
183 int __connman_inet_rtnl_send(struct __connman_inet_rtnl_handle *rtnl,
186 return __connman_inet_rtnl_talk(rtnl, n, 0, NULL, NULL);
189 void __connman_inet_rtnl_close(struct __connman_inet_rtnl_handle *rth);
190 int __connman_inet_rtnl_addattr_l(struct nlmsghdr *n, size_t max_length,
191 int type, const void *data, size_t data_length);
192 int __connman_inet_rtnl_addattr32(struct nlmsghdr *n, size_t maxlen,
193 int type, __u32 data);
195 #include <connman/resolver.h>
197 int __connman_resolver_init(connman_bool_t dnsproxy);
198 void __connman_resolver_cleanup(void);
199 int __connman_resolvfile_append(int index, const char *domain, const char *server);
200 int __connman_resolvfile_remove(int index, const char *domain, const char *server);
201 int __connman_resolver_redo_servers(int index);
203 GKeyFile *__connman_storage_open_global(void);
204 GKeyFile *__connman_storage_load_global(void);
205 int __connman_storage_save_global(GKeyFile *keyfile);
206 void __connman_storage_delete_global(void);
208 GKeyFile *__connman_storage_load_config(const char *ident);
209 GKeyFile *__connman_storage_load_provider_config(const char *ident);
211 GKeyFile *__connman_storage_open_service(const char *ident);
212 int __connman_storage_save_service(GKeyFile *keyfile, const char *ident);
213 GKeyFile *__connman_storage_load_provider(const char *identifier);
214 void __connman_storage_save_provider(GKeyFile *keyfile, const char *identifier);
215 gboolean __connman_storage_remove_provider(const char *identifier);
216 char **__connman_storage_get_providers(void);
217 gboolean __connman_storage_remove_service(const char *service_id);
219 int __connman_detect_init(void);
220 void __connman_detect_cleanup(void);
222 #include <connman/inotify.h>
224 int __connman_inotify_init(void);
225 void __connman_inotify_cleanup(void);
227 #include <connman/proxy.h>
229 int __connman_proxy_init(void);
230 void __connman_proxy_cleanup(void);
232 #include <connman/ipconfig.h>
234 struct connman_ipaddress {
236 unsigned char prefixlen;
243 struct connman_ipconfig_ops {
244 void (*up) (struct connman_ipconfig *ipconfig);
245 void (*down) (struct connman_ipconfig *ipconfig);
246 void (*lower_up) (struct connman_ipconfig *ipconfig);
247 void (*lower_down) (struct connman_ipconfig *ipconfig);
248 void (*ip_bound) (struct connman_ipconfig *ipconfig);
249 void (*ip_release) (struct connman_ipconfig *ipconfig);
250 void (*route_set) (struct connman_ipconfig *ipconfig);
251 void (*route_unset) (struct connman_ipconfig *ipconfig);
254 struct connman_ipconfig *__connman_ipconfig_create(int index,
255 enum connman_ipconfig_type type);
257 #define __connman_ipconfig_ref(ipconfig) \
258 __connman_ipconfig_ref_debug(ipconfig, __FILE__, __LINE__, __func__)
259 #define __connman_ipconfig_unref(ipconfig) \
260 __connman_ipconfig_unref_debug(ipconfig, __FILE__, __LINE__, __func__)
262 struct connman_ipconfig *
263 __connman_ipconfig_ref_debug(struct connman_ipconfig *ipconfig,
264 const char *file, int line, const char *caller);
265 void __connman_ipconfig_unref_debug(struct connman_ipconfig *ipconfig,
266 const char *file, int line, const char *caller);
268 void __connman_ipconfig_clear_address(struct connman_ipconfig *ipconfig);
269 void *__connman_ipconfig_get_data(struct connman_ipconfig *ipconfig);
270 void __connman_ipconfig_set_data(struct connman_ipconfig *ipconfig, void *data);
272 int __connman_ipconfig_get_index(struct connman_ipconfig *ipconfig);
273 const char *__connman_ipconfig_get_ifname(struct connman_ipconfig *ipconfig);
275 void __connman_ipconfig_set_ops(struct connman_ipconfig *ipconfig,
276 const struct connman_ipconfig_ops *ops);
277 int __connman_ipconfig_set_method(struct connman_ipconfig *ipconfig,
278 enum connman_ipconfig_method method);
279 void __connman_ipconfig_disable_ipv6(struct connman_ipconfig *ipconfig);
280 void __connman_ipconfig_enable_ipv6(struct connman_ipconfig *ipconfig);
282 int __connman_ipconfig_init(void);
283 void __connman_ipconfig_cleanup(void);
285 struct rtnl_link_stats;
287 void __connman_ipconfig_newlink(int index, unsigned short type,
288 unsigned int flags, const char *address,
290 struct rtnl_link_stats *stats);
291 void __connman_ipconfig_dellink(int index, struct rtnl_link_stats *stats);
292 void __connman_ipconfig_newaddr(int index, int family, const char *label,
293 unsigned char prefixlen, const char *address);
294 void __connman_ipconfig_deladdr(int index, int family, const char *label,
295 unsigned char prefixlen, const char *address);
296 void __connman_ipconfig_newroute(int index, int family, unsigned char scope,
297 const char *dst, const char *gateway);
298 void __connman_ipconfig_delroute(int index, int family, unsigned char scope,
299 const char *dst, const char *gateway);
301 void __connman_ipconfig_foreach(void (*function) (int index, void *user_data),
303 enum connman_ipconfig_type __connman_ipconfig_get_config_type(
304 struct connman_ipconfig *ipconfig);
305 unsigned short __connman_ipconfig_get_type_from_index(int index);
306 unsigned int __connman_ipconfig_get_flags_from_index(int index);
307 const char *__connman_ipconfig_get_gateway_from_index(int index,
308 enum connman_ipconfig_type type);
309 void __connman_ipconfig_set_index(struct connman_ipconfig *ipconfig, int index);
311 const char *__connman_ipconfig_get_local(struct connman_ipconfig *ipconfig);
312 void __connman_ipconfig_set_local(struct connman_ipconfig *ipconfig, const char *address);
313 const char *__connman_ipconfig_get_peer(struct connman_ipconfig *ipconfig);
314 void __connman_ipconfig_set_peer(struct connman_ipconfig *ipconfig, const char *address);
315 const char *__connman_ipconfig_get_broadcast(struct connman_ipconfig *ipconfig);
316 void __connman_ipconfig_set_broadcast(struct connman_ipconfig *ipconfig, const char *broadcast);
317 const char *__connman_ipconfig_get_gateway(struct connman_ipconfig *ipconfig);
318 void __connman_ipconfig_set_gateway(struct connman_ipconfig *ipconfig, const char *gateway);
319 unsigned char __connman_ipconfig_get_prefixlen(struct connman_ipconfig *ipconfig);
320 void __connman_ipconfig_set_prefixlen(struct connman_ipconfig *ipconfig, unsigned char prefixlen);
322 int __connman_ipconfig_enable(struct connman_ipconfig *ipconfig);
323 int __connman_ipconfig_disable(struct connman_ipconfig *ipconfig);
324 connman_bool_t __connman_ipconfig_is_usable(struct connman_ipconfig *ipconfig);
326 const char *__connman_ipconfig_method2string(enum connman_ipconfig_method method);
327 const char *__connman_ipconfig_type2string(enum connman_ipconfig_type type);
328 enum connman_ipconfig_method __connman_ipconfig_string2method(const char *method);
330 void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig,
331 DBusMessageIter *iter);
332 void __connman_ipconfig_append_ipv4config(struct connman_ipconfig *ipconfig,
333 DBusMessageIter *iter);
334 void __connman_ipconfig_append_ipv6(struct connman_ipconfig *ipconfig,
335 DBusMessageIter *iter,
336 struct connman_ipconfig *ip4config);
337 void __connman_ipconfig_append_ipv6config(struct connman_ipconfig *ipconfig,
338 DBusMessageIter *iter);
339 int __connman_ipconfig_set_config(struct connman_ipconfig *ipconfig,
340 DBusMessageIter *array);
341 void __connman_ipconfig_append_ethernet(struct connman_ipconfig *ipconfig,
342 DBusMessageIter *iter);
343 enum connman_ipconfig_method __connman_ipconfig_get_method(
344 struct connman_ipconfig *ipconfig);
346 int __connman_ipconfig_address_add(struct connman_ipconfig *ipconfig);
347 int __connman_ipconfig_address_remove(struct connman_ipconfig *ipconfig);
348 int __connman_ipconfig_address_unset(struct connman_ipconfig *ipconfig);
349 int __connman_ipconfig_gateway_add(struct connman_ipconfig *ipconfig);
350 void __connman_ipconfig_gateway_remove(struct connman_ipconfig *ipconfig);
351 unsigned char __connman_ipaddress_netmask_prefix_len(const char *netmask);
353 int __connman_ipconfig_set_proxy_autoconfig(struct connman_ipconfig *ipconfig,
355 const char *__connman_ipconfig_get_proxy_autoconfig(struct connman_ipconfig *ipconfig);
356 void __connman_ipconfig_set_dhcp_address(struct connman_ipconfig *ipconfig,
357 const char *address);
358 char *__connman_ipconfig_get_dhcp_address(struct connman_ipconfig *ipconfig);
360 int __connman_ipconfig_load(struct connman_ipconfig *ipconfig,
361 GKeyFile *keyfile, const char *identifier, const char *prefix);
362 int __connman_ipconfig_save(struct connman_ipconfig *ipconfig,
363 GKeyFile *keyfile, const char *identifier, const char *prefix);
364 gboolean __connman_ipconfig_ipv6_privacy_enabled(struct connman_ipconfig *ipconfig);
365 int __connman_ipconfig_ipv6_set_privacy(struct connman_ipconfig *ipconfig,
368 int __connman_ipconfig_set_rp_filter();
369 void __connman_ipconfig_unset_rp_filter(int old_value);
371 #include <connman/utsname.h>
373 int __connman_utsname_set_hostname(const char *hostname);
374 int __connman_utsname_set_domainname(const char *domainname);
376 #include <connman/timeserver.h>
378 int __connman_timeserver_init(void);
379 void __connman_timeserver_cleanup(void);
381 char **__connman_timeserver_system_get();
383 GSList *__connman_timeserver_add_list(GSList *server_list,
384 const char *timeserver);
385 GSList *__connman_timeserver_get_all(struct connman_service *service);
386 int __connman_timeserver_sync(struct connman_service *service);
387 void __connman_timeserver_sync_next();
389 typedef void (* dhcp_cb) (struct connman_network *network,
390 connman_bool_t success);
391 int __connman_dhcp_start(struct connman_network *network, dhcp_cb callback);
392 void __connman_dhcp_stop(struct connman_network *network);
393 int __connman_dhcp_init(void);
394 void __connman_dhcp_cleanup(void);
395 int __connman_dhcpv6_init(void);
396 void __connman_dhcpv6_cleanup(void);
397 int __connman_dhcpv6_start_info(struct connman_network *network,
399 void __connman_dhcpv6_stop(struct connman_network *network);
400 int __connman_dhcpv6_start(struct connman_network *network,
401 GSList *prefixes, dhcp_cb callback);
402 int __connman_dhcpv6_start_renew(struct connman_network *network,
404 int __connman_dhcpv6_start_release(struct connman_network *network,
407 int __connman_ipv4_init(void);
408 void __connman_ipv4_cleanup(void);
410 int __connman_connection_init(void);
411 void __connman_connection_cleanup(void);
413 int __connman_connection_gateway_add(struct connman_service *service,
415 enum connman_ipconfig_type type,
417 void __connman_connection_gateway_remove(struct connman_service *service,
418 enum connman_ipconfig_type type);
419 int __connman_connection_get_vpn_index(int phy_index);
421 gboolean __connman_connection_update_gateway(void);
422 void __connman_connection_gateway_activate(struct connman_service *service,
423 enum connman_ipconfig_type type);
425 int __connman_ntp_start(char *server);
426 void __connman_ntp_stop();
428 int __connman_wpad_init(void);
429 void __connman_wpad_cleanup(void);
430 int __connman_wpad_start(struct connman_service *service);
431 void __connman_wpad_stop(struct connman_service *service);
433 int __connman_wispr_init(void);
434 void __connman_wispr_cleanup(void);
435 int __connman_wispr_start(struct connman_service *service,
436 enum connman_ipconfig_type type);
437 void __connman_wispr_stop(struct connman_service *service);
439 #include <connman/technology.h>
441 void __connman_technology_list_struct(DBusMessageIter *array);
443 int __connman_technology_add_device(struct connman_device *device);
444 int __connman_technology_remove_device(struct connman_device *device);
445 int __connman_technology_enabled(enum connman_service_type type);
446 int __connman_technology_disabled(enum connman_service_type type);
447 int __connman_technology_set_offlinemode(connman_bool_t offlinemode);
448 connman_bool_t __connman_technology_get_offlinemode(void);
449 void __connman_technology_set_connected(enum connman_service_type type,
450 connman_bool_t connected);
452 int __connman_technology_add_rfkill(unsigned int index,
453 enum connman_service_type type,
454 connman_bool_t softblock,
455 connman_bool_t hardblock);
456 int __connman_technology_update_rfkill(unsigned int index,
457 enum connman_service_type type,
458 connman_bool_t softblock,
459 connman_bool_t hardblock);
460 int __connman_technology_remove_rfkill(unsigned int index,
461 enum connman_service_type type);
463 void __connman_technology_scan_started(struct connman_device *device);
464 void __connman_technology_scan_stopped(struct connman_device *device);
465 void __connman_technology_add_interface(enum connman_service_type type,
466 int index, const char *name, const char *ident);
467 void __connman_technology_remove_interface(enum connman_service_type type,
468 int index, const char *name, const char *ident);
469 void __connman_technology_notify_regdom_by_device(struct connman_device *device,
470 int result, const char *alpha2);
472 #include <connman/device.h>
474 int __connman_device_init(const char *device, const char *nodevice);
475 void __connman_device_cleanup(void);
477 void __connman_device_list(DBusMessageIter *iter, void *user_data);
479 enum connman_service_type __connman_device_get_service_type(struct connman_device *device);
480 struct connman_device *__connman_device_find_device(enum connman_service_type type);
481 int __connman_device_request_scan(enum connman_service_type type);
482 int __connman_device_request_hidden_scan(struct connman_device *device,
483 const char *ssid, unsigned int ssid_len,
484 const char *identity, const char *passphrase,
487 connman_bool_t __connman_device_isfiltered(const char *devname);
489 void __connman_device_set_network(struct connman_device *device,
490 struct connman_network *network);
491 void __connman_device_cleanup_networks(struct connman_device *device);
493 int __connman_device_enable(struct connman_device *device);
494 int __connman_device_disable(struct connman_device *device);
495 int __connman_device_disconnect(struct connman_device *device);
497 connman_bool_t __connman_device_has_driver(struct connman_device *device);
499 void __connman_device_set_reconnect(struct connman_device *device,
500 connman_bool_t reconnect);
501 connman_bool_t __connman_device_get_reconnect(struct connman_device *device);
503 const char *__connman_device_get_type(struct connman_device *device);
505 int __connman_rfkill_init(void);
506 void __connman_rfkill_cleanup(void);
507 int __connman_rfkill_block(enum connman_service_type type, connman_bool_t block);
509 #include <connman/network.h>
511 int __connman_network_init(void);
512 void __connman_network_cleanup(void);
514 void __connman_network_set_device(struct connman_network *network,
515 struct connman_device *device);
517 int __connman_network_connect(struct connman_network *network);
518 int __connman_network_disconnect(struct connman_network *network);
519 int __connman_network_clear_ipconfig(struct connman_network *network,
520 struct connman_ipconfig *ipconfig);
521 int __connman_network_set_ipconfig(struct connman_network *network,
522 struct connman_ipconfig *ipconfig_ipv4,
523 struct connman_ipconfig *ipconfig_ipv6);
525 const char *__connman_network_get_type(struct connman_network *network);
526 const char *__connman_network_get_group(struct connman_network *network);
527 const char *__connman_network_get_ident(struct connman_network *network);
528 connman_bool_t __connman_network_get_weakness(struct connman_network *network);
530 int __connman_config_init();
531 void __connman_config_cleanup(void);
533 int __connman_config_load_service(GKeyFile *keyfile, const char *group, connman_bool_t persistent);
534 int __connman_config_provision_service(struct connman_service *service);
535 int __connman_config_provision_service_ident(struct connman_service *service,
536 const char *ident, const char *file, const char *entry);
538 int __connman_tethering_init(void);
539 void __connman_tethering_cleanup(void);
541 const char *__connman_tethering_get_bridge(void);
542 void __connman_tethering_set_enabled(void);
543 void __connman_tethering_set_disabled(void);
545 int __connman_private_network_request(DBusMessage *msg, const char *owner);
546 int __connman_private_network_release(const char *path);
548 #include <connman/provider.h>
550 connman_bool_t __connman_provider_check_routes(struct connman_provider *provider);
551 int __connman_provider_append_user_route(struct connman_provider *provider,
552 int family, const char *network, const char *netmask);
553 void __connman_provider_append_properties(struct connman_provider *provider, DBusMessageIter *iter);
554 void __connman_provider_list(DBusMessageIter *iter, void *user_data);
555 int __connman_provider_create_and_connect(DBusMessage *msg);
556 const char * __connman_provider_get_ident(struct connman_provider *provider);
557 int __connman_provider_indicate_state(struct connman_provider *provider,
558 enum connman_provider_state state);
559 int __connman_provider_indicate_error(struct connman_provider *provider,
560 enum connman_provider_error error);
561 int __connman_provider_connect(struct connman_provider *provider);
562 int __connman_provider_remove_by_path(const char *path);
563 void __connman_provider_cleanup(void);
564 int __connman_provider_init(void);
566 #include <connman/service.h>
568 int __connman_service_init(void);
569 void __connman_service_cleanup(void);
571 void __connman_service_list_struct(DBusMessageIter *iter);
573 struct connman_service *__connman_service_lookup_from_index(int index);
574 struct connman_service *__connman_service_lookup_from_ident(const char *identifier);
575 struct connman_service *__connman_service_create_from_network(struct connman_network *network);
576 struct connman_service *__connman_service_create_from_provider(struct connman_provider *provider);
577 struct connman_service *__connman_service_get_default(void);
578 void __connman_service_update_from_network(struct connman_network *network);
579 void __connman_service_remove_from_network(struct connman_network *network);
580 void __connman_service_read_ip4config(struct connman_service *service);
581 void __connman_service_read_ip6config(struct connman_service *service);
583 struct connman_ipconfig *__connman_service_get_ip4config(
584 struct connman_service *service);
585 struct connman_ipconfig *__connman_service_get_ip6config(
586 struct connman_service *service);
587 struct connman_ipconfig *__connman_service_get_ipconfig(
588 struct connman_service *service, int family);
589 connman_bool_t __connman_service_is_connected_state(struct connman_service *service,
590 enum connman_ipconfig_type type);
591 const char *__connman_service_get_ident(struct connman_service *service);
592 const char *__connman_service_get_path(struct connman_service *service);
593 unsigned int __connman_service_get_order(struct connman_service *service);
594 void __connman_service_update_ordering(void);
595 struct connman_network *__connman_service_get_network(struct connman_service *service);
596 enum connman_service_security __connman_service_get_security(struct connman_service *service);
597 const char *__connman_service_get_phase2(struct connman_service *service);
598 connman_bool_t __connman_service_wps_enabled(struct connman_service *service);
599 int __connman_service_set_favorite(struct connman_service *service,
600 connman_bool_t favorite);
601 int __connman_service_set_favorite_delayed(struct connman_service *service,
602 connman_bool_t favorite,
603 gboolean delay_ordering);
604 int __connman_service_set_immutable(struct connman_service *service,
605 connman_bool_t immutable);
606 int __connman_service_set_ignore(struct connman_service *service,
607 connman_bool_t ignore);
608 void __connman_service_set_userconnect(struct connman_service *service,
609 connman_bool_t userconnect);
610 void __connman_service_set_search_domains(struct connman_service *service,
613 void __connman_service_set_string(struct connman_service *service,
614 const char *key, const char *value);
615 int __connman_service_online_check_failed(struct connman_service *service,
616 enum connman_ipconfig_type type);
617 int __connman_service_ipconfig_indicate_state(struct connman_service *service,
618 enum connman_service_state new_state,
619 enum connman_ipconfig_type type);
620 enum connman_service_state __connman_service_ipconfig_get_state(
621 struct connman_service *service,
622 enum connman_ipconfig_type type);
624 int __connman_service_indicate_error(struct connman_service *service,
625 enum connman_service_error error);
626 int __connman_service_clear_error(struct connman_service *service);
627 int __connman_service_indicate_default(struct connman_service *service);
629 int __connman_service_connect(struct connman_service *service);
630 int __connman_service_disconnect(struct connman_service *service);
631 int __connman_service_disconnect_all(void);
632 void __connman_service_auto_connect(void);
633 gboolean __connman_service_remove(struct connman_service *service);
634 connman_bool_t __connman_service_is_provider_pending(struct connman_service *service);
635 void __connman_service_set_provider_pending(struct connman_service *service,
637 void __connman_service_set_hidden_data(struct connman_service *service,
639 void __connman_service_return_error(struct connman_service *service,
640 int error, gpointer user_data);
641 void __connman_service_reply_dbus_pending(DBusMessage *pending, int error,
644 int __connman_service_provision_changed(const char *ident);
645 void __connman_service_set_config(struct connman_service *service,
646 const char *file_id, const char *section);
648 const char *__connman_service_type2string(enum connman_service_type type);
649 enum connman_service_type __connman_service_string2type(const char *str);
651 int __connman_service_nameserver_append(struct connman_service *service,
652 const char *nameserver, gboolean is_auto);
653 int __connman_service_nameserver_remove(struct connman_service *service,
654 const char *nameserver, gboolean is_auto);
655 void __connman_service_nameserver_clear(struct connman_service *service);
656 void __connman_service_nameserver_add_routes(struct connman_service *service,
658 void __connman_service_nameserver_del_routes(struct connman_service *service,
659 enum connman_ipconfig_type type);
660 void __connman_service_set_timeservers(struct connman_service *service,
662 int __connman_service_timeserver_append(struct connman_service *service,
663 const char *timeserver);
664 int __connman_service_timeserver_remove(struct connman_service *service,
665 const char *timeserver);
666 void __connman_service_timeserver_changed(struct connman_service *service,
668 void __connman_service_set_pac(struct connman_service *service,
670 connman_bool_t __connman_service_is_hidden(struct connman_service *service);
671 connman_bool_t __connman_service_is_split_routing(struct connman_service *service);
672 int __connman_service_get_index(struct connman_service *service);
673 void __connman_service_set_hidden(struct connman_service *service);
674 void __connman_service_set_domainname(struct connman_service *service,
675 const char *domainname);
676 const char *__connman_service_get_domainname(struct connman_service *service);
677 const char *__connman_service_get_nameserver(struct connman_service *service);
678 void __connman_service_set_proxy_autoconfig(struct connman_service *service,
681 void __connman_service_set_identity(struct connman_service *service,
682 const char *identity);
683 void __connman_service_set_agent_identity(struct connman_service *service,
684 const char *agent_identity);
685 int __connman_service_set_passphrase(struct connman_service *service,
686 const char *passphrase);
687 const char *__connman_service_get_passphrase(struct connman_service *service);
688 void __connman_service_set_agent_passphrase(struct connman_service *service,
689 const char *agent_passphrase);
690 int __connman_service_reset_ipconfig(struct connman_service *service,
691 enum connman_ipconfig_type type, DBusMessageIter *array,
692 enum connman_service_state *new_state);
694 void __connman_service_notify(struct connman_service *service,
695 unsigned int rx_packets, unsigned int tx_packets,
696 unsigned int rx_bytes, unsigned int tx_bytes,
697 unsigned int rx_error, unsigned int tx_error,
698 unsigned int rx_dropped, unsigned int tx_dropped);
700 int __connman_service_counter_register(const char *counter);
701 void __connman_service_counter_unregister(const char *counter);
703 #include <connman/session.h>
705 struct service_entry;
706 typedef connman_bool_t (* service_match_cb) (struct connman_session *session,
707 struct connman_service *service);
708 typedef struct service_entry* (* create_service_entry_cb) (
709 struct connman_service *service,
711 enum connman_service_state state);
713 GSequence *__connman_service_get_list(struct connman_session *session,
714 service_match_cb service_match,
715 create_service_entry_cb create_service_entry,
716 GDestroyNotify destroy_service_entry);
718 void __connman_service_session_inc(struct connman_service *service);
719 connman_bool_t __connman_service_session_dec(struct connman_service *service);
720 void __connman_service_mark_dirty();
721 void __connman_service_save(struct connman_service *service);
723 #include <connman/notifier.h>
725 int __connman_technology_init(void);
726 void __connman_technology_cleanup(void);
728 int __connman_notifier_init(void);
729 void __connman_notifier_cleanup(void);
731 void __connman_notifier_service_add(struct connman_service *service,
733 void __connman_notifier_service_remove(struct connman_service *service);
734 void __connman_notifier_enter_online(enum connman_service_type type);
735 void __connman_notifier_leave_online(enum connman_service_type type);
736 void __connman_notifier_connect(enum connman_service_type type);
737 void __connman_notifier_disconnect(enum connman_service_type type);
738 void __connman_notifier_offlinemode(connman_bool_t enabled);
739 void __connman_notifier_default_changed(struct connman_service *service);
740 void __connman_notifier_proxy_changed(struct connman_service *service);
741 void __connman_notifier_service_state_changed(struct connman_service *service,
742 enum connman_service_state state);
743 void __connman_notifier_ipconfig_changed(struct connman_service *service,
744 struct connman_ipconfig *ipconfig);
746 connman_bool_t __connman_notifier_is_connected(void);
747 const char *__connman_notifier_get_state(void);
749 #include <connman/rtnl.h>
751 int __connman_rtnl_init(void);
752 void __connman_rtnl_start(void);
753 void __connman_rtnl_cleanup(void);
755 enum connman_device_type __connman_rtnl_get_device_type(int index);
756 unsigned int __connman_rtnl_update_interval_add(unsigned int interval);
757 unsigned int __connman_rtnl_update_interval_remove(unsigned int interval);
758 int __connman_rtnl_request_update(void);
759 int __connman_rtnl_send(const void *buf, size_t len);
761 connman_bool_t __connman_session_mode();
762 void __connman_session_set_mode(connman_bool_t enable);
764 int __connman_session_create(DBusMessage *msg);
765 int __connman_session_destroy(DBusMessage *msg);
767 int __connman_session_init(void);
768 void __connman_session_cleanup(void);
770 struct connman_stats_data {
771 unsigned int rx_packets;
772 unsigned int tx_packets;
773 unsigned int rx_bytes;
774 unsigned int tx_bytes;
775 unsigned int rx_errors;
776 unsigned int tx_errors;
777 unsigned int rx_dropped;
778 unsigned int tx_dropped;
782 int __connman_stats_init(void);
783 void __connman_stats_cleanup(void);
784 int __connman_stats_service_register(struct connman_service *service);
785 void __connman_stats_service_unregister(struct connman_service *service);
786 int __connman_stats_update(struct connman_service *service,
787 connman_bool_t roaming,
788 struct connman_stats_data *data);
789 int __connman_stats_get(struct connman_service *service,
790 connman_bool_t roaming,
791 struct connman_stats_data *data);
793 int __connman_iptables_dump(const char *table_name);
794 int __connman_iptables_new_chain(const char *table_name,
796 int __connman_iptables_delete_chain(const char *table_name,
798 int __connman_iptables_flush_chain(const char *table_name,
800 int __connman_iptables_change_policy(const char *table_name,
803 int __connman_iptables_append(const char *table_name,
805 const char *rule_spec);
806 int __connman_iptables_insert(const char *table_name,
808 const char *rule_spec);
809 int __connman_iptables_delete(const char *table_name,
811 const char *rule_spec);
813 typedef void (*connman_iptables_iterate_chains_cb_t) (const char *chain_name,
815 int __connman_iptables_iterate_chains(const char *table_name,
816 connman_iptables_iterate_chains_cb_t cb,
819 int __connman_iptables_init(void);
820 void __connman_iptables_cleanup(void);
821 int __connman_iptables_commit(const char *table_name);
823 int __connman_dnsproxy_init(void);
824 void __connman_dnsproxy_cleanup(void);
825 int __connman_dnsproxy_add_listener(int index);
826 void __connman_dnsproxy_remove_listener(int index);
827 int __connman_dnsproxy_append(int index, const char *domain, const char *server);
828 int __connman_dnsproxy_remove(int index, const char *domain, const char *server);
829 void __connman_dnsproxy_flush(void);
831 int __connman_6to4_probe(struct connman_service *service);
832 void __connman_6to4_remove(struct connman_ipconfig *ipconfig);
833 int __connman_6to4_check(struct connman_ipconfig *ipconfig);
835 struct connman_ippool;
837 typedef void (*ippool_collision_cb_t) (struct connman_ippool *pool,
840 int __connman_ippool_init(void);
841 void __connman_ippool_cleanup(void);
843 #define __connman_ippool_ref(ipconfig) \
844 __connman_ippool_ref_debug(ipconfig, __FILE__, __LINE__, __func__)
845 #define __connman_ippool_unref(ipconfig) \
846 __connman_ippool_unref_debug(ipconfig, __FILE__, __LINE__, __func__)
848 struct connman_ippool *__connman_ippool_ref_debug(struct connman_ippool *pool,
849 const char *file, int line, const char *caller);
850 void __connman_ippool_unref_debug(struct connman_ippool *pool,
851 const char *file, int line, const char *caller);
853 struct connman_ippool *__connman_ippool_create(int index,
856 ippool_collision_cb_t collision_cb,
859 const char *__connman_ippool_get_gateway(struct connman_ippool *pool);
860 const char *__connman_ippool_get_broadcast(struct connman_ippool *pool);
861 const char *__connman_ippool_get_subnet_mask(struct connman_ippool *pool);
862 const char *__connman_ippool_get_start_ip(struct connman_ippool *pool);
863 const char *__connman_ippool_get_end_ip(struct connman_ippool *pool);
865 void __connman_ippool_newaddr(int index, const char *address,
866 unsigned char prefixlen);
867 void __connman_ippool_deladdr(int index, const char *address,
868 unsigned char prefixlen);
870 int __connman_bridge_create(const char *name);
871 int __connman_bridge_remove(const char *name);
872 int __connman_bridge_enable(const char *name, const char *gateway,
873 const char *broadcast);
874 int __connman_bridge_disable(const char *name);
876 int __connman_nat_init(void);
877 void __connman_nat_cleanup(void);
879 int __connman_nat_enable(const char *name, const char *address,
880 unsigned char prefixlen);
881 void __connman_nat_disable(const char *name);
883 struct firewall_context;
885 struct firewall_context *__connman_firewall_create(void);
886 void __connman_firewall_destroy(struct firewall_context *ctx);
887 int __connman_firewall_add_rule(struct firewall_context *ctx,
890 const char *rule_fmt, ...);
891 int __connman_firewall_enable(struct firewall_context *ctx);
892 int __connman_firewall_disable(struct firewall_context *ctx);
894 int __connman_firewall_init(void);
895 void __connman_firewall_cleanup(void);