5 * Copyright (C) 2007-2014 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
26 #define CONNMAN_API_SUBJECT_TO_CHANGE
28 #include <connman/dbus.h>
30 dbus_bool_t __connman_dbus_append_objpath_dict_array(DBusMessage *msg,
31 connman_dbus_append_cb_t function, void *user_data);
32 dbus_bool_t __connman_dbus_append_objpath_array(DBusMessage *msg,
33 connman_dbus_append_cb_t function, void *user_data);
34 int __connman_dbus_init(DBusConnection *conn);
35 void __connman_dbus_cleanup(void);
37 DBusMessage *__connman_error_failed(DBusMessage *msg, int errnum);
38 DBusMessage *__connman_error_invalid_arguments(DBusMessage *msg);
39 DBusMessage *__connman_error_permission_denied(DBusMessage *msg);
40 DBusMessage *__connman_error_passphrase_required(DBusMessage *msg);
41 DBusMessage *__connman_error_not_registered(DBusMessage *msg);
42 DBusMessage *__connman_error_not_unique(DBusMessage *msg);
43 DBusMessage *__connman_error_not_supported(DBusMessage *msg);
44 DBusMessage *__connman_error_not_implemented(DBusMessage *msg);
45 DBusMessage *__connman_error_not_found(DBusMessage *msg);
46 DBusMessage *__connman_error_no_carrier(DBusMessage *msg);
47 DBusMessage *__connman_error_in_progress(DBusMessage *msg);
48 DBusMessage *__connman_error_already_exists(DBusMessage *msg);
49 DBusMessage *__connman_error_already_enabled(DBusMessage *msg);
50 DBusMessage *__connman_error_already_disabled(DBusMessage *msg);
51 DBusMessage *__connman_error_already_connected(DBusMessage *msg);
52 DBusMessage *__connman_error_not_connected(DBusMessage *msg);
53 DBusMessage *__connman_error_operation_aborted(DBusMessage *msg);
54 DBusMessage *__connman_error_operation_timeout(DBusMessage *msg);
55 DBusMessage *__connman_error_invalid_service(DBusMessage *msg);
56 DBusMessage *__connman_error_invalid_property(DBusMessage *msg);
58 int __connman_manager_init(void);
59 void __connman_manager_cleanup(void);
62 TIME_UPDATES_UNKNOWN = 0,
63 TIME_UPDATES_MANUAL = 1,
64 TIME_UPDATES_AUTO = 2,
67 enum time_updates __connman_clock_timeupdates(void);
68 int __connman_clock_init(void);
69 void __connman_clock_cleanup(void);
71 void __connman_clock_update_timezone(void);
73 int __connman_timezone_init(void);
74 void __connman_timezone_cleanup(void);
76 char *__connman_timezone_lookup(void);
77 int __connman_timezone_change(const char *zone);
79 int __connman_agent_init(void);
80 void __connman_agent_cleanup(void);
82 void __connman_counter_send_usage(const char *path,
83 DBusMessage *message);
84 int __connman_counter_register(const char *owner, const char *path,
85 unsigned int interval);
86 int __connman_counter_unregister(const char *owner, const char *path);
88 int __connman_counter_init(void);
89 void __connman_counter_cleanup(void);
91 #include <connman/agent.h>
93 struct connman_service;
96 void __connman_agent_cancel(struct connman_service *service);
98 typedef void (* authentication_cb_t) (struct connman_service *service,
100 const char *name, int name_len,
101 const char *identifier, const char *secret,
102 bool wps, const char *wpspin,
103 const char *error, void *user_data);
104 typedef void (* browser_authentication_cb_t) (struct connman_service *service,
105 bool authentication_done,
106 const char *error, void *user_data);
107 typedef void (* peer_wps_cb_t) (struct connman_peer *peer, bool choice_done,
108 const char *wpspin, const char *error,
110 int __connman_agent_request_passphrase_input(struct connman_service *service,
111 authentication_cb_t callback,
112 const char *dbus_sender, void *user_data);
113 int __connman_agent_request_login_input(struct connman_service *service,
114 authentication_cb_t callback, void *user_data);
115 int __connman_agent_request_browser(struct connman_service *service,
116 browser_authentication_cb_t callback,
117 const char *url, void *user_data);
118 int __connman_agent_report_peer_error(struct connman_peer *peer,
119 const char *path, const char *error,
120 report_error_cb_t callback,
121 const char *dbus_sender,
123 int __connman_agent_request_peer_authorization(struct connman_peer *peer,
124 peer_wps_cb_t callback,
126 const char *dbus_sender,
128 #include <connman/log.h>
130 int __connman_log_init(const char *program, const char *debug,
131 gboolean detach, gboolean backtrace,
132 const char *program_name, const char *program_version);
133 void __connman_log_cleanup(gboolean backtrace);
134 void __connman_log_enable(struct connman_debug_desc *start,
135 struct connman_debug_desc *stop);
137 #include <connman/option.h>
139 #include <connman/setting.h>
141 #include <connman/plugin.h>
143 int __connman_plugin_init(const char *pattern, const char *exclude);
144 void __connman_plugin_cleanup(void);
146 #include <connman/task.h>
148 int __connman_task_init(void);
149 void __connman_task_cleanup(void);
151 #include <connman/inet.h>
153 char **__connman_inet_get_running_interfaces(void);
154 int __connman_inet_modify_address(int cmd, int flags, int index, int family,
157 unsigned char prefixlen,
158 const char *broadcast);
159 int __connman_inet_get_interface_address(int index, int family, void *address);
160 int __connman_inet_get_interface_ll_address(int index, int family, void *address);
162 #include <netinet/ip6.h>
163 #include <netinet/icmp6.h>
165 typedef void (*__connman_inet_rs_cb_t) (struct nd_router_advert *reply,
166 unsigned int length, void *user_data);
168 int __connman_inet_ipv6_send_rs(int index, int timeout,
169 __connman_inet_rs_cb_t callback, void *user_data);
170 int __connman_inet_ipv6_send_ra(int index, struct in6_addr *src_addr,
171 GSList *prefixes, int router_lifetime);
173 typedef void (*__connman_inet_ns_cb_t) (struct nd_neighbor_advert *reply,
175 struct in6_addr *addr,
177 int __connman_inet_ipv6_do_dad(int index, int timeout_ms,
178 struct in6_addr *addr,
179 __connman_inet_ns_cb_t callback, void *user_data);
181 typedef void (*__connman_inet_recv_rs_cb_t) (struct nd_router_solicit *reply,
182 unsigned int length, void *user_data);
183 int __connman_inet_ipv6_start_recv_rs(int index,
184 __connman_inet_recv_rs_cb_t callback,
185 void *user_data, void **context);
186 void __connman_inet_ipv6_stop_recv_rs(void *context);
188 int __connman_network_refresh_rs_ipv6(struct connman_network *network, int index);
190 GSList *__connman_inet_ipv6_get_prefixes(struct nd_router_advert *hdr,
191 unsigned int length);
192 typedef void (*connman_inet_addr_cb_t) (const char *src_address, int index,
194 int __connman_inet_get_route(const char *dst_address,
195 connman_inet_addr_cb_t callback, void *user_data);
197 struct __connman_inet_rtnl_handle {
199 struct sockaddr_nl local;
200 struct sockaddr_nl peer;
211 struct ifaddrmsg ifa;
218 int __connman_inet_rtnl_open(struct __connman_inet_rtnl_handle *rth);
219 typedef void (*__connman_inet_rtnl_cb_t) (struct nlmsghdr *answer,
221 int __connman_inet_rtnl_talk(struct __connman_inet_rtnl_handle *rtnl,
222 struct nlmsghdr *n, int timeout,
223 __connman_inet_rtnl_cb_t callback, void *user_data);
225 int __connman_inet_rtnl_send(struct __connman_inet_rtnl_handle *rtnl,
228 return __connman_inet_rtnl_talk(rtnl, n, 0, NULL, NULL);
231 void __connman_inet_rtnl_close(struct __connman_inet_rtnl_handle *rth);
232 int __connman_inet_rtnl_addattr_l(struct nlmsghdr *n, size_t max_length,
233 int type, const void *data, size_t data_length);
234 int __connman_inet_rtnl_addattr32(struct nlmsghdr *n, size_t maxlen,
235 int type, __u32 data);
237 int __connman_inet_add_fwmark_rule(uint32_t table_id, int family, uint32_t fwmark);
238 int __connman_inet_del_fwmark_rule(uint32_t table_id, int family, uint32_t fwmark);
239 int __connman_inet_add_default_to_table(uint32_t table_id, int ifindex, const char *gateway);
240 int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex, const char *gateway);
241 int __connman_inet_get_address_netmask(int ifindex,
242 struct sockaddr_in *address, struct sockaddr_in *netmask);
244 #include <connman/resolver.h>
246 int __connman_resolver_init(gboolean dnsproxy);
247 void __connman_resolver_cleanup(void);
248 int __connman_resolvfile_append(int index, const char *domain, const char *server);
249 int __connman_resolvfile_remove(int index, const char *domain, const char *server);
250 int __connman_resolver_redo_servers(int index);
252 GKeyFile *__connman_storage_open_global(void);
253 GKeyFile *__connman_storage_load_global(void);
254 int __connman_storage_save_global(GKeyFile *keyfile);
255 void __connman_storage_delete_global(void);
257 GKeyFile *__connman_storage_load_config(const char *ident);
258 GKeyFile *__connman_storage_load_provider_config(const char *ident);
260 GKeyFile *__connman_storage_open_service(const char *ident);
261 int __connman_storage_save_service(GKeyFile *keyfile, const char *ident);
262 GKeyFile *__connman_storage_load_provider(const char *identifier);
263 void __connman_storage_save_provider(GKeyFile *keyfile, const char *identifier);
264 bool __connman_storage_remove_provider(const char *identifier);
265 char **__connman_storage_get_providers(void);
266 bool __connman_storage_remove_service(const char *service_id);
268 int __connman_detect_init(void);
269 void __connman_detect_cleanup(void);
271 #include <connman/inotify.h>
273 int __connman_inotify_init(void);
274 void __connman_inotify_cleanup(void);
276 #include <connman/proxy.h>
278 int __connman_proxy_init(void);
279 void __connman_proxy_cleanup(void);
281 #include <connman/ipconfig.h>
283 struct connman_ipaddress {
285 unsigned char prefixlen;
292 struct connman_ipconfig_ops {
293 void (*up) (struct connman_ipconfig *ipconfig, const char *ifname);
294 void (*down) (struct connman_ipconfig *ipconfig, const char *ifname);
295 void (*lower_up) (struct connman_ipconfig *ipconfig, const char *ifname);
296 void (*lower_down) (struct connman_ipconfig *ipconfig, const char *ifname);
297 void (*ip_bound) (struct connman_ipconfig *ipconfig, const char *ifname);
298 void (*ip_release) (struct connman_ipconfig *ipconfig, const char *ifname);
299 void (*route_set) (struct connman_ipconfig *ipconfig, const char *ifname);
300 void (*route_unset) (struct connman_ipconfig *ipconfig, const char *ifname);
303 struct connman_ipconfig *__connman_ipconfig_create(int index,
304 enum connman_ipconfig_type type);
306 #define __connman_ipconfig_ref(ipconfig) \
307 __connman_ipconfig_ref_debug(ipconfig, __FILE__, __LINE__, __func__)
308 #define __connman_ipconfig_unref(ipconfig) \
309 __connman_ipconfig_unref_debug(ipconfig, __FILE__, __LINE__, __func__)
311 struct connman_ipconfig *
312 __connman_ipconfig_ref_debug(struct connman_ipconfig *ipconfig,
313 const char *file, int line, const char *caller);
314 void __connman_ipconfig_unref_debug(struct connman_ipconfig *ipconfig,
315 const char *file, int line, const char *caller);
317 void __connman_ipconfig_clear_address(struct connman_ipconfig *ipconfig);
318 void *__connman_ipconfig_get_data(struct connman_ipconfig *ipconfig);
319 void __connman_ipconfig_set_data(struct connman_ipconfig *ipconfig, void *data);
321 int __connman_ipconfig_get_index(struct connman_ipconfig *ipconfig);
323 void __connman_ipconfig_set_ops(struct connman_ipconfig *ipconfig,
324 const struct connman_ipconfig_ops *ops);
325 int __connman_ipconfig_set_method(struct connman_ipconfig *ipconfig,
326 enum connman_ipconfig_method method);
327 void __connman_ipconfig_disable_ipv6(struct connman_ipconfig *ipconfig);
328 void __connman_ipconfig_enable_ipv6(struct connman_ipconfig *ipconfig);
330 int __connman_ipconfig_init(void);
331 void __connman_ipconfig_cleanup(void);
333 struct rtnl_link_stats;
335 void __connman_ipconfig_newlink(int index, unsigned short type,
336 unsigned int flags, const char *address,
338 struct rtnl_link_stats *stats);
339 void __connman_ipconfig_dellink(int index, struct rtnl_link_stats *stats);
340 int __connman_ipconfig_newaddr(int index, int family, const char *label,
341 unsigned char prefixlen, const char *address);
342 void __connman_ipconfig_deladdr(int index, int family, const char *label,
343 unsigned char prefixlen, const char *address);
344 void __connman_ipconfig_newroute(int index, int family, unsigned char scope,
345 const char *dst, const char *gateway);
346 void __connman_ipconfig_delroute(int index, int family, unsigned char scope,
347 const char *dst, const char *gateway);
349 void __connman_ipconfig_foreach(void (*function) (int index, void *user_data),
351 enum connman_ipconfig_type __connman_ipconfig_get_config_type(
352 struct connman_ipconfig *ipconfig);
353 unsigned short __connman_ipconfig_get_type_from_index(int index);
354 unsigned int __connman_ipconfig_get_flags_from_index(int index);
355 const char *__connman_ipconfig_get_gateway_from_index(int index,
356 enum connman_ipconfig_type type);
357 void __connman_ipconfig_set_index(struct connman_ipconfig *ipconfig, int index);
359 const char *__connman_ipconfig_get_local(struct connman_ipconfig *ipconfig);
360 void __connman_ipconfig_set_local(struct connman_ipconfig *ipconfig, const char *address);
361 const char *__connman_ipconfig_get_peer(struct connman_ipconfig *ipconfig);
362 void __connman_ipconfig_set_peer(struct connman_ipconfig *ipconfig, const char *address);
363 const char *__connman_ipconfig_get_broadcast(struct connman_ipconfig *ipconfig);
364 void __connman_ipconfig_set_broadcast(struct connman_ipconfig *ipconfig, const char *broadcast);
365 const char *__connman_ipconfig_get_gateway(struct connman_ipconfig *ipconfig);
366 void __connman_ipconfig_set_gateway(struct connman_ipconfig *ipconfig, const char *gateway);
367 unsigned char __connman_ipconfig_get_prefixlen(struct connman_ipconfig *ipconfig);
368 void __connman_ipconfig_set_prefixlen(struct connman_ipconfig *ipconfig, unsigned char prefixlen);
370 int __connman_ipconfig_enable(struct connman_ipconfig *ipconfig);
371 int __connman_ipconfig_disable(struct connman_ipconfig *ipconfig);
372 bool __connman_ipconfig_is_usable(struct connman_ipconfig *ipconfig);
374 const char *__connman_ipconfig_method2string(enum connman_ipconfig_method method);
375 const char *__connman_ipconfig_type2string(enum connman_ipconfig_type type);
376 enum connman_ipconfig_method __connman_ipconfig_string2method(const char *method);
378 void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig,
379 DBusMessageIter *iter);
380 void __connman_ipconfig_append_ipv4config(struct connman_ipconfig *ipconfig,
381 DBusMessageIter *iter);
382 void __connman_ipconfig_append_ipv6(struct connman_ipconfig *ipconfig,
383 DBusMessageIter *iter,
384 struct connman_ipconfig *ip4config);
385 void __connman_ipconfig_append_ipv6config(struct connman_ipconfig *ipconfig,
386 DBusMessageIter *iter);
387 int __connman_ipconfig_set_config(struct connman_ipconfig *ipconfig,
388 DBusMessageIter *array);
389 void __connman_ipconfig_append_ethernet(struct connman_ipconfig *ipconfig,
390 DBusMessageIter *iter);
391 enum connman_ipconfig_method __connman_ipconfig_get_method(
392 struct connman_ipconfig *ipconfig);
394 int __connman_ipconfig_address_add(struct connman_ipconfig *ipconfig);
395 int __connman_ipconfig_address_remove(struct connman_ipconfig *ipconfig);
396 int __connman_ipconfig_address_unset(struct connman_ipconfig *ipconfig);
397 #if defined TIZEN_EXT
399 * Description: __connman_service_lookup_from_index cannot find correct service
400 * e.g. same interface or same APN of cellular profile
402 int __connman_ipconfig_gateway_add(struct connman_ipconfig *ipconfig, struct connman_service *service);
404 int __connman_ipconfig_gateway_add(struct connman_ipconfig *ipconfig);
406 void __connman_ipconfig_gateway_remove(struct connman_ipconfig *ipconfig);
408 int __connman_ipconfig_set_proxy_autoconfig(struct connman_ipconfig *ipconfig,
410 const char *__connman_ipconfig_get_proxy_autoconfig(struct connman_ipconfig *ipconfig);
411 void __connman_ipconfig_set_dhcp_address(struct connman_ipconfig *ipconfig,
412 const char *address);
413 char *__connman_ipconfig_get_dhcp_address(struct connman_ipconfig *ipconfig);
414 void __connman_ipconfig_set_dhcpv6_prefixes(struct connman_ipconfig *ipconfig,
416 char **__connman_ipconfig_get_dhcpv6_prefixes(struct connman_ipconfig *ipconfig);
418 int __connman_ipconfig_load(struct connman_ipconfig *ipconfig,
419 GKeyFile *keyfile, const char *identifier, const char *prefix);
420 int __connman_ipconfig_save(struct connman_ipconfig *ipconfig,
421 GKeyFile *keyfile, const char *identifier, const char *prefix);
422 bool __connman_ipconfig_ipv6_privacy_enabled(struct connman_ipconfig *ipconfig);
423 int __connman_ipconfig_ipv6_reset_privacy(struct connman_ipconfig *ipconfig);
424 int __connman_ipconfig_ipv6_set_privacy(struct connman_ipconfig *ipconfig,
426 bool __connman_ipconfig_ipv6_is_enabled(struct connman_ipconfig *ipconfig);
428 int __connman_ipconfig_set_rp_filter();
429 void __connman_ipconfig_unset_rp_filter(int old_value);
431 #include <connman/utsname.h>
433 int __connman_utsname_set_hostname(const char *hostname);
434 int __connman_utsname_set_domainname(const char *domainname);
436 #include <connman/timeserver.h>
438 int __connman_timeserver_init(void);
439 void __connman_timeserver_cleanup(void);
441 char **__connman_timeserver_system_get();
443 GSList *__connman_timeserver_add_list(GSList *server_list,
444 const char *timeserver);
445 GSList *__connman_timeserver_get_all(struct connman_service *service);
446 int __connman_timeserver_sync(struct connman_service *service);
447 void __connman_timeserver_sync_next();
449 enum __connman_dhcpv6_status {
450 CONNMAN_DHCPV6_STATUS_FAIL = 0,
451 CONNMAN_DHCPV6_STATUS_SUCCEED = 1,
452 CONNMAN_DHCPV6_STATUS_RESTART = 2,
455 typedef void (* dhcpv6_cb) (struct connman_network *network,
456 enum __connman_dhcpv6_status status, gpointer data);
458 typedef void (* dhcp_cb) (struct connman_ipconfig *ipconfig,
459 struct connman_network *opt_network,
460 bool success, gpointer data);
461 char *__connman_dhcp_get_server_address(struct connman_ipconfig *ipconfig);
462 int __connman_dhcp_start(struct connman_ipconfig *ipconfig,
463 struct connman_network *network, dhcp_cb callback,
465 void __connman_dhcp_stop(struct connman_ipconfig *ipconfig);
466 int __connman_dhcp_init(void);
467 void __connman_dhcp_cleanup(void);
468 int __connman_dhcpv6_init(void);
469 void __connman_dhcpv6_cleanup(void);
470 int __connman_dhcpv6_start_info(struct connman_network *network,
472 void __connman_dhcpv6_stop(struct connman_network *network);
473 int __connman_dhcpv6_start(struct connman_network *network,
474 GSList *prefixes, dhcpv6_cb callback);
475 int __connman_dhcpv6_start_renew(struct connman_network *network,
477 int __connman_dhcpv6_start_release(struct connman_network *network,
479 int __connman_dhcpv6_start_pd(int index, GSList *prefixes, dhcpv6_cb callback);
480 void __connman_dhcpv6_stop_pd(int index);
481 int __connman_dhcpv6_start_pd_renew(struct connman_network *network,
483 int __connman_dhcpv6_start_pd_release(struct connman_network *network,
486 int __connman_ipv4_init(void);
487 void __connman_ipv4_cleanup(void);
489 int __connman_connection_init(void);
490 void __connman_connection_cleanup(void);
492 int __connman_connection_gateway_add(struct connman_service *service,
494 enum connman_ipconfig_type type,
496 void __connman_connection_gateway_remove(struct connman_service *service,
497 enum connman_ipconfig_type type);
498 int __connman_connection_get_vpn_index(int phy_index);
500 bool __connman_connection_update_gateway(void);
501 void __connman_connection_gateway_activate(struct connman_service *service,
502 enum connman_ipconfig_type type);
504 int __connman_ntp_start(char *server);
505 void __connman_ntp_stop();
507 int __connman_wpad_init(void);
508 void __connman_wpad_cleanup(void);
509 int __connman_wpad_start(struct connman_service *service);
510 void __connman_wpad_stop(struct connman_service *service);
512 int __connman_wispr_init(void);
513 void __connman_wispr_cleanup(void);
514 int __connman_wispr_start(struct connman_service *service,
515 enum connman_ipconfig_type type);
516 void __connman_wispr_stop(struct connman_service *service);
518 #include <connman/technology.h>
520 void __connman_technology_list_struct(DBusMessageIter *array);
522 int __connman_technology_add_device(struct connman_device *device);
523 int __connman_technology_remove_device(struct connman_device *device);
524 int __connman_technology_enabled(enum connman_service_type type);
525 int __connman_technology_disabled(enum connman_service_type type);
526 int __connman_technology_set_offlinemode(bool offlinemode);
527 bool __connman_technology_get_offlinemode(void);
528 void __connman_technology_set_connected(enum connman_service_type type,
531 int __connman_technology_add_rfkill(unsigned int index,
532 enum connman_service_type type,
535 int __connman_technology_update_rfkill(unsigned int index,
536 enum connman_service_type type,
539 int __connman_technology_remove_rfkill(unsigned int index,
540 enum connman_service_type type);
542 void __connman_technology_scan_started(struct connman_device *device);
543 void __connman_technology_scan_stopped(struct connman_device *device,
544 enum connman_service_type type);
545 void __connman_technology_add_interface(enum connman_service_type type,
546 int index, const char *ident);
547 void __connman_technology_remove_interface(enum connman_service_type type,
548 int index, const char *ident);
549 void __connman_technology_notify_regdom_by_device(struct connman_device *device,
550 int result, const char *alpha2);
552 #include <connman/device.h>
554 int __connman_device_init(const char *device, const char *nodevice);
555 void __connman_device_cleanup(void);
557 void __connman_device_list(DBusMessageIter *iter, void *user_data);
559 enum connman_service_type __connman_device_get_service_type(struct connman_device *device);
560 struct connman_device *__connman_device_find_device(enum connman_service_type type);
561 int __connman_device_request_scan(enum connman_service_type type);
562 int __connman_device_request_hidden_scan(struct connman_device *device,
563 const char *ssid, unsigned int ssid_len,
564 const char *identity, const char *passphrase,
565 const char *security, void *user_data);
567 bool __connman_device_isfiltered(const char *devname);
569 void __connman_device_set_network(struct connman_device *device,
570 struct connman_network *network);
571 void __connman_device_cleanup_networks(struct connman_device *device);
573 int __connman_device_enable(struct connman_device *device);
574 int __connman_device_disable(struct connman_device *device);
575 int __connman_device_disconnect(struct connman_device *device);
577 bool __connman_device_has_driver(struct connman_device *device);
579 const char *__connman_device_get_type(struct connman_device *device);
581 int __connman_rfkill_init(void);
582 void __connman_rfkill_cleanup(void);
583 int __connman_rfkill_block(enum connman_service_type type, bool block);
585 #if defined TIZEN_EXT
586 char *index2ident(int index, const char *prefix);
587 char *index2addr(int index);
590 #include <connman/network.h>
592 int __connman_network_init(void);
593 void __connman_network_cleanup(void);
595 void __connman_network_set_device(struct connman_network *network,
596 struct connman_device *device);
598 int __connman_network_connect(struct connman_network *network);
599 int __connman_network_disconnect(struct connman_network *network);
600 int __connman_network_clear_ipconfig(struct connman_network *network,
601 struct connman_ipconfig *ipconfig);
602 int __connman_network_enable_ipconfig(struct connman_network *network,
603 struct connman_ipconfig *ipconfig);
605 const char *__connman_network_get_type(struct connman_network *network);
606 const char *__connman_network_get_group(struct connman_network *network);
607 const char *__connman_network_get_ident(struct connman_network *network);
608 bool __connman_network_get_weakness(struct connman_network *network);
610 int __connman_config_init();
611 void __connman_config_cleanup(void);
613 int __connman_config_load_service(GKeyFile *keyfile, const char *group,
615 int __connman_config_provision_service(struct connman_service *service);
616 int __connman_config_provision_service_ident(struct connman_service *service,
617 const char *ident, const char *file, const char *entry);
619 char *__connman_config_get_string(GKeyFile *key_file,
620 const char *group_name, const char *key, GError **error);
622 char **__connman_config_get_string_list(GKeyFile *key_file,
623 const char *group_name, const char *key, gsize *length, GError **error);
625 bool __connman_config_get_bool(GKeyFile *key_file,
626 const char *group_name, const char *key, GError **error);
627 bool __connman_config_address_provisioned(const char *address,
628 const char *netmask);
630 int __connman_tethering_init(void);
631 void __connman_tethering_cleanup(void);
633 const char *__connman_tethering_get_bridge(void);
634 void __connman_tethering_set_enabled(void);
635 void __connman_tethering_set_disabled(void);
637 int __connman_private_network_request(DBusMessage *msg, const char *owner);
638 int __connman_private_network_release(const char *path);
640 int __connman_ipv6pd_setup(const char *bridge);
641 void __connman_ipv6pd_cleanup(void);
643 #include <connman/provider.h>
645 bool __connman_provider_check_routes(struct connman_provider *provider);
646 int __connman_provider_append_user_route(struct connman_provider *provider,
647 int family, const char *network, const char *netmask);
648 void __connman_provider_append_properties(struct connman_provider *provider, DBusMessageIter *iter);
649 void __connman_provider_list(DBusMessageIter *iter, void *user_data);
650 bool __connman_provider_is_immutable(struct connman_provider *provider);
651 int __connman_provider_create_and_connect(DBusMessage *msg);
652 const char * __connman_provider_get_ident(struct connman_provider *provider);
653 int __connman_provider_indicate_state(struct connman_provider *provider,
654 enum connman_provider_state state);
655 int __connman_provider_indicate_error(struct connman_provider *provider,
656 enum connman_provider_error error);
657 int __connman_provider_connect(struct connman_provider *provider);
658 int __connman_provider_remove_by_path(const char *path);
659 void __connman_provider_cleanup(void);
660 int __connman_provider_init(void);
662 #include <connman/service.h>
664 int __connman_service_init(void);
665 void __connman_service_cleanup(void);
666 int __connman_service_load_modifiable(struct connman_service *service);
668 void __connman_service_list_struct(DBusMessageIter *iter);
670 struct connman_service *__connman_service_lookup_from_index(int index);
671 struct connman_service *__connman_service_lookup_from_ident(const char *identifier);
672 struct connman_service *__connman_service_create_from_network(struct connman_network *network);
673 struct connman_service *__connman_service_create_from_provider(struct connman_provider *provider);
674 bool __connman_service_index_is_default(int index);
675 struct connman_service *__connman_service_get_default(void);
676 void __connman_service_update_from_network(struct connman_network *network);
677 void __connman_service_remove_from_network(struct connman_network *network);
678 void __connman_service_read_ip4config(struct connman_service *service);
679 void __connman_service_read_ip6config(struct connman_service *service);
681 struct connman_ipconfig *__connman_service_get_ip4config(
682 struct connman_service *service);
683 struct connman_ipconfig *__connman_service_get_ip6config(
684 struct connman_service *service);
685 struct connman_ipconfig *__connman_service_get_ipconfig(
686 struct connman_service *service, int family);
687 bool __connman_service_is_connected_state(struct connman_service *service,
688 enum connman_ipconfig_type type);
689 const char *__connman_service_get_ident(struct connman_service *service);
690 const char *__connman_service_get_path(struct connman_service *service);
691 const char *__connman_service_get_name(struct connman_service *service);
692 unsigned int __connman_service_get_order(struct connman_service *service);
693 enum connman_service_state __connman_service_get_state(struct connman_service *service);
694 void __connman_service_update_ordering(void);
695 struct connman_network *__connman_service_get_network(struct connman_service *service);
696 enum connman_service_security __connman_service_get_security(struct connman_service *service);
697 const char *__connman_service_get_phase2(struct connman_service *service);
698 bool __connman_service_wps_enabled(struct connman_service *service);
699 #if defined TIZEN_EXT
700 void __connman_service_set_storage_reload(struct connman_service *service,
701 bool storage_reload);
703 int __connman_service_set_favorite(struct connman_service *service,
705 int __connman_service_set_favorite_delayed(struct connman_service *service,
707 bool delay_ordering);
708 int __connman_service_set_immutable(struct connman_service *service,
710 int __connman_service_set_ignore(struct connman_service *service,
712 void __connman_service_set_search_domains(struct connman_service *service,
715 void __connman_service_set_string(struct connman_service *service,
716 const char *key, const char *value);
717 int __connman_service_online_check_failed(struct connman_service *service,
718 enum connman_ipconfig_type type);
719 int __connman_service_ipconfig_indicate_state(struct connman_service *service,
720 enum connman_service_state new_state,
721 enum connman_ipconfig_type type);
722 enum connman_service_state __connman_service_ipconfig_get_state(
723 struct connman_service *service,
724 enum connman_ipconfig_type type);
726 #if defined TIZEN_EXT
727 void connman_check_proxy_setup_and_wispr_start(struct connman_service *service);
730 int __connman_service_indicate_error(struct connman_service *service,
731 enum connman_service_error error);
732 int __connman_service_clear_error(struct connman_service *service);
733 int __connman_service_indicate_default(struct connman_service *service);
735 int __connman_service_connect(struct connman_service *service,
736 enum connman_service_connect_reason reason);
737 int __connman_service_disconnect(struct connman_service *service);
738 int __connman_service_disconnect_all(void);
739 void __connman_service_set_active_session(bool enable, GSList *list);
740 void __connman_service_auto_connect(enum connman_service_connect_reason reason);
741 bool __connman_service_remove(struct connman_service *service);
742 bool __connman_service_is_provider_pending(struct connman_service *service);
743 void __connman_service_set_provider_pending(struct connman_service *service,
745 void __connman_service_set_hidden_data(struct connman_service *service,
747 void __connman_service_return_error(struct connman_service *service,
748 int error, gpointer user_data);
750 int __connman_service_provision_changed(const char *ident);
751 void __connman_service_set_config(struct connman_service *service,
752 const char *file_id, const char *section);
754 const char *__connman_service_type2string(enum connman_service_type type);
755 enum connman_service_type __connman_service_string2type(const char *str);
756 enum connman_service_security __connman_service_string2security(const char *str);
758 int __connman_service_nameserver_append(struct connman_service *service,
759 const char *nameserver, bool is_auto);
760 int __connman_service_nameserver_remove(struct connman_service *service,
761 const char *nameserver, bool is_auto);
762 void __connman_service_nameserver_clear(struct connman_service *service);
763 void __connman_service_nameserver_add_routes(struct connman_service *service,
765 void __connman_service_nameserver_del_routes(struct connman_service *service,
766 enum connman_ipconfig_type type);
767 void __connman_service_set_timeservers(struct connman_service *service,
769 int __connman_service_timeserver_append(struct connman_service *service,
770 const char *timeserver);
771 int __connman_service_timeserver_remove(struct connman_service *service,
772 const char *timeserver);
773 void __connman_service_timeserver_changed(struct connman_service *service,
775 void __connman_service_set_pac(struct connman_service *service,
777 #if defined TIZEN_EXT
779 * Returns profile count if there is any connected profiles
780 * that use same interface
782 int __connman_service_get_connected_count_of_iface(struct connman_service *service);
783 void __connman_service_set_proxy(struct connman_service *service,
784 const char *proxies);
786 bool __connman_service_is_hidden(struct connman_service *service);
787 bool __connman_service_is_split_routing(struct connman_service *service);
788 bool __connman_service_index_is_split_routing(int index);
789 int __connman_service_get_index(struct connman_service *service);
790 void __connman_service_set_hidden(struct connman_service *service);
791 void __connman_service_set_hostname(struct connman_service *service,
792 const char *hostname);
793 const char *__connman_service_get_hostname(struct connman_service *service);
794 void __connman_service_set_domainname(struct connman_service *service,
795 const char *domainname);
796 const char *__connman_service_get_nameserver(struct connman_service *service);
797 void __connman_service_set_proxy_autoconfig(struct connman_service *service,
800 void __connman_service_set_identity(struct connman_service *service,
801 const char *identity);
802 void __connman_service_set_agent_identity(struct connman_service *service,
803 const char *agent_identity);
804 int __connman_service_set_passphrase(struct connman_service *service,
805 const char *passphrase);
806 const char *__connman_service_get_passphrase(struct connman_service *service);
807 int __connman_service_reset_ipconfig(struct connman_service *service,
808 enum connman_ipconfig_type type, DBusMessageIter *array,
809 enum connman_service_state *new_state);
811 void __connman_service_notify(struct connman_service *service,
812 unsigned int rx_packets, unsigned int tx_packets,
813 unsigned int rx_bytes, unsigned int tx_bytes,
814 unsigned int rx_error, unsigned int tx_error,
815 unsigned int rx_dropped, unsigned int tx_dropped);
817 bool __connman_service_is_user_allowed(enum connman_service_type type,
820 int __connman_service_counter_register(const char *counter);
821 void __connman_service_counter_unregister(const char *counter);
823 #include <connman/peer.h>
825 int __connman_peer_init(void);
826 void __connman_peer_cleanup(void);
828 void __connman_peer_list_struct(DBusMessageIter *array);
829 const char *__connman_peer_get_path(struct connman_peer *peer);
831 int __connman_peer_service_init(void);
832 void __connman_peer_service_cleanup(void);
834 void __connman_peer_service_set_driver(struct connman_peer_driver *driver);
835 int __connman_peer_service_register(const char *owner, DBusMessage *msg,
836 const unsigned char *specification,
837 int specification_length,
838 const unsigned char *query,
839 int query_length, int version,
841 int __connman_peer_service_unregister(const char *owner,
842 const unsigned char *specification,
843 int specification_length,
844 const unsigned char *query,
845 int query_length, int version);
847 #include <connman/session.h>
849 typedef void (* service_iterate_cb) (struct connman_service *service,
852 int __connman_service_iterate_services(service_iterate_cb cb, void *user_data);
854 void __connman_service_mark_dirty();
855 void __connman_service_save(struct connman_service *service);
857 #include <connman/notifier.h>
859 int __connman_technology_init(void);
860 void __connman_technology_cleanup(void);
862 int __connman_notifier_init(void);
863 void __connman_notifier_cleanup(void);
865 void __connman_notifier_service_add(struct connman_service *service,
867 void __connman_notifier_service_remove(struct connman_service *service);
868 void __connman_notifier_enter_online(enum connman_service_type type);
869 void __connman_notifier_leave_online(enum connman_service_type type);
870 void __connman_notifier_connect(enum connman_service_type type);
871 void __connman_notifier_disconnect(enum connman_service_type type);
872 void __connman_notifier_offlinemode(bool enabled);
873 void __connman_notifier_default_changed(struct connman_service *service);
874 void __connman_notifier_proxy_changed(struct connman_service *service);
875 void __connman_notifier_service_state_changed(struct connman_service *service,
876 enum connman_service_state state);
877 void __connman_notifier_ipconfig_changed(struct connman_service *service,
878 struct connman_ipconfig *ipconfig);
880 bool __connman_notifier_is_connected(void);
881 const char *__connman_notifier_get_state(void);
883 #include <connman/rtnl.h>
885 int __connman_rtnl_init(void);
886 void __connman_rtnl_start(void);
887 void __connman_rtnl_cleanup(void);
889 enum connman_device_type __connman_rtnl_get_device_type(int index);
890 unsigned int __connman_rtnl_update_interval_add(unsigned int interval);
891 unsigned int __connman_rtnl_update_interval_remove(unsigned int interval);
892 int __connman_rtnl_request_update(void);
893 int __connman_rtnl_send(const void *buf, size_t len);
895 bool __connman_session_policy_autoconnect(enum connman_service_connect_reason reason);
897 int __connman_session_create(DBusMessage *msg);
898 int __connman_session_destroy(DBusMessage *msg);
900 int __connman_session_init(void);
901 void __connman_session_cleanup(void);
903 struct connman_stats_data {
904 unsigned int rx_packets;
905 unsigned int tx_packets;
906 unsigned int rx_bytes;
907 unsigned int tx_bytes;
908 unsigned int rx_errors;
909 unsigned int tx_errors;
910 unsigned int rx_dropped;
911 unsigned int tx_dropped;
915 int __connman_stats_init(void);
916 void __connman_stats_cleanup(void);
917 int __connman_stats_service_register(struct connman_service *service);
918 void __connman_stats_service_unregister(struct connman_service *service);
919 int __connman_stats_update(struct connman_service *service,
921 struct connman_stats_data *data);
922 int __connman_stats_get(struct connman_service *service,
924 struct connman_stats_data *data);
926 int __connman_iptables_dump(const char *table_name);
927 int __connman_iptables_new_chain(const char *table_name,
929 int __connman_iptables_delete_chain(const char *table_name,
931 int __connman_iptables_flush_chain(const char *table_name,
933 int __connman_iptables_change_policy(const char *table_name,
936 int __connman_iptables_append(const char *table_name,
938 const char *rule_spec);
939 int __connman_iptables_insert(const char *table_name,
941 const char *rule_spec);
942 int __connman_iptables_delete(const char *table_name,
944 const char *rule_spec);
946 typedef void (*connman_iptables_iterate_chains_cb_t) (const char *chain_name,
948 int __connman_iptables_iterate_chains(const char *table_name,
949 connman_iptables_iterate_chains_cb_t cb,
952 int __connman_iptables_init(void);
953 void __connman_iptables_cleanup(void);
954 int __connman_iptables_commit(const char *table_name);
956 int __connman_dnsproxy_init(void);
957 void __connman_dnsproxy_cleanup(void);
958 int __connman_dnsproxy_add_listener(int index);
959 void __connman_dnsproxy_remove_listener(int index);
960 int __connman_dnsproxy_append(int index, const char *domain, const char *server);
961 int __connman_dnsproxy_remove(int index, const char *domain, const char *server);
963 int __connman_6to4_probe(struct connman_service *service);
964 void __connman_6to4_remove(struct connman_ipconfig *ipconfig);
965 int __connman_6to4_check(struct connman_ipconfig *ipconfig);
967 struct connman_ippool;
969 typedef void (*ippool_collision_cb_t) (struct connman_ippool *pool,
972 int __connman_ippool_init(void);
973 void __connman_ippool_cleanup(void);
975 #define __connman_ippool_ref(ipconfig) \
976 __connman_ippool_ref_debug(ipconfig, __FILE__, __LINE__, __func__)
977 #define __connman_ippool_unref(ipconfig) \
978 __connman_ippool_unref_debug(ipconfig, __FILE__, __LINE__, __func__)
980 struct connman_ippool *__connman_ippool_ref_debug(struct connman_ippool *pool,
981 const char *file, int line, const char *caller);
982 void __connman_ippool_unref_debug(struct connman_ippool *pool,
983 const char *file, int line, const char *caller);
985 struct connman_ippool *__connman_ippool_create(int index,
988 ippool_collision_cb_t collision_cb,
991 const char *__connman_ippool_get_gateway(struct connman_ippool *pool);
992 const char *__connman_ippool_get_broadcast(struct connman_ippool *pool);
993 const char *__connman_ippool_get_subnet_mask(struct connman_ippool *pool);
994 const char *__connman_ippool_get_start_ip(struct connman_ippool *pool);
995 const char *__connman_ippool_get_end_ip(struct connman_ippool *pool);
997 void __connman_ippool_newaddr(int index, const char *address,
998 unsigned char prefixlen);
999 void __connman_ippool_deladdr(int index, const char *address,
1000 unsigned char prefixlen);
1002 int __connman_bridge_create(const char *name);
1003 int __connman_bridge_remove(const char *name);
1004 int __connman_bridge_enable(const char *name, const char *ip_address,
1005 int prefix_len, const char *broadcast);
1006 int __connman_bridge_disable(const char *name);
1008 int __connman_nat_init(void);
1009 void __connman_nat_cleanup(void);
1011 int __connman_nat_enable(const char *name, const char *address,
1012 unsigned char prefixlen);
1013 void __connman_nat_disable(const char *name);
1015 struct firewall_context;
1017 struct firewall_context *__connman_firewall_create(void);
1018 void __connman_firewall_destroy(struct firewall_context *ctx);
1019 int __connman_firewall_add_rule(struct firewall_context *ctx,
1022 const char *rule_fmt, ...);
1023 int __connman_firewall_enable(struct firewall_context *ctx);
1024 int __connman_firewall_disable(struct firewall_context *ctx);
1025 bool __connman_firewall_is_up(void);
1027 int __connman_firewall_init(void);
1028 void __connman_firewall_cleanup(void);
1030 typedef int (* connman_nfacct_flush_cb_t) (unsigned int error, void *user_data);
1032 int __connman_nfacct_flush(connman_nfacct_flush_cb_t cb, void *user_data);
1034 struct nfacct_context;
1036 typedef void (* connman_nfacct_enable_cb_t) (unsigned int error,
1037 struct nfacct_context *ctx,
1039 typedef void (* connman_nfacct_disable_cb_t) (unsigned int error,
1040 struct nfacct_context *ctx,
1042 typedef void (* connman_nfacct_stats_cb_t) (struct nfacct_context *ctx,
1047 struct nfacct_context *__connman_nfacct_create_context(void);
1048 void __connman_nfacct_destroy_context(struct nfacct_context *ctx);
1050 int __connman_nfacct_add(struct nfacct_context *ctx, const char *name,
1051 connman_nfacct_stats_cb_t cb,
1053 int __connman_nfacct_enable(struct nfacct_context *ctx,
1054 connman_nfacct_enable_cb_t cb,
1056 int __connman_nfacct_disable(struct nfacct_context *ctx,
1057 connman_nfacct_disable_cb_t cb,
1060 void __connman_nfacct_cleanup(void);
1062 #include <connman/machine.h>
1064 int __connman_machine_init(void);
1065 void __connman_machine_cleanup(void);
1067 int __connman_util_get_random(uint64_t *val);
1068 int __connman_util_init(void);
1069 void __connman_util_cleanup(void);
1072 __attribute__ ((unused)) static int __tizentvextension = -1;
1073 #define TIZEN_TV_EXT (__builtin_expect(__tizentvextension != -1, 1) ? \
1074 __tizentvextension : \
1075 (__tizentvextension = connman_setting_get_bool("TizenTVExtension")))
1076 #else /* TIZEN_EXT */
1077 #define TIZEN_TV_EXT (0) /* Always False */
1078 #endif /* TIZEN_EXT */