Added a dbus property 'TimeUpdated'
[platform/upstream/connman.git] / src / connman.h
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007-2014  Intel Corporation. All rights reserved.
6  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #include <stdbool.h>
23
24 #include <glib.h>
25
26 #define CONNMAN_API_SUBJECT_TO_CHANGE
27 #if defined TIZEN_EXT
28 #define WIFI_COUNTRY_CODE_LEN 2
29 #define WIFI_PHY_MODE_LEN 18
30 #define GIO_SOCKET_RETRY_COUNT 3
31 #endif
32
33 #include <connman/dbus.h>
34
35 dbus_bool_t __connman_dbus_append_objpath_dict_array(DBusMessage *msg,
36                         connman_dbus_append_cb_t function, void *user_data);
37 dbus_bool_t __connman_dbus_append_objpath_array(DBusMessage *msg,
38                         connman_dbus_append_cb_t function, void *user_data);
39 int __connman_dbus_init(DBusConnection *conn);
40 void __connman_dbus_cleanup(void);
41
42 DBusMessage *__connman_error_failed(DBusMessage *msg, int errnum);
43 DBusMessage *__connman_error_invalid_arguments(DBusMessage *msg);
44 DBusMessage *__connman_error_permission_denied(DBusMessage *msg);
45 DBusMessage *__connman_error_passphrase_required(DBusMessage *msg);
46 DBusMessage *__connman_error_not_registered(DBusMessage *msg);
47 DBusMessage *__connman_error_not_unique(DBusMessage *msg);
48 DBusMessage *__connman_error_not_supported(DBusMessage *msg);
49 DBusMessage *__connman_error_not_implemented(DBusMessage *msg);
50 DBusMessage *__connman_error_not_found(DBusMessage *msg);
51 DBusMessage *__connman_error_no_carrier(DBusMessage *msg);
52 DBusMessage *__connman_error_in_progress(DBusMessage *msg);
53 DBusMessage *__connman_error_already_exists(DBusMessage *msg);
54 DBusMessage *__connman_error_already_enabled(DBusMessage *msg);
55 DBusMessage *__connman_error_already_disabled(DBusMessage *msg);
56 DBusMessage *__connman_error_already_connected(DBusMessage *msg);
57 DBusMessage *__connman_error_not_connected(DBusMessage *msg);
58 DBusMessage *__connman_error_operation_aborted(DBusMessage *msg);
59 DBusMessage *__connman_error_operation_timeout(DBusMessage *msg);
60 DBusMessage *__connman_error_invalid_service(DBusMessage *msg);
61 DBusMessage *__connman_error_invalid_property(DBusMessage *msg);
62 #if defined TIZEN_EXT_WIFI_MESH
63 DBusMessage *__connman_error_invalid_command(DBusMessage *msg);
64 DBusMessage *__connman_error_scan_abort_failed(DBusMessage *msg);
65 #endif
66 DBusMessage *__connman_error_operation_canceled(DBusMessage *msg);
67
68 int __connman_manager_init(void);
69 void __connman_manager_cleanup(void);
70
71 enum time_updates {
72         TIME_UPDATES_UNKNOWN = 0,
73         TIME_UPDATES_MANUAL  = 1,
74         TIME_UPDATES_AUTO    = 2,
75 };
76
77 enum time_updates __connman_clock_timeupdates(void);
78 int __connman_clock_init(void);
79 void __connman_clock_cleanup(void);
80
81 void __connman_clock_update_timezone(void);
82 #if defined TIZEN_EXT
83 void __connman_clock_set_time_updated(bool updated);
84 #endif
85
86 int __connman_timezone_init(void);
87 void __connman_timezone_cleanup(void);
88
89 char *__connman_timezone_lookup(void);
90 int __connman_timezone_change(const char *zone);
91
92 int __connman_agent_init(void);
93 void __connman_agent_cleanup(void);
94
95 void __connman_counter_send_usage(const char *path,
96                                         DBusMessage *message);
97 int __connman_counter_register(const char *owner, const char *path,
98                                                 unsigned int interval);
99 int __connman_counter_unregister(const char *owner, const char *path);
100
101 int __connman_counter_init(void);
102 void __connman_counter_cleanup(void);
103
104 #include <connman/agent.h>
105
106 struct connman_service;
107 struct connman_peer;
108
109 void __connman_agent_cancel(struct connman_service *service);
110
111 typedef void (* authentication_cb_t) (struct connman_service *service,
112                                 bool values_received,
113                                 const char *name, int name_len,
114                                 const char *identifier, const char *secret,
115                                 bool wps, const char *wpspin,
116                                 const char *error, void *user_data);
117 typedef void (* browser_authentication_cb_t) (struct connman_service *service,
118                                 bool authentication_done,
119                                 const char *error, void *user_data);
120 typedef void (* peer_wps_cb_t) (struct connman_peer *peer, bool choice_done,
121                                 const char *wpspin, const char *error,
122                                 void *user_data);
123 int __connman_agent_request_passphrase_input(struct connman_service *service,
124                                 authentication_cb_t callback,
125                                 const char *dbus_sender, void *user_data);
126 int __connman_agent_request_login_input(struct connman_service *service,
127                                 authentication_cb_t callback, void *user_data);
128 int __connman_agent_request_browser(struct connman_service *service,
129                                 browser_authentication_cb_t callback,
130                                 const char *url, void *user_data);
131 int __connman_agent_report_peer_error(struct connman_peer *peer,
132                                         const char *path, const char *error,
133                                         report_error_cb_t callback,
134                                         const char *dbus_sender,
135                                         void *user_data);
136 int __connman_agent_request_peer_authorization(struct connman_peer *peer,
137                                                 peer_wps_cb_t callback,
138                                                 bool wps_requested,
139                                                 const char *dbus_sender,
140                                                 void *user_data);
141
142 #include <connman/log.h>
143
144 int __connman_log_init(const char *program, const char *debug,
145                 gboolean detach, gboolean backtrace,
146                 const char *program_name, const char *program_version);
147 void __connman_log_cleanup(gboolean backtrace);
148 void __connman_log_enable(struct connman_debug_desc *start,
149                                         struct connman_debug_desc *stop);
150
151 #include <connman/backtrace.h>
152
153 #include <connman/option.h>
154
155 #include <connman/setting.h>
156
157 #include <connman/plugin.h>
158
159 int __connman_plugin_init(const char *pattern, const char *exclude);
160 void __connman_plugin_cleanup(void);
161
162 #include <connman/task.h>
163
164 int __connman_task_init(void);
165 void __connman_task_cleanup(void);
166
167 #include <connman/inet.h>
168
169 char **__connman_inet_get_running_interfaces(void);
170 int __connman_inet_modify_address(int cmd, int flags, int index, int family,
171                                 const char *address,
172                                 const char *peer,
173                                 unsigned char prefixlen,
174                                 const char *broadcast);
175 int __connman_inet_get_interface_address(int index, int family, void *address);
176 int __connman_inet_get_interface_ll_address(int index, int family, void *address);
177 int __connman_inet_get_interface_mac_address(int index, uint8_t *mac_address);
178
179 bool __connman_inet_is_any_addr(const char *address, int family);
180
181 #include <netinet/ip6.h>
182 #include <netinet/icmp6.h>
183
184 typedef void (*__connman_inet_rs_cb_t) (struct nd_router_advert *reply,
185                                         unsigned int length, void *user_data);
186
187 int __connman_inet_ipv6_send_rs(int index, int timeout,
188                         __connman_inet_rs_cb_t callback, void *user_data);
189 int __connman_inet_ipv6_send_ra(int index, struct in6_addr *src_addr,
190                                 GSList *prefixes, int router_lifetime);
191 #if defined TIZEN_EXT
192 void __connman_network_set_auto_ipv6_gateway(char *gateway, void *user_data);
193 #endif
194
195 typedef void (*__connman_inet_ns_cb_t) (struct nd_neighbor_advert *reply,
196                                         unsigned int length,
197                                         struct in6_addr *addr,
198                                         void *user_data);
199 int __connman_inet_ipv6_do_dad(int index, int timeout_ms,
200                         struct in6_addr *addr,
201                         __connman_inet_ns_cb_t callback, void *user_data);
202
203 typedef void (*__connman_inet_recv_rs_cb_t) (struct nd_router_solicit *reply,
204                                         unsigned int length, void *user_data);
205 int __connman_inet_ipv6_start_recv_rs(int index,
206                                 __connman_inet_recv_rs_cb_t callback,
207                                 void *user_data, void **context);
208 void __connman_inet_ipv6_stop_recv_rs(void *context);
209
210 int __connman_network_refresh_rs_ipv6(struct connman_network *network, int index);
211
212 GSList *__connman_inet_ipv6_get_prefixes(struct nd_router_advert *hdr,
213                                         unsigned int length);
214 typedef void (*connman_inet_addr_cb_t) (const char *src_address, int index,
215                                         void *user_data);
216 int __connman_inet_get_route(const char *dst_address,
217                         connman_inet_addr_cb_t callback, void *user_data);
218
219 struct __connman_inet_rtnl_handle {
220         int                     fd;
221         struct sockaddr_nl      local;
222         struct sockaddr_nl      peer;
223         __u32                   seq;
224         __u32                   dump;
225
226         struct {
227                 struct nlmsghdr n;
228                 union {
229                         struct {
230                                 struct rtmsg rt;
231                         } r;
232                         struct {
233                                 struct ifaddrmsg ifa;
234                         } i;
235                 } u;
236                 char buf[1024];
237         } req;
238 };
239
240 int __connman_inet_rtnl_open(struct __connman_inet_rtnl_handle *rth);
241 typedef void (*__connman_inet_rtnl_cb_t) (struct nlmsghdr *answer,
242                                         void *user_data);
243 int __connman_inet_rtnl_talk(struct __connman_inet_rtnl_handle *rtnl,
244                         struct nlmsghdr *n, int timeout,
245                         __connman_inet_rtnl_cb_t callback, void *user_data);
246 static inline
247 int __connman_inet_rtnl_send(struct __connman_inet_rtnl_handle *rtnl,
248                                                 struct nlmsghdr *n)
249 {
250         return __connman_inet_rtnl_talk(rtnl, n, 0, NULL, NULL);
251 }
252
253 void __connman_inet_rtnl_close(struct __connman_inet_rtnl_handle *rth);
254 int __connman_inet_rtnl_addattr_l(struct nlmsghdr *n, size_t max_length,
255                         int type, const void *data, size_t data_length);
256 int __connman_inet_rtnl_addattr32(struct nlmsghdr *n, size_t maxlen,
257                         int type, __u32 data);
258
259 int __connman_inet_add_fwmark_rule(uint32_t table_id, int family, uint32_t fwmark);
260 int __connman_inet_del_fwmark_rule(uint32_t table_id, int family, uint32_t fwmark);
261 int __connman_inet_add_default_to_table(uint32_t table_id, int ifindex, const char *gateway);
262 int __connman_inet_add_subnet_to_table(uint32_t table_id, int ifindex,
263                         const char *gateway, unsigned char prefixlen);
264 int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex, const char *gateway);
265 int __connman_inet_del_subnet_from_table(uint32_t table_id, int ifindex,
266                         const char *gateway, unsigned char prefixlen);
267 int __connman_inet_get_address_netmask(int ifindex,
268                 struct sockaddr_in *address, struct sockaddr_in *netmask);
269
270 bool __connman_inet_isrootnfs_device(const char *devname);
271 char **__connman_inet_get_pnp_nameservers(const char *pnp_file);
272
273 #include <connman/resolver.h>
274
275 int __connman_resolver_init(gboolean dnsproxy);
276 void __connman_resolver_cleanup(void);
277 void __connman_resolver_append_fallback_nameservers(void);
278 int __connman_resolvfile_append(int index, const char *domain, const char *server);
279 int __connman_resolvfile_remove(int index, const char *domain, const char *server);
280 int __connman_resolver_redo_servers(int index);
281 int __connman_resolver_set_mdns(int index, bool enabled);
282
283 GKeyFile *__connman_storage_open_global(void);
284 GKeyFile *__connman_storage_load_global(void);
285 int __connman_storage_save_global(GKeyFile *keyfile);
286 void __connman_storage_delete_global(void);
287 #if defined TIZEN_EXT
288 GKeyFile *__connman_storage_load_ins(void);
289 int __connman_storage_save_ins(GKeyFile *keyfile);
290 #endif
291
292 GKeyFile *__connman_storage_load_config(const char *ident);
293 GKeyFile *__connman_storage_load_provider_config(const char *ident);
294
295 int __connman_storage_save_service(GKeyFile *keyfile, const char *ident);
296 GKeyFile *__connman_storage_load_provider(const char *identifier);
297 void __connman_storage_save_provider(GKeyFile *keyfile, const char *identifier);
298 bool __connman_storage_remove_provider(const char *identifier);
299 char **__connman_storage_get_providers(void);
300 bool __connman_storage_remove_service(const char *service_id);
301
302 int __connman_detect_init(void);
303 void __connman_detect_cleanup(void);
304
305 #include <connman/inotify.h>
306
307 int __connman_inotify_init(void);
308 void __connman_inotify_cleanup(void);
309
310 #include <connman/proxy.h>
311
312 int __connman_proxy_init(void);
313 void __connman_proxy_cleanup(void);
314
315 #include <connman/ipconfig.h>
316
317 struct connman_ipaddress {
318         int family;
319         unsigned char prefixlen;
320         char *local;
321         char *peer;
322         char *broadcast;
323         char *gateway;
324 };
325
326 struct connman_ipconfig_ops {
327         void (*up) (struct connman_ipconfig *ipconfig, const char *ifname);
328         void (*down) (struct connman_ipconfig *ipconfig, const char *ifname);
329         void (*lower_up) (struct connman_ipconfig *ipconfig, const char *ifname);
330         void (*lower_down) (struct connman_ipconfig *ipconfig, const char *ifname);
331         void (*ip_bound) (struct connman_ipconfig *ipconfig, const char *ifname);
332         void (*ip_release) (struct connman_ipconfig *ipconfig, const char *ifname);
333         void (*route_set) (struct connman_ipconfig *ipconfig, const char *ifname);
334         void (*route_unset) (struct connman_ipconfig *ipconfig, const char *ifname);
335 };
336
337 struct connman_ipconfig *__connman_ipconfig_create(int index,
338                                         enum connman_ipconfig_type type);
339
340 #define __connman_ipconfig_ref(ipconfig) \
341         __connman_ipconfig_ref_debug(ipconfig, __FILE__, __LINE__, __func__)
342 #define __connman_ipconfig_unref(ipconfig) \
343         __connman_ipconfig_unref_debug(ipconfig, __FILE__, __LINE__, __func__)
344
345 struct connman_ipconfig *
346 __connman_ipconfig_ref_debug(struct connman_ipconfig *ipconfig,
347                         const char *file, int line, const char *caller);
348 void __connman_ipconfig_unref_debug(struct connman_ipconfig *ipconfig,
349                         const char *file, int line, const char *caller);
350
351 void *__connman_ipconfig_get_data(struct connman_ipconfig *ipconfig);
352 void __connman_ipconfig_set_data(struct connman_ipconfig *ipconfig, void *data);
353
354 int __connman_ipconfig_get_index(struct connman_ipconfig *ipconfig);
355
356 void __connman_ipconfig_set_ops(struct connman_ipconfig *ipconfig,
357                                 const struct connman_ipconfig_ops *ops);
358 int __connman_ipconfig_set_method(struct connman_ipconfig *ipconfig,
359                                         enum connman_ipconfig_method method);
360 void __connman_ipconfig_disable_ipv6(struct connman_ipconfig *ipconfig);
361 void __connman_ipconfig_enable_ipv6(struct connman_ipconfig *ipconfig);
362
363 int __connman_ipconfig_init(void);
364 void __connman_ipconfig_cleanup(void);
365
366 struct rtnl_link_stats;
367
368 void __connman_ipconfig_newlink(int index, unsigned short type,
369                                 unsigned int flags, const char *address,
370                                                         unsigned short mtu,
371                                                 struct rtnl_link_stats *stats);
372 void __connman_ipconfig_dellink(int index, struct rtnl_link_stats *stats);
373 int __connman_ipconfig_newaddr(int index, int family, const char *label,
374                                 unsigned char prefixlen, const char *address);
375 void __connman_ipconfig_deladdr(int index, int family, const char *label,
376                                 unsigned char prefixlen, const char *address);
377 void __connman_ipconfig_newroute(int index, int family, unsigned char scope,
378                                         const char *dst, const char *gateway);
379 void __connman_ipconfig_delroute(int index, int family, unsigned char scope,
380                                         const char *dst, const char *gateway);
381
382 void __connman_ipconfig_foreach(void (*function) (int index, void *user_data),
383                                                         void *user_data);
384 enum connman_ipconfig_type __connman_ipconfig_get_config_type(
385                                         struct connman_ipconfig *ipconfig);
386 unsigned short __connman_ipconfig_get_type_from_index(int index);
387 unsigned int __connman_ipconfig_get_flags_from_index(int index);
388 const char *__connman_ipconfig_get_gateway_from_index(int index,
389         enum connman_ipconfig_type type);
390 void __connman_ipconfig_set_index(struct connman_ipconfig *ipconfig, int index);
391
392 const char *__connman_ipconfig_get_local(struct connman_ipconfig *ipconfig);
393 void __connman_ipconfig_set_local(struct connman_ipconfig *ipconfig, const char *address);
394 const char *__connman_ipconfig_get_peer(struct connman_ipconfig *ipconfig);
395 void __connman_ipconfig_set_peer(struct connman_ipconfig *ipconfig, const char *address);
396 const char *__connman_ipconfig_get_broadcast(struct connman_ipconfig *ipconfig);
397 void __connman_ipconfig_set_broadcast(struct connman_ipconfig *ipconfig, const char *broadcast);
398 const char *__connman_ipconfig_get_gateway(struct connman_ipconfig *ipconfig);
399 void __connman_ipconfig_set_gateway(struct connman_ipconfig *ipconfig, const char *gateway);
400
401 #if defined TIZEN_EXT
402 void __connman_ipconfig_set_dhcp_lease_duration(struct connman_ipconfig *ipconfig, int dhcp_lease_duration);
403 #endif
404
405 unsigned char __connman_ipconfig_get_prefixlen(struct connman_ipconfig *ipconfig);
406 void __connman_ipconfig_set_prefixlen(struct connman_ipconfig *ipconfig, unsigned char prefixlen);
407
408 int __connman_ipconfig_enable(struct connman_ipconfig *ipconfig);
409 int __connman_ipconfig_disable(struct connman_ipconfig *ipconfig);
410 bool __connman_ipconfig_is_usable(struct connman_ipconfig *ipconfig);
411
412 const char *__connman_ipconfig_method2string(enum connman_ipconfig_method method);
413 const char *__connman_ipconfig_type2string(enum connman_ipconfig_type type);
414 enum connman_ipconfig_method __connman_ipconfig_string2method(const char *method);
415
416 void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig,
417                                                         DBusMessageIter *iter);
418 void __connman_ipconfig_append_ipv4config(struct connman_ipconfig *ipconfig,
419                                                         DBusMessageIter *iter);
420 void __connman_ipconfig_append_ipv6(struct connman_ipconfig *ipconfig,
421                                         DBusMessageIter *iter,
422                                         struct connman_ipconfig *ip4config);
423 void __connman_ipconfig_append_ipv6config(struct connman_ipconfig *ipconfig,
424                                                         DBusMessageIter *iter);
425 int __connman_ipconfig_set_config(struct connman_ipconfig *ipconfig,
426                                                         DBusMessageIter *array);
427 void __connman_ipconfig_append_ethernet(struct connman_ipconfig *ipconfig,
428                                                         DBusMessageIter *iter);
429 enum connman_ipconfig_method __connman_ipconfig_get_method(
430                                 struct connman_ipconfig *ipconfig);
431
432 int __connman_ipconfig_address_add(struct connman_ipconfig *ipconfig);
433 int __connman_ipconfig_address_remove(struct connman_ipconfig *ipconfig);
434 int __connman_ipconfig_address_unset(struct connman_ipconfig *ipconfig);
435 #if defined TIZEN_EXT
436 /*
437  * Description: __connman_service_lookup_from_index cannot find correct service
438  *              e.g. same interface or same APN of cellular profile
439  */
440 int __connman_ipconfig_gateway_add(struct connman_ipconfig *ipconfig, struct connman_service *service);
441 #else
442 int __connman_ipconfig_gateway_add(struct connman_ipconfig *ipconfig);
443 #endif
444 void __connman_ipconfig_gateway_remove(struct connman_ipconfig *ipconfig);
445
446 int __connman_ipconfig_set_proxy_autoconfig(struct connman_ipconfig *ipconfig,
447                                                         const char *url);
448 const char *__connman_ipconfig_get_proxy_autoconfig(struct connman_ipconfig *ipconfig);
449 void __connman_ipconfig_set_dhcp_address(struct connman_ipconfig *ipconfig,
450                                         const char *address);
451 char *__connman_ipconfig_get_dhcp_address(struct connman_ipconfig *ipconfig);
452 void __connman_ipconfig_set_dhcpv6_prefixes(struct connman_ipconfig *ipconfig,
453                                         char **prefixes);
454 char **__connman_ipconfig_get_dhcpv6_prefixes(struct connman_ipconfig *ipconfig);
455
456 void __connman_ipconfig_load(struct connman_ipconfig *ipconfig,
457                 GKeyFile *keyfile, const char *identifier, const char *prefix);
458 void __connman_ipconfig_save(struct connman_ipconfig *ipconfig,
459                 GKeyFile *keyfile, const char *identifier, const char *prefix);
460 bool __connman_ipconfig_ipv6_privacy_enabled(struct connman_ipconfig *ipconfig);
461 int __connman_ipconfig_ipv6_reset_privacy(struct connman_ipconfig *ipconfig);
462 int __connman_ipconfig_ipv6_set_privacy(struct connman_ipconfig *ipconfig,
463                                         const char *value);
464 bool __connman_ipconfig_ipv6_is_enabled(struct connman_ipconfig *ipconfig);
465
466 int __connman_ipconfig_set_rp_filter();
467 void __connman_ipconfig_unset_rp_filter(int old_value);
468
469 #include <connman/utsname.h>
470
471 int __connman_utsname_set_hostname(const char *hostname);
472 int __connman_utsname_set_domainname(const char *domainname);
473
474 #include <connman/timeserver.h>
475
476 int __connman_timeserver_init(void);
477 void __connman_timeserver_cleanup(void);
478
479 char **__connman_timeserver_system_get();
480
481 GSList *__connman_timeserver_add_list(GSList *server_list,
482                 const char *timeserver);
483 GSList *__connman_timeserver_get_all(struct connman_service *service);
484 int __connman_timeserver_sync(struct connman_service *service);
485
486 enum __connman_dhcpv6_status {
487         CONNMAN_DHCPV6_STATUS_FAIL     = 0,
488         CONNMAN_DHCPV6_STATUS_SUCCEED  = 1,
489         CONNMAN_DHCPV6_STATUS_RESTART  = 2,
490 };
491
492 #if defined TIZEN_EXT
493 void set_dhcp_discover_timeout(int timeout_value);
494 void set_dhcp_discover_retry_count(int retry_count);
495 #endif
496
497 typedef void (* dhcpv6_cb) (struct connman_network *network,
498                         enum __connman_dhcpv6_status status, gpointer data);
499
500 typedef void (* dhcp_cb) (struct connman_ipconfig *ipconfig,
501                         struct connman_network *opt_network,
502                         bool success, gpointer data);
503 char *__connman_dhcp_get_server_address(struct connman_ipconfig *ipconfig);
504 int __connman_dhcp_start(struct connman_ipconfig *ipconfig,
505                         struct connman_network *network, dhcp_cb callback,
506                         gpointer user_data);
507 void __connman_dhcp_stop(struct connman_ipconfig *ipconfig);
508 void __connman_dhcp_decline(struct connman_ipconfig *ipconfig);
509 int __connman_dhcp_init(void);
510 void __connman_dhcp_cleanup(void);
511 int __connman_dhcpv6_init(void);
512 void __connman_dhcpv6_cleanup(void);
513 int __connman_dhcpv6_start_info(struct connman_network *network,
514                                 dhcpv6_cb callback);
515 void __connman_dhcpv6_stop(struct connman_network *network);
516 int __connman_dhcpv6_start(struct connman_network *network,
517                                 GSList *prefixes, dhcpv6_cb callback);
518 int __connman_dhcpv6_start_renew(struct connman_network *network,
519                                 dhcpv6_cb callback);
520 int __connman_dhcpv6_start_release(struct connman_network *network,
521                                 dhcpv6_cb callback);
522 int __connman_dhcpv6_start_pd(int index, GSList *prefixes, dhcpv6_cb callback);
523 void __connman_dhcpv6_stop_pd(int index);
524 int __connman_dhcpv6_start_pd_renew(struct connman_network *network,
525                                                         dhcpv6_cb callback);
526 int __connman_dhcpv6_start_pd_release(struct connman_network *network,
527                                 dhcpv6_cb callback);
528
529 int __connman_ipv4_init(void);
530 void __connman_ipv4_cleanup(void);
531
532 int __connman_connection_init(void);
533 void __connman_connection_cleanup(void);
534
535 int __connman_connection_gateway_add(struct connman_service *service,
536                                         const char *gateway,
537                                         enum connman_ipconfig_type type,
538                                         const char *peer);
539 void __connman_connection_gateway_remove(struct connman_service *service,
540                                         enum connman_ipconfig_type type);
541 int __connman_connection_get_vpn_index(int phy_index);
542
543 bool __connman_connection_update_gateway(void);
544
545 typedef void (*__connman_ntp_cb_t) (bool success, void *user_data);
546 int __connman_ntp_start(char *server, __connman_ntp_cb_t callback,
547                         void *user_data);
548 void __connman_ntp_stop();
549
550 int __connman_wpad_init(void);
551 void __connman_wpad_cleanup(void);
552 int __connman_wpad_start(struct connman_service *service);
553 void __connman_wpad_stop(struct connman_service *service);
554
555 int __connman_wispr_init(void);
556 void __connman_wispr_cleanup(void);
557 int __connman_wispr_start(struct connman_service *service,
558                                         enum connman_ipconfig_type type);
559 void __connman_wispr_stop(struct connman_service *service);
560
561 #include <connman/technology.h>
562
563 void __connman_technology_list_struct(DBusMessageIter *array);
564
565 int __connman_technology_add_device(struct connman_device *device);
566 int __connman_technology_remove_device(struct connman_device *device);
567 int __connman_technology_enabled(enum connman_service_type type);
568 int __connman_technology_disabled(enum connman_service_type type);
569 int __connman_technology_set_offlinemode(bool offlinemode);
570 bool __connman_technology_get_offlinemode(void);
571 void __connman_technology_set_connected(enum connman_service_type type,
572                                         bool connected);
573
574 int __connman_technology_add_rfkill(unsigned int index,
575                                         enum connman_service_type type,
576                                                 bool softblock,
577                                                 bool hardblock);
578 int __connman_technology_update_rfkill(unsigned int index,
579                                         enum connman_service_type type,
580                                                 bool softblock,
581                                                 bool hardblock);
582 int __connman_technology_remove_rfkill(unsigned int index,
583                                         enum connman_service_type type);
584
585 void __connman_technology_scan_started(struct connman_device *device);
586 void __connman_technology_scan_stopped(struct connman_device *device,
587                                         enum connman_service_type type);
588 void __connman_technology_add_interface(enum connman_service_type type,
589                                 int index, const char *ident);
590 void __connman_technology_remove_interface(enum connman_service_type type,
591                                 int index, const char *ident);
592 void __connman_technology_notify_regdom_by_device(struct connman_device *device,
593                                                 int result, const char *alpha2);
594
595 #if defined TIZEN_EXT
596 enum bssid_type {
597         CHECK_BSSID = 0,
598         GET_BSSID   = 1,
599         SET_BSSID   = 2,
600         RESET_BSSID = 3,
601 };
602
603 int set_connman_bssid(enum bssid_type mode, char *bssid, const char *ifname);
604 void technology_save_device(struct connman_device *device);
605 #endif
606
607 #include <connman/device.h>
608
609 int __connman_device_init(const char *device, const char *nodevice);
610 void __connman_device_cleanup(void);
611
612 void __connman_device_list(DBusMessageIter *iter, void *user_data);
613
614 enum connman_service_type __connman_device_get_service_type(struct connman_device *device);
615 struct connman_device *__connman_device_find_device(enum connman_service_type type);
616 int __connman_device_request_scan(enum connman_service_type type);
617 int __connman_device_request_scan_full(enum connman_service_type type);
618 int __connman_device_request_hidden_scan(struct connman_device *device,
619                                 const char *ssid, unsigned int ssid_len,
620                                 const char *identity, const char *passphrase,
621                                 const char *security, void *user_data);
622 void __connman_device_stop_scan(enum connman_service_type type);
623 #if defined TIZEN_EXT
624 int __connman_device_request_specific_scan(enum connman_service_type type,
625                                 const char *ifname, int scan_type, GSList *specific_scan_list);
626 int connman_device_request_device_scan(enum connman_service_type type,
627                                 const char * ifname, bool force_full_scan);
628 #endif
629
630 bool __connman_device_isfiltered(const char *devname);
631
632 void __connman_device_set_network(struct connman_device *device,
633                                         struct connman_network *network);
634 void __connman_device_cleanup_networks(struct connman_device *device);
635
636 int __connman_device_enable(struct connman_device *device);
637 int __connman_device_disable(struct connman_device *device);
638 int __connman_device_disconnect(struct connman_device *device);
639
640 bool __connman_device_has_driver(struct connman_device *device);
641
642 const char *__connman_device_get_type(struct connman_device *device);
643
644 int __connman_rfkill_init(void);
645 void __connman_rfkill_cleanup(void);
646 int __connman_rfkill_block(enum connman_service_type type, bool block);
647
648 #if defined TIZEN_EXT
649 char *index2ident(int index, const char *prefix);
650 char *index2addr(int index);
651 char *_get_wifi_ident(void);
652 char *_get_wifi_addr(void);
653 #endif
654
655 #include <connman/network.h>
656
657 int __connman_network_init(void);
658 void __connman_network_cleanup(void);
659
660 void __connman_network_set_device(struct connman_network *network,
661                                         struct connman_device *device);
662
663 int __connman_network_connect(struct connman_network *network);
664 int __connman_network_disconnect(struct connman_network *network);
665 int __connman_network_clear_ipconfig(struct connman_network *network,
666                                         struct connman_ipconfig *ipconfig);
667 int __connman_network_enable_ipconfig(struct connman_network *network,
668                                 struct connman_ipconfig *ipconfig);
669
670 const char *__connman_network_get_type(struct connman_network *network);
671 const char *__connman_network_get_group(struct connman_network *network);
672 const char *__connman_network_get_ident(struct connman_network *network);
673 bool __connman_network_get_weakness(struct connman_network *network);
674
675 int __connman_config_init();
676 void __connman_config_cleanup(void);
677
678 int __connman_config_load_service(GKeyFile *keyfile, const char *group,
679                                   bool persistent);
680 int __connman_config_provision_service(struct connman_service *service);
681 int __connman_config_provision_service_ident(struct connman_service *service,
682                 const char *ident, const char *file, const char *entry);
683
684 char *__connman_config_get_string(GKeyFile *key_file,
685         const char *group_name, const char *key, GError **error);
686
687 char **__connman_config_get_string_list(GKeyFile *key_file,
688         const char *group_name, const char *key, gsize *length, GError **error);
689
690 bool __connman_config_get_bool(GKeyFile *key_file,
691         const char *group_name, const char *key, GError **error);
692 bool __connman_config_address_provisioned(const char *address,
693                                         const char *netmask);
694
695 #include <connman/tethering.h>
696
697 int __connman_tethering_init(void);
698 void __connman_tethering_cleanup(void);
699
700 const char *__connman_tethering_get_bridge(void);
701 int __connman_tethering_set_enabled(void);
702 void __connman_tethering_set_disabled(void);
703 void __connman_tethering_list_clients(DBusMessageIter *array);
704
705 int __connman_private_network_request(DBusMessage *msg, const char *owner);
706 int __connman_private_network_release(const char *path);
707
708 int __connman_ipv6pd_setup(const char *bridge);
709 void __connman_ipv6pd_cleanup(void);
710
711 #include <connman/provider.h>
712
713 bool __connman_provider_check_routes(struct connman_provider *provider);
714 int __connman_provider_append_user_route(struct connman_provider *provider,
715                         int family, const char *network, const char *netmask);
716 void __connman_provider_append_properties(struct connman_provider *provider, DBusMessageIter *iter);
717 void __connman_provider_list(DBusMessageIter *iter, void *user_data);
718 bool __connman_provider_is_immutable(struct connman_provider *provider);
719 int __connman_provider_create_and_connect(DBusMessage *msg);
720 const char * __connman_provider_get_ident(struct connman_provider *provider);
721 int __connman_provider_indicate_state(struct connman_provider *provider,
722                                         enum connman_provider_state state);
723 int __connman_provider_indicate_error(struct connman_provider *provider,
724                                         enum connman_provider_error error);
725 int __connman_provider_connect(struct connman_provider *provider,
726                                         const char *dbus_sender);
727 int __connman_provider_remove_by_path(const char *path);
728 void __connman_provider_cleanup(void);
729 int __connman_provider_init(void);
730
731 #include <connman/service.h>
732
733 int __connman_service_init(void);
734 void __connman_service_cleanup(void);
735 int __connman_service_load_modifiable(struct connman_service *service);
736
737 void __connman_service_list_struct(DBusMessageIter *iter);
738 #if defined TIZEN_EXT_INS
739 void __connman_ins_list_struct(DBusMessageIter *iter);
740 #endif
741
742 #if defined TIZEN_EXT
743 int connman_service_get_ipv6_dns_method(struct connman_service *service);
744 enum connman_dnsconfig_method {
745         CONNMAN_DNSCONFIG_METHOD_UNKNOWN = 0,
746         CONNMAN_DNSCONFIG_METHOD_MANUAL  = 1,
747         CONNMAN_DNSCONFIG_METHOD_DHCP    = 2,
748 };
749 #endif
750
751 int __connman_service_compare(const struct connman_service *a,
752                                         const struct connman_service *b);
753
754 struct connman_service *__connman_service_lookup_from_index(int index);
755 struct connman_service *__connman_service_create_from_network(struct connman_network *network);
756 struct connman_service *__connman_service_create_from_provider(struct connman_provider *provider);
757 bool __connman_service_index_is_default(int index);
758 #if defined TIZEN_EXT
759 void __connman_service_notify_strength_changed(struct connman_network *network);
760 #endif
761 void __connman_service_update_from_network(struct connman_network *network);
762 void __connman_service_remove_from_network(struct connman_network *network);
763 void __connman_service_read_ip4config(struct connman_service *service);
764 void __connman_service_read_ip6config(struct connman_service *service);
765
766 struct connman_ipconfig *__connman_service_get_ip4config(
767                                 struct connman_service *service);
768 struct connman_ipconfig *__connman_service_get_ip6config(
769                                 struct connman_service *service);
770 struct connman_ipconfig *__connman_service_get_ipconfig(
771                                 struct connman_service *service, int family);
772 void __connman_service_notify_ipv4_configuration(
773                                 struct connman_service *service);
774 void __connman_service_wispr_start(struct connman_service *service,
775                                 enum connman_ipconfig_type type);
776 bool __connman_service_is_connected_state(struct connman_service *service,
777                                         enum connman_ipconfig_type type);
778 const char *__connman_service_get_path(struct connman_service *service);
779 const char *__connman_service_get_name(struct connman_service *service);
780 struct connman_network *__connman_service_get_network(struct connman_service *service);
781 enum connman_service_security __connman_service_get_security(struct connman_service *service);
782 const char *__connman_service_get_phase2(struct connman_service *service);
783 bool __connman_service_wps_enabled(struct connman_service *service);
784 #if defined TIZEN_EXT
785 void __connman_service_set_storage_reload(struct connman_service *service,
786                                                 bool storage_reload);
787 #endif
788 int __connman_service_set_favorite(struct connman_service *service,
789                                                 bool favorite);
790 int __connman_service_set_favorite_delayed(struct connman_service *service,
791                                         bool favorite,
792                                         bool delay_ordering);
793 int __connman_service_set_immutable(struct connman_service *service,
794                                                 bool immutable);
795 int __connman_service_set_ignore(struct connman_service *service,
796                                                 bool ignore);
797 void __connman_service_set_search_domains(struct connman_service *service,
798                                         char **domains);
799 int __connman_service_set_mdns(struct connman_service *service,
800                                         bool enabled);
801
802 void __connman_service_set_string(struct connman_service *service,
803                                         const char *key, const char *value);
804 int __connman_service_online_check_failed(struct connman_service *service,
805                                         enum connman_ipconfig_type type);
806 int __connman_service_ipconfig_indicate_state(struct connman_service *service,
807                                         enum connman_service_state new_state,
808                                         enum connman_ipconfig_type type);
809 enum connman_service_state __connman_service_ipconfig_get_state(
810                                         struct connman_service *service,
811                                         enum connman_ipconfig_type type);
812
813 #if defined TIZEN_EXT
814 void connman_check_proxy_setup_and_wispr_start(struct connman_service *service);
815 #endif
816
817 int __connman_service_indicate_error(struct connman_service *service,
818                                         enum connman_service_error error);
819 int __connman_service_clear_error(struct connman_service *service);
820 int __connman_service_indicate_default(struct connman_service *service);
821
822 int __connman_service_connect(struct connman_service *service,
823                         enum connman_service_connect_reason reason);
824 int __connman_service_disconnect(struct connman_service *service);
825 int __connman_service_disconnect_all(void);
826 void __connman_service_set_active_session(bool enable, GSList *list);
827 void __connman_service_auto_connect(enum connman_service_connect_reason reason);
828
829 #if defined TIZEN_EXT
830 bool __connman_service_get_auto_connect_mode(void);
831 void __connman_service_set_auto_connect_mode(bool enable);
832 #endif
833
834 #if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
835 int __connman_service_get_use_eapol(struct connman_service *service);
836 int __connman_service_get_connect_reason(struct connman_service *service);
837 #endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
838
839 bool __connman_service_remove(struct connman_service *service);
840 bool __connman_service_is_provider_pending(struct connman_service *service);
841 void __connman_service_set_provider_pending(struct connman_service *service,
842                                                         DBusMessage *msg);
843 void __connman_service_set_hidden_data(struct connman_service *service,
844                                 gpointer user_data);
845 void __connman_service_return_error(struct connman_service *service,
846                                 int error, gpointer user_data);
847
848 int __connman_service_provision_changed(const char *ident);
849 void __connman_service_set_config(struct connman_service *service,
850                                 const char *file_id, const char *section);
851
852 const char *__connman_service_type2string(enum connman_service_type type);
853 enum connman_service_type __connman_service_string2type(const char *str);
854 enum connman_service_security __connman_service_string2security(const char *str);
855
856 #if defined TIZEN_EXT
857 int __connman_service_nameserver_append(struct connman_service *service,
858                                 const char *nameserver, bool is_auto,
859                                 enum connman_ipconfig_type type);
860 int __connman_service_nameserver_remove(struct connman_service *service,
861                                 const char *nameserver, bool is_auto,
862                                 enum connman_ipconfig_type type);
863 #else
864 int __connman_service_nameserver_append(struct connman_service *service,
865                                 const char *nameserver, bool is_auto);
866 int __connman_service_nameserver_remove(struct connman_service *service,
867                                 const char *nameserver, bool is_auto);
868 #endif
869 void __connman_service_nameserver_clear(struct connman_service *service);
870 void __connman_service_nameserver_add_routes(struct connman_service *service,
871                                                 const char *gw);
872 void __connman_service_nameserver_del_routes(struct connman_service *service,
873                                         enum connman_ipconfig_type type);
874 void __connman_service_set_timeservers(struct connman_service *service,
875                                                 char **timeservers);
876 int __connman_service_timeserver_append(struct connman_service *service,
877                                                 const char *timeserver);
878 int __connman_service_timeserver_remove(struct connman_service *service,
879                                                 const char *timeserver);
880 void __connman_service_timeserver_changed(struct connman_service *service,
881                 GSList *ts_list);
882 void __connman_service_set_pac(struct connman_service *service,
883                                         const char *pac);
884 #if defined TIZEN_EXT
885 /*
886  * Returns profile count if there is any connected profiles
887  * that use same interface
888  */
889 int __connman_service_get_connected_count_of_iface(struct connman_service *service);
890 void __connman_service_set_proxy(struct connman_service *service,
891                                        const char *proxies);
892 int check_passphrase_ext(struct connman_network *network,
893                                         const char *passphrase);
894 #endif
895 bool __connman_service_is_hidden(struct connman_service *service);
896 bool __connman_service_is_split_routing(struct connman_service *service);
897 bool __connman_service_index_is_split_routing(int index);
898 int __connman_service_get_index(struct connman_service *service);
899 void __connman_service_set_hidden(struct connman_service *service);
900 void __connman_service_set_hostname(struct connman_service *service,
901                                                 const char *hostname);
902 const char *__connman_service_get_hostname(struct connman_service *service);
903 void __connman_service_set_domainname(struct connman_service *service,
904                                                 const char *domainname);
905 const char *__connman_service_get_nameserver(struct connman_service *service);
906 void __connman_service_set_proxy_autoconfig(struct connman_service *service,
907                                                         const char *url);
908
909 void __connman_service_set_identity(struct connman_service *service,
910                                         const char *identity);
911 void __connman_service_set_anonymous_identity(struct connman_service *service,
912                                         const char *anonymous_identity);
913 void __connman_service_set_subject_match(struct connman_service *service,
914                                         const char *subject_match);
915 void __connman_service_set_altsubject_match(struct connman_service *service,
916                                         const char *altsubject_match);
917 void __connman_service_set_domain_suffix_match(struct connman_service *service,
918                                         const char *domain_suffix_match);
919 void __connman_service_set_domain_match(struct connman_service *service,
920                                         const char *domain_match);
921 void __connman_service_set_agent_identity(struct connman_service *service,
922                                                 const char *agent_identity);
923 int __connman_service_set_passphrase(struct connman_service *service,
924                                         const char *passphrase);
925 const char *__connman_service_get_passphrase(struct connman_service *service);
926 int __connman_service_check_passphrase(enum connman_service_security security,
927                                         const char *passphrase);
928 int __connman_service_reset_ipconfig(struct connman_service *service,
929                 enum connman_ipconfig_type type, DBusMessageIter *array,
930                 enum connman_service_state *new_state);
931
932 void __connman_service_notify(struct connman_service *service,
933                         unsigned int rx_packets, unsigned int tx_packets,
934                         unsigned int rx_bytes, unsigned int tx_bytes,
935                         unsigned int rx_error, unsigned int tx_error,
936                         unsigned int rx_dropped, unsigned int tx_dropped);
937
938 int __connman_service_counter_register(const char *counter);
939 void __connman_service_counter_unregister(const char *counter);
940
941 #include <connman/peer.h>
942
943 int __connman_peer_init(void);
944 void __connman_peer_cleanup(void);
945
946 void __connman_peer_list_struct(DBusMessageIter *array);
947 const char *__connman_peer_get_path(struct connman_peer *peer);
948 void __connman_peer_disconnect_all(void);
949
950 int __connman_peer_service_init(void);
951 void __connman_peer_service_cleanup(void);
952
953 void __connman_peer_service_set_driver(struct connman_peer_driver *driver);
954 int __connman_peer_service_register(const char *owner, DBusMessage *msg,
955                                         const unsigned char *specification,
956                                         int specification_length,
957                                         const unsigned char *query,
958                                         int query_length, int version,
959                                         bool master);
960 int __connman_peer_service_unregister(const char *owner,
961                                         const unsigned char *specification,
962                                         int specification_length,
963                                         const unsigned char *query,
964                                         int query_length, int version);
965
966 #if defined TIZEN_EXT_WIFI_MESH
967 #include <connman/mesh.h>
968
969 int __connman_mesh_init(void);
970 void __connman_mesh_cleanup(void);
971 bool __connman_technology_get_connected(enum connman_service_type type);
972 void __connman_technology_mesh_interface_create_finished(
973                                                 enum connman_service_type type, bool success,
974                                                 const char *error);
975 void __connman_technology_mesh_interface_remove_finished(
976                                                 enum connman_service_type type, bool success);
977 void __connman_mesh_peer_list_struct(DBusMessageIter *array);
978 void __connman_mesh_connected_peer_list_struct(DBusMessageIter *array);
979 void __connman_mesh_disconnected_peer_list_struct(DBusMessageIter *array);
980 int __connman_mesh_dhcp_start(struct connman_ipconfig *ipconfig,
981                         dhcp_cb callback, gpointer user_data);
982 int __connman_device_abort_scan(enum connman_service_type type);
983 void __connman_technology_notify_abort_scan(enum connman_service_type type,
984                                                 int result);
985 int __connman_device_request_mesh_specific_scan(enum connman_service_type type,
986                                 const char *name, unsigned int freq);
987 void __connman_mesh_auto_connect(void);
988 #endif /* TIZEN_EXT_WIFI_MESH */
989
990 #include <connman/session.h>
991
992 void __connman_service_mark_dirty();
993 void __connman_service_save(struct connman_service *service);
994
995 #include <connman/notifier.h>
996
997 int __connman_technology_init(void);
998 void __connman_technology_cleanup(void);
999
1000 int __connman_notifier_init(void);
1001 void __connman_notifier_cleanup(void);
1002
1003 void __connman_notifier_service_add(struct connman_service *service,
1004                                         const char *name);
1005 void __connman_notifier_service_remove(struct connman_service *service);
1006 void __connman_notifier_enter_online(enum connman_service_type type);
1007 void __connman_notifier_leave_online(enum connman_service_type type);
1008 void __connman_notifier_connect(enum connman_service_type type);
1009 void __connman_notifier_disconnect(enum connman_service_type type);
1010 void __connman_notifier_offlinemode(bool enabled);
1011 void __connman_notifier_default_changed(struct connman_service *service);
1012 void __connman_notifier_proxy_changed(struct connman_service *service);
1013 void __connman_notifier_service_state_changed(struct connman_service *service,
1014                                         enum connman_service_state state);
1015 void __connman_notifier_ipconfig_changed(struct connman_service *service,
1016                                         struct connman_ipconfig *ipconfig);
1017
1018 bool __connman_notifier_is_connected(void);
1019 const char *__connman_notifier_get_state(void);
1020
1021 #include <connman/rtnl.h>
1022
1023 #if defined TIZEN_EXT
1024 int __connman_rtnl_init(int retry_count);
1025 #else
1026 int __connman_rtnl_init(void);
1027 #endif
1028 void __connman_rtnl_start(void);
1029 void __connman_rtnl_cleanup(void);
1030
1031 #if defined TIZEN_EXT
1032 void __connman_wifi_vsie_list_struct(DBusMessageIter *iter);
1033 #endif
1034
1035 enum connman_device_type __connman_rtnl_get_device_type(int index);
1036 unsigned int __connman_rtnl_update_interval_add(unsigned int interval);
1037 unsigned int __connman_rtnl_update_interval_remove(unsigned int interval);
1038 int __connman_rtnl_request_update(void);
1039 int __connman_rtnl_send(const void *buf, size_t len);
1040
1041 #if defined TIZEN_EXT
1042 void rtnl_nameserver_add_all(struct connman_service *service,
1043                         enum connman_ipconfig_type type);
1044 #endif
1045
1046 bool __connman_session_policy_autoconnect(enum connman_service_connect_reason reason);
1047
1048 int __connman_session_create(DBusMessage *msg);
1049 int __connman_session_destroy(DBusMessage *msg);
1050
1051 int __connman_session_init(void);
1052 void __connman_session_cleanup(void);
1053
1054 struct connman_stats_data {
1055         unsigned int rx_packets;
1056         unsigned int tx_packets;
1057         unsigned int rx_bytes;
1058         unsigned int tx_bytes;
1059         unsigned int rx_errors;
1060         unsigned int tx_errors;
1061         unsigned int rx_dropped;
1062         unsigned int tx_dropped;
1063         unsigned int time;
1064 };
1065
1066 int __connman_stats_init(void);
1067 void __connman_stats_cleanup(void);
1068 int __connman_stats_service_register(struct connman_service *service);
1069 void __connman_stats_service_unregister(struct connman_service *service);
1070 int  __connman_stats_update(struct connman_service *service,
1071                                 bool roaming,
1072                                 struct connman_stats_data *data);
1073 int __connman_stats_get(struct connman_service *service,
1074                                 bool roaming,
1075                                 struct connman_stats_data *data);
1076
1077 int __connman_iptables_dump(int type,
1078                                 const char *table_name);
1079 int __connman_iptables_new_chain(int type,
1080                                 const char *table_name,
1081                                 const char *chain);
1082 int __connman_iptables_delete_chain(int type,
1083                                 const char *table_name,
1084                                 const char *chain);
1085 int __connman_iptables_flush_chain(int type,
1086                                 const char *table_name,
1087                                 const char *chain);
1088 int __connman_iptables_find_chain(int type,
1089                                 const char *table_name,
1090                                 const char *chain);
1091 int __connman_iptables_change_policy(int type,
1092                                 const char *table_name,
1093                                 const char *chain,
1094                                 const char *policy);
1095 int __connman_iptables_append(int type,
1096                                 const char *table_name,
1097                                 const char *chain,
1098                                 const char *rule_spec);
1099 int __connman_iptables_insert(int type,
1100                                 const char *table_name,
1101                                 const char *chain,
1102                                 const char *rule_spec);
1103 int __connman_iptables_delete(int type,
1104                                 const char *table_name,
1105                                 const char *chain,
1106                                 const char *rule_spec);
1107
1108 typedef void (*connman_iptables_iterate_chains_cb_t) (const char *chain_name,
1109                                                         void *user_data);
1110 int __connman_iptables_iterate_chains(int type,
1111                                 const char *table_name,
1112                                 connman_iptables_iterate_chains_cb_t cb,
1113                                 void *user_data);
1114
1115 int __connman_iptables_init(void);
1116 void __connman_iptables_cleanup(void);
1117 int __connman_iptables_commit(int type, const char *table_name);
1118
1119 int __connman_dnsproxy_init(void);
1120 void __connman_dnsproxy_cleanup(void);
1121 int __connman_dnsproxy_add_listener(int index);
1122 void __connman_dnsproxy_remove_listener(int index);
1123 int __connman_dnsproxy_append(int index, const char *domain, const char *server);
1124 int __connman_dnsproxy_remove(int index, const char *domain, const char *server);
1125 int __connman_dnsproxy_set_mdns(int index, bool enabled);
1126
1127 int __connman_6to4_probe(struct connman_service *service);
1128 void __connman_6to4_remove(struct connman_ipconfig *ipconfig);
1129 int __connman_6to4_check(struct connman_ipconfig *ipconfig);
1130
1131 struct connman_ippool;
1132
1133 typedef void (*ippool_collision_cb_t) (struct connman_ippool *pool,
1134                                         void *user_data);
1135
1136 int __connman_ippool_init(void);
1137 void __connman_ippool_cleanup(void);
1138
1139 void __connman_ippool_free(struct connman_ippool *pool);
1140
1141 struct connman_ippool *__connman_ippool_create(int index,
1142                                         unsigned int start,
1143                                         unsigned int range,
1144                                         ippool_collision_cb_t collision_cb,
1145                                         void *user_data);
1146
1147 const char *__connman_ippool_get_gateway(struct connman_ippool *pool);
1148 const char *__connman_ippool_get_broadcast(struct connman_ippool *pool);
1149 const char *__connman_ippool_get_subnet_mask(struct connman_ippool *pool);
1150 const char *__connman_ippool_get_start_ip(struct connman_ippool *pool);
1151 const char *__connman_ippool_get_end_ip(struct connman_ippool *pool);
1152
1153 void __connman_ippool_newaddr(int index, const char *address,
1154                                 unsigned char prefixlen);
1155 void __connman_ippool_deladdr(int index, const char *address,
1156                                 unsigned char prefixlen);
1157
1158 int __connman_bridge_create(const char *name);
1159 int __connman_bridge_remove(const char *name);
1160 int __connman_bridge_enable(const char *name, const char *ip_address,
1161                         int prefix_len, const char *broadcast);
1162 int __connman_bridge_disable(const char *name);
1163
1164 int __connman_nat_init(void);
1165 void __connman_nat_cleanup(void);
1166
1167 int __connman_nat_enable(const char *name, const char *address,
1168                                 unsigned char prefixlen);
1169 void __connman_nat_disable(const char *name);
1170
1171 struct firewall_context;
1172
1173 struct firewall_context *__connman_firewall_create(void);
1174 void __connman_firewall_destroy(struct firewall_context *ctx);
1175 int __connman_firewall_enable_nat(struct firewall_context *ctx,
1176                                         char *address, unsigned char prefixlen,
1177                                         char *interface);
1178 int __connman_firewall_disable_nat(struct firewall_context *ctx);
1179 int __connman_firewall_enable_snat(struct firewall_context *ctx,
1180                                 int index, const char *ifname,
1181                                 const char *addr);
1182 int __connman_firewall_disable_snat(struct firewall_context *ctx);
1183 int __connman_firewall_enable_marking(struct firewall_context *ctx,
1184                                         enum connman_session_id_type id_type,
1185                                         char *id, const char *src_ip,
1186                                         uint32_t mark);
1187 int __connman_firewall_disable_marking(struct firewall_context *ctx);
1188
1189 int __connman_firewall_init(void);
1190 void __connman_firewall_cleanup(void);
1191
1192 typedef int (* connman_nfacct_flush_cb_t) (unsigned int error, void *user_data);
1193
1194 int __connman_nfacct_flush(connman_nfacct_flush_cb_t cb, void *user_data);
1195
1196 struct nfacct_context;
1197
1198 typedef void (* connman_nfacct_enable_cb_t) (unsigned int error,
1199                                                 struct nfacct_context *ctx,
1200                                                 void *user_data);
1201 typedef void (* connman_nfacct_disable_cb_t) (unsigned int error,
1202                                                 struct nfacct_context *ctx,
1203                                                 void *user_data);
1204 typedef void (* connman_nfacct_stats_cb_t) (struct nfacct_context *ctx,
1205                                                 uint64_t packets,
1206                                                 uint64_t bytes,
1207                                                 void *user_data);
1208
1209 struct nfacct_context *__connman_nfacct_create_context(void);
1210 void __connman_nfacct_destroy_context(struct nfacct_context *ctx);
1211
1212 int __connman_nfacct_add(struct nfacct_context *ctx, const char *name,
1213                                 connman_nfacct_stats_cb_t cb,
1214                                 void *user_data);
1215 int __connman_nfacct_enable(struct nfacct_context *ctx,
1216                                 connman_nfacct_enable_cb_t cb,
1217                                 void *user_data);
1218 int __connman_nfacct_disable(struct nfacct_context *ctx,
1219                                 connman_nfacct_disable_cb_t cb,
1220                                 void *user_data);
1221
1222 void __connman_nfacct_cleanup(void);
1223
1224 #include <connman/machine.h>
1225
1226 int __connman_machine_init(void);
1227 void __connman_machine_cleanup(void);
1228
1229 int __connman_util_get_random(uint64_t *val);
1230 unsigned int __connman_util_random_delay_ms(unsigned int secs);
1231 int __connman_util_init(void);
1232 void __connman_util_cleanup(void);
1233
1234 #ifdef TIZEN_EXT
1235 __attribute__ ((unused)) static int __tizentvextension = -1;
1236 #define TIZEN_TV_EXT (__builtin_expect(__tizentvextension != -1, 1) ? \
1237         __tizentvextension : \
1238         (__tizentvextension = connman_setting_get_bool("TizenTVExtension")))
1239 #else /* TIZEN_EXT */
1240 #define TIZEN_TV_EXT (0) /* Always False */
1241 #endif /* TIZEN_EXT */