DA: Fix build warnings
[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/setting.h>
154
155 #include <connman/plugin.h>
156
157 int __connman_plugin_init(const char *pattern, const char *exclude);
158 void __connman_plugin_cleanup(void);
159
160 #include <connman/task.h>
161
162 int __connman_task_init(void);
163 void __connman_task_cleanup(void);
164
165 #include <connman/inet.h>
166
167 char **__connman_inet_get_running_interfaces(void);
168 int __connman_inet_modify_address(int cmd, int flags, int index, int family,
169                                 const char *address,
170                                 const char *peer,
171                                 unsigned char prefixlen,
172                                 const char *broadcast,
173                                 bool is_p2p);
174 int __connman_inet_get_interface_address(int index, int family, void *address);
175 int __connman_inet_get_interface_ll_address(int index, int family, void *address);
176 int __connman_inet_get_interface_mac_address(int index, uint8_t *mac_address);
177
178 bool __connman_inet_is_any_addr(const char *address, int family);
179
180 #include <netinet/ip6.h>
181 #include <netinet/icmp6.h>
182
183 typedef void (*__connman_inet_rs_cb_t) (struct nd_router_advert *reply,
184                                         unsigned int length, void *user_data);
185
186 int __connman_inet_ipv6_send_rs(int index, int timeout,
187                         __connman_inet_rs_cb_t callback, void *user_data);
188 int __connman_inet_ipv6_send_ra(int index, struct in6_addr *src_addr,
189                                 GSList *prefixes, int router_lifetime);
190 #if defined TIZEN_EXT
191 void __connman_network_set_auto_ipv6_gateway(char *gateway, void *user_data);
192 #endif
193
194 typedef void (*__connman_inet_ns_cb_t) (struct nd_neighbor_advert *reply,
195                                         unsigned int length,
196                                         struct in6_addr *addr,
197                                         void *user_data);
198 int __connman_inet_ipv6_do_dad(int index, int timeout_ms,
199                         struct in6_addr *addr,
200                         __connman_inet_ns_cb_t callback, void *user_data);
201
202 typedef void (*__connman_inet_recv_rs_cb_t) (struct nd_router_solicit *reply,
203                                         unsigned int length, void *user_data);
204 int __connman_inet_ipv6_start_recv_rs(int index,
205                                 __connman_inet_recv_rs_cb_t callback,
206                                 void *user_data, void **context);
207 void __connman_inet_ipv6_stop_recv_rs(void *context);
208
209 int __connman_network_refresh_rs_ipv6(struct connman_network *network, int index);
210
211 GSList *__connman_inet_ipv6_get_prefixes(struct nd_router_advert *hdr,
212                                         unsigned int length);
213 typedef void (*connman_inet_addr_cb_t) (const char *src_address, int index,
214                                         void *user_data);
215 int __connman_inet_get_route(const char *dst_address,
216                         connman_inet_addr_cb_t callback, void *user_data);
217
218 struct __connman_inet_rtnl_handle {
219         int                     fd;
220         struct sockaddr_nl      local;
221         struct sockaddr_nl      peer;
222         __u32                   seq;
223         __u32                   dump;
224
225         struct {
226                 struct nlmsghdr n;
227                 union {
228                         struct {
229                                 struct rtmsg rt;
230                         } r;
231                         struct {
232                                 struct ifaddrmsg ifa;
233                         } i;
234                 } u;
235                 char buf[1024];
236         } req;
237 };
238
239 int __connman_inet_rtnl_open(struct __connman_inet_rtnl_handle *rth);
240 typedef void (*__connman_inet_rtnl_cb_t) (struct nlmsghdr *answer,
241                                         void *user_data);
242 int __connman_inet_rtnl_talk(struct __connman_inet_rtnl_handle *rtnl,
243                         struct nlmsghdr *n, int timeout,
244                         __connman_inet_rtnl_cb_t callback, void *user_data);
245 static inline
246 int __connman_inet_rtnl_send(struct __connman_inet_rtnl_handle *rtnl,
247                                                 struct nlmsghdr *n)
248 {
249         return __connman_inet_rtnl_talk(rtnl, n, 0, NULL, NULL);
250 }
251
252 void __connman_inet_rtnl_close(struct __connman_inet_rtnl_handle *rth);
253 int __connman_inet_rtnl_addattr_l(struct nlmsghdr *n, size_t max_length,
254                         int type, const void *data, size_t data_length);
255 int __connman_inet_rtnl_addattr32(struct nlmsghdr *n, size_t maxlen,
256                         int type, __u32 data);
257
258 int __connman_inet_add_fwmark_rule(uint32_t table_id, int family, uint32_t fwmark);
259 int __connman_inet_del_fwmark_rule(uint32_t table_id, int family, uint32_t fwmark);
260 int __connman_inet_add_default_to_table(uint32_t table_id, int ifindex, const char *gateway);
261 int __connman_inet_add_subnet_to_table(uint32_t table_id, int ifindex,
262                         const char *gateway, unsigned char prefixlen);
263 int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex, const char *gateway);
264 int __connman_inet_del_subnet_from_table(uint32_t table_id, int ifindex,
265                         const char *gateway, unsigned char prefixlen);
266 int __connman_inet_get_address_netmask(int ifindex,
267                 struct sockaddr_in *address, struct sockaddr_in *netmask);
268
269 bool __connman_inet_isrootnfs_device(const char *devname);
270 char **__connman_inet_get_pnp_nameservers(const char *pnp_file);
271
272 #include <connman/resolver.h>
273
274 int __connman_resolver_init(gboolean dnsproxy);
275 void __connman_resolver_cleanup(void);
276 void __connman_resolver_append_fallback_nameservers(void);
277 int __connman_resolvfile_append(int index, const char *domain, const char *server);
278 int __connman_resolvfile_remove(int index, const char *domain, const char *server);
279 int __connman_resolver_redo_servers(int index);
280 int __connman_resolver_set_mdns(int index, bool enabled);
281
282 GKeyFile *__connman_storage_open_global(void);
283 GKeyFile *__connman_storage_load_global(void);
284 int __connman_storage_save_global(GKeyFile *keyfile);
285 void __connman_storage_delete_global(void);
286 #if defined TIZEN_EXT
287 GKeyFile *__connman_storage_load_ins(void);
288 int __connman_storage_save_ins(GKeyFile *keyfile);
289 #endif
290
291 GKeyFile *__connman_storage_load_config(const char *ident);
292 GKeyFile *__connman_storage_load_provider_config(const char *ident);
293
294 int __connman_storage_save_service(GKeyFile *keyfile, const char *ident);
295 GKeyFile *__connman_storage_load_provider(const char *identifier);
296 void __connman_storage_save_provider(GKeyFile *keyfile, const char *identifier);
297 bool __connman_storage_remove_provider(const char *identifier);
298 char **__connman_storage_get_providers(void);
299 bool __connman_storage_remove_service(const char *service_id);
300
301 int __connman_detect_init(void);
302 void __connman_detect_cleanup(void);
303
304 #include <connman/inotify.h>
305
306 int __connman_inotify_init(void);
307 void __connman_inotify_cleanup(void);
308
309 #include <connman/proxy.h>
310
311 int __connman_proxy_init(void);
312 void __connman_proxy_cleanup(void);
313
314 #include <connman/ipconfig.h>
315
316 struct connman_ipaddress {
317         int family;
318         unsigned char prefixlen;
319         char *local;
320         char *peer;
321         char *broadcast;
322         char *gateway;
323         bool is_p2p; /* P2P connection or VPN, broadcast is excluded. */
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 void __connman_timeserver_sync(struct connman_service *service);
485 void __connman_timeserver_conf_update(struct connman_service *service);
486
487 bool __connman_timeserver_is_synced(void);
488 void __connman_timeserver_set_synced(bool status);
489
490 enum __connman_dhcpv6_status {
491         CONNMAN_DHCPV6_STATUS_FAIL     = 0,
492         CONNMAN_DHCPV6_STATUS_SUCCEED  = 1,
493         CONNMAN_DHCPV6_STATUS_RESTART  = 2,
494 };
495
496 #if defined TIZEN_EXT
497 void set_dhcp_discover_timeout(int timeout_value);
498 void set_dhcp_discover_retry_count(int retry_count);
499 #endif
500
501 typedef void (* dhcpv6_cb) (struct connman_network *network,
502                         enum __connman_dhcpv6_status status, gpointer data);
503
504 typedef void (* dhcp_cb) (struct connman_ipconfig *ipconfig,
505                         struct connman_network *opt_network,
506                         bool success, gpointer data);
507 char *__connman_dhcp_get_server_address(struct connman_ipconfig *ipconfig);
508 int __connman_dhcp_start(struct connman_ipconfig *ipconfig,
509                         struct connman_network *network, dhcp_cb callback,
510                         gpointer user_data);
511 void __connman_dhcp_stop(struct connman_ipconfig *ipconfig);
512 void __connman_dhcp_decline(struct connman_ipconfig *ipconfig);
513 int __connman_dhcp_init(void);
514 void __connman_dhcp_cleanup(void);
515 int __connman_dhcpv6_init(void);
516 void __connman_dhcpv6_cleanup(void);
517 int __connman_dhcpv6_start_info(struct connman_network *network,
518                                 dhcpv6_cb callback);
519 void __connman_dhcpv6_stop(struct connman_network *network);
520 int __connman_dhcpv6_start(struct connman_network *network,
521                                 GSList *prefixes, dhcpv6_cb callback);
522 int __connman_dhcpv6_start_renew(struct connman_network *network,
523                                 dhcpv6_cb callback);
524 int __connman_dhcpv6_start_release(struct connman_network *network,
525                                 dhcpv6_cb callback);
526 int __connman_dhcpv6_start_pd(int index, GSList *prefixes, dhcpv6_cb callback);
527 void __connman_dhcpv6_stop_pd(int index);
528 int __connman_dhcpv6_start_pd_renew(struct connman_network *network,
529                                                         dhcpv6_cb callback);
530 int __connman_dhcpv6_start_pd_release(struct connman_network *network,
531                                 dhcpv6_cb callback);
532
533 int __connman_ipv4_init(void);
534 void __connman_ipv4_cleanup(void);
535
536 int __connman_connection_init(void);
537 void __connman_connection_cleanup(void);
538
539 int __connman_connection_gateway_add(struct connman_service *service,
540                                         const char *gateway,
541                                         enum connman_ipconfig_type type,
542                                         const char *peer);
543 void __connman_connection_gateway_remove(struct connman_service *service,
544                                         enum connman_ipconfig_type type);
545 int __connman_connection_get_vpn_index(int phy_index);
546 int __connman_connection_get_vpn_phy_index(int vpn_index);
547
548 bool __connman_connection_update_gateway(void);
549
550 typedef void (*__connman_ntp_cb_t) (bool success, void *user_data);
551 int __connman_ntp_start(char *server, __connman_ntp_cb_t callback,
552                         void *user_data);
553 void __connman_ntp_stop();
554
555 int __connman_wpad_init(void);
556 void __connman_wpad_cleanup(void);
557 int __connman_wpad_start(struct connman_service *service);
558 void __connman_wpad_stop(struct connman_service *service);
559
560 int __connman_wispr_init(void);
561 void __connman_wispr_cleanup(void);
562 int __connman_wispr_start(struct connman_service *service,
563                                         enum connman_ipconfig_type type);
564 void __connman_wispr_stop(struct connman_service *service);
565
566 #include <connman/technology.h>
567
568 void __connman_technology_list_struct(DBusMessageIter *array);
569
570 int __connman_technology_add_device(struct connman_device *device);
571 int __connman_technology_remove_device(struct connman_device *device);
572 int __connman_technology_enabled(enum connman_service_type type);
573 int __connman_technology_disabled(enum connman_service_type type);
574 int __connman_technology_set_offlinemode(bool offlinemode);
575 bool __connman_technology_get_offlinemode(void);
576 void __connman_technology_set_connected(enum connman_service_type type,
577                                         bool connected);
578
579 int __connman_technology_add_rfkill(unsigned int index,
580                                         enum connman_service_type type,
581                                                 bool softblock,
582                                                 bool hardblock);
583 int __connman_technology_update_rfkill(unsigned int index,
584                                         enum connman_service_type type,
585                                                 bool softblock,
586                                                 bool hardblock);
587 int __connman_technology_remove_rfkill(unsigned int index,
588                                         enum connman_service_type type);
589
590 void __connman_technology_scan_started(struct connman_device *device);
591 void __connman_technology_scan_stopped(struct connman_device *device,
592                                         enum connman_service_type type);
593 void __connman_technology_add_interface(enum connman_service_type type,
594                                 int index, const char *ident);
595 void __connman_technology_remove_interface(enum connman_service_type type,
596                                 int index, const char *ident);
597 void __connman_technology_notify_regdom_by_device(struct connman_device *device,
598                                                 int result, const char *alpha2);
599
600 #if defined TIZEN_EXT
601 void __connman_technology_notify_mac_policy_by_device(struct connman_device *device,
602                                                 int result, unsigned int policy);
603 void __connman_technology_notify_preassoc_mac_policy_by_device(struct connman_device *device,
604                                                 int result, unsigned int policy);
605 void __connman_technology_notify_random_mac_lifetime_by_device(struct connman_device *device,
606                                                 int result, unsigned int lifetime);
607
608 enum bssid_type {
609         CHECK_BSSID = 0,
610         GET_BSSID   = 1,
611         SET_BSSID   = 2,
612         RESET_BSSID = 3,
613 };
614
615 int set_connman_bssid(enum bssid_type mode, char *bssid, const char *ifname);
616 void technology_save_device(struct connman_device *device);
617 #endif
618
619 #include <connman/device.h>
620
621 int __connman_device_init(const char *device, const char *nodevice);
622 void __connman_device_cleanup(void);
623
624 void __connman_device_list(DBusMessageIter *iter, void *user_data);
625
626 enum connman_service_type __connman_device_get_service_type(struct connman_device *device);
627 struct connman_device *__connman_device_find_device(enum connman_service_type type);
628 int __connman_device_request_scan(enum connman_service_type type);
629 int __connman_device_request_scan_full(enum connman_service_type type);
630 int __connman_device_request_hidden_scan(struct connman_device *device,
631                                 const char *ssid, unsigned int ssid_len,
632                                 const char *identity, const char *passphrase,
633                                 const char *security, void *user_data);
634 void __connman_device_stop_scan(enum connman_service_type type);
635 #if defined TIZEN_EXT
636 int __connman_device_request_specific_scan(enum connman_service_type type,
637                                 const char *ifname, int scan_type, GSList *specific_scan_list);
638 int connman_device_request_device_scan(enum connman_service_type type,
639                                 const char * ifname, bool force_full_scan);
640 #endif
641
642 bool __connman_device_isfiltered(const char *devname);
643
644 void __connman_device_set_network(struct connman_device *device,
645                                         struct connman_network *network);
646 void __connman_device_cleanup_networks(struct connman_device *device);
647
648 int __connman_device_enable(struct connman_device *device);
649 int __connman_device_disable(struct connman_device *device);
650 int __connman_device_disconnect(struct connman_device *device);
651
652 bool __connman_device_has_driver(struct connman_device *device);
653
654 const char *__connman_device_get_type(struct connman_device *device);
655
656 int __connman_rfkill_init(void);
657 void __connman_rfkill_cleanup(void);
658 int __connman_rfkill_block(enum connman_service_type type, bool block);
659
660 #if defined TIZEN_EXT
661 char *index2ident(int index, const char *prefix);
662 char *index2addr(int index);
663 char *_get_wifi_ident(void);
664 char *_get_wifi_addr(void);
665 #endif
666
667 #include <connman/network.h>
668
669 int __connman_network_init(void);
670 void __connman_network_cleanup(void);
671
672 void __connman_network_set_device(struct connman_network *network,
673                                         struct connman_device *device);
674
675 int __connman_network_connect(struct connman_network *network);
676 int __connman_network_disconnect(struct connman_network *network);
677 int __connman_network_clear_ipconfig(struct connman_network *network,
678                                         struct connman_ipconfig *ipconfig);
679 int __connman_network_enable_ipconfig(struct connman_network *network,
680                                 struct connman_ipconfig *ipconfig);
681
682 const char *__connman_network_get_type(struct connman_network *network);
683 const char *__connman_network_get_group(struct connman_network *network);
684 const char *__connman_network_get_ident(struct connman_network *network);
685 bool __connman_network_get_weakness(struct connman_network *network);
686 bool __connman_network_native_autoconnect(struct connman_network *network);
687 #if defined TIZEN_EXT
688 dbus_bool_t __connman_network_notify_dhcp_changed(const char *key, void *val);
689 bool connman_network_get_psk_sha256(struct connman_network *network);
690 void connman_network_set_psk_sha256(struct connman_network *network, bool is_psk_sha256);
691 #endif
692
693 int __connman_config_init();
694 void __connman_config_cleanup(void);
695
696 int __connman_config_load_service(GKeyFile *keyfile, const char *group,
697                                   bool persistent);
698 int __connman_config_provision_service(struct connman_service *service);
699 int __connman_config_provision_service_ident(struct connman_service *service,
700                 const char *ident, const char *file, const char *entry);
701
702 char *__connman_config_get_string(GKeyFile *key_file,
703         const char *group_name, const char *key, GError **error);
704
705 char **__connman_config_get_string_list(GKeyFile *key_file,
706         const char *group_name, const char *key, gsize *length, GError **error);
707
708 bool __connman_config_get_bool(GKeyFile *key_file,
709         const char *group_name, const char *key, GError **error);
710 bool __connman_config_address_provisioned(const char *address,
711                                         const char *netmask);
712
713 #include <connman/tethering.h>
714
715 int __connman_tethering_init(void);
716 void __connman_tethering_cleanup(void);
717
718 const char *__connman_tethering_get_bridge(void);
719 int __connman_tethering_set_enabled(void);
720 void __connman_tethering_set_disabled(void);
721 void __connman_tethering_list_clients(DBusMessageIter *array);
722
723 int __connman_private_network_request(DBusMessage *msg, const char *owner);
724 int __connman_private_network_release(const char *path);
725
726 int __connman_ipv6pd_setup(const char *bridge);
727 void __connman_ipv6pd_cleanup(void);
728
729 #include <connman/provider.h>
730
731 bool __connman_provider_check_routes(struct connman_provider *provider);
732 int __connman_provider_append_user_route(struct connman_provider *provider,
733                         int family, const char *network, const char *netmask);
734 void __connman_provider_append_properties(struct connman_provider *provider, DBusMessageIter *iter);
735 void __connman_provider_list(DBusMessageIter *iter, void *user_data);
736 bool __connman_provider_is_immutable(struct connman_provider *provider);
737 int __connman_provider_create_and_connect(DBusMessage *msg);
738 const char * __connman_provider_get_ident(struct connman_provider *provider);
739 const char * __connman_provider_get_transport_ident(
740                                         struct connman_provider *provider);
741 int __connman_provider_indicate_state(struct connman_provider *provider,
742                                         enum connman_provider_state state);
743 int __connman_provider_indicate_error(struct connman_provider *provider,
744                                         enum connman_provider_error error);
745 int __connman_provider_connect(struct connman_provider *provider,
746                                         const char *dbus_sender);
747 int __connman_provider_remove_by_path(const char *path);
748 void __connman_provider_cleanup(void);
749 int __connman_provider_init(void);
750
751 #include <connman/service.h>
752
753 int __connman_service_init(void);
754 void __connman_service_cleanup(void);
755 int __connman_service_move(struct connman_service *service,
756                                 struct connman_service *target, bool before);
757 int __connman_service_load_modifiable(struct connman_service *service);
758
759 void __connman_service_list_struct(DBusMessageIter *iter);
760 #if defined TIZEN_EXT_INS
761 void __connman_ins_list_struct(DBusMessageIter *iter);
762 #endif
763
764 #if defined TIZEN_EXT
765 int connman_service_get_ipv6_dns_method(struct connman_service *service);
766 enum connman_dnsconfig_method {
767         CONNMAN_DNSCONFIG_METHOD_UNKNOWN = 0,
768         CONNMAN_DNSCONFIG_METHOD_MANUAL  = 1,
769         CONNMAN_DNSCONFIG_METHOD_DHCP    = 2,
770 };
771 #endif
772
773 int __connman_service_compare(const struct connman_service *a,
774                                         const struct connman_service *b);
775
776 struct connman_service *__connman_service_lookup_from_index(int index);
777 struct connman_service *__connman_service_create_from_network(struct connman_network *network);
778 struct connman_service *__connman_service_create_from_provider(struct connman_provider *provider);
779 bool __connman_service_index_is_default(int index);
780 #if defined TIZEN_EXT
781 void __connman_service_notify_strength_changed(struct connman_network *network);
782 #endif
783 void __connman_service_update_from_network(struct connman_network *network);
784 void __connman_service_remove_from_network(struct connman_network *network);
785 void __connman_service_read_ip4config(struct connman_service *service);
786 void __connman_service_read_ip6config(struct connman_service *service);
787
788 struct connman_ipconfig *__connman_service_get_ip4config(
789                                 struct connman_service *service);
790 struct connman_ipconfig *__connman_service_get_ip6config(
791                                 struct connman_service *service);
792 struct connman_ipconfig *__connman_service_get_ipconfig(
793                                 struct connman_service *service, int family);
794 void __connman_service_notify_ipv4_configuration(
795                                 struct connman_service *service);
796 void __connman_service_wispr_start(struct connman_service *service,
797                                 enum connman_ipconfig_type type);
798 bool __connman_service_is_connected_state(struct connman_service *service,
799                                         enum connman_ipconfig_type type);
800 const char *__connman_service_get_path(struct connman_service *service);
801 const char *__connman_service_get_name(struct connman_service *service);
802 struct connman_network *__connman_service_get_network(struct connman_service *service);
803 enum connman_service_security __connman_service_get_security(struct connman_service *service);
804 const char *__connman_service_get_phase2(struct connman_service *service);
805 bool __connman_service_wps_enabled(struct connman_service *service);
806 #if defined TIZEN_EXT
807 void __connman_service_set_storage_reload(struct connman_service *service,
808                                                 bool storage_reload);
809 #endif
810 int __connman_service_set_favorite(struct connman_service *service,
811                                                 bool favorite);
812 int __connman_service_set_favorite_delayed(struct connman_service *service,
813                                         bool favorite,
814                                         bool delay_ordering);
815 int __connman_service_set_immutable(struct connman_service *service,
816                                                 bool immutable);
817 int __connman_service_set_ignore(struct connman_service *service,
818                                                 bool ignore);
819 void __connman_service_set_search_domains(struct connman_service *service,
820                                         char **domains);
821 int __connman_service_set_mdns(struct connman_service *service,
822                                         bool enabled);
823
824 void __connman_service_set_string(struct connman_service *service,
825                                         const char *key, const char *value);
826 void __connman_service_online_check(struct connman_service *service,
827                                         enum connman_ipconfig_type type,
828                                         bool success);
829 int __connman_service_ipconfig_indicate_state(struct connman_service *service,
830                                         enum connman_service_state new_state,
831                                         enum connman_ipconfig_type type);
832 enum connman_service_state __connman_service_ipconfig_get_state(
833                                         struct connman_service *service,
834                                         enum connman_ipconfig_type type);
835
836 #if defined TIZEN_EXT
837 void connman_check_proxy_setup_and_wispr_start(struct connman_service *service);
838 #endif
839
840 int __connman_service_indicate_error(struct connman_service *service,
841                                         enum connman_service_error error);
842 int __connman_service_clear_error(struct connman_service *service);
843 int __connman_service_indicate_default(struct connman_service *service);
844
845 int __connman_service_connect(struct connman_service *service,
846                         enum connman_service_connect_reason reason);
847 int __connman_service_disconnect(struct connman_service *service);
848 void __connman_service_set_active_session(bool enable, GSList *list);
849 void __connman_service_auto_connect(enum connman_service_connect_reason reason);
850
851 #if defined TIZEN_EXT
852 bool __connman_service_get_auto_connect_mode(void);
853 void __connman_service_set_auto_connect_mode(bool enable);
854 #endif
855
856 #if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
857 int __connman_service_get_use_eapol(struct connman_service *service);
858 int __connman_service_get_connect_reason(struct connman_service *service);
859 #endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
860
861 bool __connman_service_remove(struct connman_service *service);
862 bool __connman_service_is_provider_pending(struct connman_service *service);
863 void __connman_service_set_provider_pending(struct connman_service *service,
864                                                         DBusMessage *msg);
865 void __connman_service_set_hidden_data(struct connman_service *service,
866                                 gpointer user_data);
867 void __connman_service_return_error(struct connman_service *service,
868                                 int error, gpointer user_data);
869
870 int __connman_service_provision_changed(const char *ident);
871 void __connman_service_set_config(struct connman_service *service,
872                                 const char *file_id, const char *section);
873
874 const char *__connman_service_type2string(enum connman_service_type type);
875 enum connman_service_type __connman_service_string2type(const char *str);
876 enum connman_service_security __connman_service_string2security(const char *str);
877
878 #if defined TIZEN_EXT
879 int __connman_service_nameserver_append(struct connman_service *service,
880                                 const char *nameserver, bool is_auto,
881                                 enum connman_ipconfig_type type);
882 int __connman_service_nameserver_remove(struct connman_service *service,
883                                 const char *nameserver, bool is_auto,
884                                 enum connman_ipconfig_type type);
885 #else
886 int __connman_service_nameserver_append(struct connman_service *service,
887                                 const char *nameserver, bool is_auto);
888 int __connman_service_nameserver_remove(struct connman_service *service,
889                                 const char *nameserver, bool is_auto);
890 #endif
891 void __connman_service_nameserver_clear(struct connman_service *service);
892 void __connman_service_nameserver_add_routes(struct connman_service *service,
893                                                 const char *gw);
894 void __connman_service_nameserver_del_routes(struct connman_service *service,
895                                         enum connman_ipconfig_type type);
896 void __connman_service_set_timeservers(struct connman_service *service,
897                                                 char **timeservers);
898 int __connman_service_timeserver_append(struct connman_service *service,
899                                                 const char *timeserver);
900 int __connman_service_timeserver_remove(struct connman_service *service,
901                                                 const char *timeserver);
902 void __connman_service_timeserver_changed(struct connman_service *service,
903                 GSList *ts_list);
904 void __connman_service_set_pac(struct connman_service *service,
905                                         const char *pac);
906 #if defined TIZEN_EXT
907 /*
908  * Returns profile count if there is any connected profiles
909  * that use same interface
910  */
911 int __connman_service_get_connected_count_of_iface(struct connman_service *service);
912 void __connman_service_set_proxy(struct connman_service *service,
913                                        const char *proxies);
914 int check_passphrase_ext(struct connman_network *network,
915                                         const char *passphrase);
916 #endif
917 bool __connman_service_is_hidden(struct connman_service *service);
918 bool __connman_service_is_split_routing(struct connman_service *service);
919 bool __connman_service_index_is_split_routing(int index);
920 void __connman_service_set_split_routing(struct connman_service *service,
921                                                 bool split_routing);
922 void __connman_service_split_routing_changed(struct connman_service *service);
923 int __connman_service_get_index(struct connman_service *service);
924 void __connman_service_set_hidden(struct connman_service *service);
925 void __connman_service_set_hostname(struct connman_service *service,
926                                                 const char *hostname);
927 const char *__connman_service_get_hostname(struct connman_service *service);
928 void __connman_service_set_domainname(struct connman_service *service,
929                                                 const char *domainname);
930 const char *__connman_service_get_nameserver(struct connman_service *service);
931 void __connman_service_set_proxy_autoconfig(struct connman_service *service,
932                                                         const char *url);
933
934 void __connman_service_set_identity(struct connman_service *service,
935                                         const char *identity);
936 void __connman_service_set_anonymous_identity(struct connman_service *service,
937                                         const char *anonymous_identity);
938 void __connman_service_set_subject_match(struct connman_service *service,
939                                         const char *subject_match);
940 void __connman_service_set_altsubject_match(struct connman_service *service,
941                                         const char *altsubject_match);
942 void __connman_service_set_domain_suffix_match(struct connman_service *service,
943                                         const char *domain_suffix_match);
944 void __connman_service_set_domain_match(struct connman_service *service,
945                                         const char *domain_match);
946 void __connman_service_set_agent_identity(struct connman_service *service,
947                                                 const char *agent_identity);
948 int __connman_service_set_passphrase(struct connman_service *service,
949                                         const char *passphrase);
950 const char *__connman_service_get_passphrase(struct connman_service *service);
951 int __connman_service_check_passphrase(enum connman_service_security security,
952                                         const char *passphrase);
953 int __connman_service_reset_ipconfig(struct connman_service *service,
954                 enum connman_ipconfig_type type, DBusMessageIter *array,
955                 enum connman_service_state *new_state);
956
957 void __connman_service_notify(struct connman_service *service,
958                         unsigned int rx_packets, unsigned int tx_packets,
959                         unsigned int rx_bytes, unsigned int tx_bytes,
960                         unsigned int rx_error, unsigned int tx_error,
961                         unsigned int rx_dropped, unsigned int tx_dropped);
962
963 int __connman_service_counter_register(const char *counter);
964 void __connman_service_counter_unregister(const char *counter);
965
966 #include <connman/peer.h>
967
968 int __connman_peer_init(void);
969 void __connman_peer_cleanup(void);
970
971 void __connman_peer_list_struct(DBusMessageIter *array);
972 const char *__connman_peer_get_path(struct connman_peer *peer);
973 void __connman_peer_disconnect_all(void);
974
975 int __connman_peer_service_init(void);
976 void __connman_peer_service_cleanup(void);
977
978 void __connman_peer_service_set_driver(struct connman_peer_driver *driver);
979 int __connman_peer_service_register(const char *owner, DBusMessage *msg,
980                                         const unsigned char *specification,
981                                         int specification_length,
982                                         const unsigned char *query,
983                                         int query_length, int version,
984                                         bool master);
985 int __connman_peer_service_unregister(const char *owner,
986                                         const unsigned char *specification,
987                                         int specification_length,
988                                         const unsigned char *query,
989                                         int query_length, int version);
990
991 #if defined TIZEN_EXT_WIFI_MESH
992 #include <connman/mesh.h>
993
994 int __connman_mesh_init(void);
995 void __connman_mesh_cleanup(void);
996 bool __connman_technology_get_connected(enum connman_service_type type);
997 void __connman_technology_mesh_interface_create_finished(
998                                                 enum connman_service_type type, bool success,
999                                                 const char *error);
1000 void __connman_technology_mesh_interface_remove_finished(
1001                                                 enum connman_service_type type, bool success);
1002 void __connman_mesh_peer_list_struct(DBusMessageIter *array);
1003 void __connman_mesh_connected_peer_list_struct(DBusMessageIter *array);
1004 void __connman_mesh_disconnected_peer_list_struct(DBusMessageIter *array);
1005 int __connman_mesh_dhcp_start(struct connman_ipconfig *ipconfig,
1006                         dhcp_cb callback, gpointer user_data);
1007 int __connman_device_abort_scan(enum connman_service_type type);
1008 void __connman_technology_notify_abort_scan(enum connman_service_type type,
1009                                                 int result);
1010 int __connman_device_request_mesh_specific_scan(enum connman_service_type type,
1011                                 const char *name, unsigned int freq);
1012 void __connman_mesh_auto_connect(void);
1013 #endif /* TIZEN_EXT_WIFI_MESH */
1014
1015 #include <connman/session.h>
1016
1017 void __connman_service_mark_dirty();
1018 void __connman_service_save(struct connman_service *service);
1019
1020 #include <connman/notifier.h>
1021
1022 int __connman_technology_init(void);
1023 void __connman_technology_cleanup(void);
1024
1025 int __connman_notifier_init(void);
1026 void __connman_notifier_cleanup(void);
1027
1028 void __connman_notifier_service_add(struct connman_service *service,
1029                                         const char *name);
1030 void __connman_notifier_service_remove(struct connman_service *service);
1031 void __connman_notifier_enter_online(enum connman_service_type type);
1032 void __connman_notifier_leave_online(enum connman_service_type type);
1033 void __connman_notifier_connect(enum connman_service_type type);
1034 void __connman_notifier_disconnect(enum connman_service_type type);
1035 void __connman_notifier_offlinemode(bool enabled);
1036 void __connman_notifier_default_changed(struct connman_service *service);
1037 void __connman_notifier_proxy_changed(struct connman_service *service);
1038 void __connman_notifier_service_state_changed(struct connman_service *service,
1039                                         enum connman_service_state state);
1040 void __connman_notifier_ipconfig_changed(struct connman_service *service,
1041                                         struct connman_ipconfig *ipconfig);
1042
1043 bool __connman_notifier_is_connected(void);
1044 const char *__connman_notifier_get_state(void);
1045
1046 #include <connman/rtnl.h>
1047
1048 #if defined TIZEN_EXT
1049 int __connman_rtnl_init(int retry_count);
1050 #else
1051 int __connman_rtnl_init(void);
1052 #endif
1053 void __connman_rtnl_start(void);
1054 void __connman_rtnl_cleanup(void);
1055
1056 #if defined TIZEN_EXT
1057 void __connman_wifi_vsie_list_struct(DBusMessageIter *iter);
1058 #endif
1059
1060 enum connman_device_type __connman_rtnl_get_device_type(int index);
1061 unsigned int __connman_rtnl_update_interval_add(unsigned int interval);
1062 unsigned int __connman_rtnl_update_interval_remove(unsigned int interval);
1063 int __connman_rtnl_request_update(void);
1064 int __connman_rtnl_send(const void *buf, size_t len);
1065
1066 #if defined TIZEN_EXT
1067 void rtnl_nameserver_add_all(struct connman_service *service,
1068                         enum connman_ipconfig_type type);
1069 #endif
1070
1071 bool __connman_session_policy_autoconnect(enum connman_service_connect_reason reason);
1072
1073 int __connman_session_create(DBusMessage *msg);
1074 int __connman_session_destroy(DBusMessage *msg);
1075
1076 int __connman_session_init(void);
1077 void __connman_session_cleanup(void);
1078
1079 struct connman_stats_data {
1080         unsigned int rx_packets;
1081         unsigned int tx_packets;
1082         unsigned int rx_bytes;
1083         unsigned int tx_bytes;
1084         unsigned int rx_errors;
1085         unsigned int tx_errors;
1086         unsigned int rx_dropped;
1087         unsigned int tx_dropped;
1088         unsigned int time;
1089 };
1090
1091 int __connman_stats_init(void);
1092 void __connman_stats_cleanup(void);
1093 int __connman_stats_service_register(struct connman_service *service);
1094 void __connman_stats_service_unregister(struct connman_service *service);
1095 int  __connman_stats_update(struct connman_service *service,
1096                                 bool roaming,
1097                                 struct connman_stats_data *data);
1098 int __connman_stats_get(struct connman_service *service,
1099                                 bool roaming,
1100                                 struct connman_stats_data *data);
1101
1102 int __connman_iptables_dump(int type,
1103                                 const char *table_name);
1104 int __connman_iptables_new_chain(int type,
1105                                 const char *table_name,
1106                                 const char *chain);
1107 int __connman_iptables_delete_chain(int type,
1108                                 const char *table_name,
1109                                 const char *chain);
1110 int __connman_iptables_flush_chain(int type,
1111                                 const char *table_name,
1112                                 const char *chain);
1113 int __connman_iptables_find_chain(int type,
1114                                 const char *table_name,
1115                                 const char *chain);
1116 int __connman_iptables_change_policy(int type,
1117                                 const char *table_name,
1118                                 const char *chain,
1119                                 const char *policy);
1120 int __connman_iptables_append(int type,
1121                                 const char *table_name,
1122                                 const char *chain,
1123                                 const char *rule_spec);
1124 int __connman_iptables_insert(int type,
1125                                 const char *table_name,
1126                                 const char *chain,
1127                                 const char *rule_spec);
1128 int __connman_iptables_delete(int type,
1129                                 const char *table_name,
1130                                 const char *chain,
1131                                 const char *rule_spec);
1132
1133 typedef void (*connman_iptables_iterate_chains_cb_t) (const char *chain_name,
1134                                                         void *user_data);
1135 int __connman_iptables_iterate_chains(int type,
1136                                 const char *table_name,
1137                                 connman_iptables_iterate_chains_cb_t cb,
1138                                 void *user_data);
1139
1140 int __connman_iptables_init(void);
1141 void __connman_iptables_cleanup(void);
1142 int __connman_iptables_commit(int type, const char *table_name);
1143
1144 int __connman_dnsproxy_init(void);
1145 void __connman_dnsproxy_cleanup(void);
1146 int __connman_dnsproxy_add_listener(int index);
1147 void __connman_dnsproxy_remove_listener(int index);
1148 int __connman_dnsproxy_append(int index, const char *domain, const char *server);
1149 int __connman_dnsproxy_remove(int index, const char *domain, const char *server);
1150 int __connman_dnsproxy_set_mdns(int index, bool enabled);
1151
1152 int __connman_6to4_probe(struct connman_service *service);
1153 void __connman_6to4_remove(struct connman_ipconfig *ipconfig);
1154 int __connman_6to4_check(struct connman_ipconfig *ipconfig);
1155
1156 struct connman_ippool;
1157
1158 typedef void (*ippool_collision_cb_t) (struct connman_ippool *pool,
1159                                         void *user_data);
1160
1161 int __connman_ippool_init(void);
1162 void __connman_ippool_cleanup(void);
1163
1164 void __connman_ippool_free(struct connman_ippool *pool);
1165
1166 struct connman_ippool *__connman_ippool_create(int index,
1167                                         unsigned int start,
1168                                         unsigned int range,
1169                                         ippool_collision_cb_t collision_cb,
1170                                         void *user_data);
1171
1172 const char *__connman_ippool_get_gateway(struct connman_ippool *pool);
1173 const char *__connman_ippool_get_broadcast(struct connman_ippool *pool);
1174 const char *__connman_ippool_get_subnet_mask(struct connman_ippool *pool);
1175 const char *__connman_ippool_get_start_ip(struct connman_ippool *pool);
1176 const char *__connman_ippool_get_end_ip(struct connman_ippool *pool);
1177
1178 void __connman_ippool_newaddr(int index, const char *address,
1179                                 unsigned char prefixlen);
1180 void __connman_ippool_deladdr(int index, const char *address,
1181                                 unsigned char prefixlen);
1182
1183 int __connman_bridge_create(const char *name);
1184 int __connman_bridge_remove(const char *name);
1185 int __connman_bridge_enable(const char *name, const char *ip_address,
1186                         int prefix_len, const char *broadcast);
1187 int __connman_bridge_disable(const char *name);
1188
1189 int __connman_nat_init(void);
1190 void __connman_nat_cleanup(void);
1191
1192 int __connman_nat_enable(const char *name, const char *address,
1193                                 unsigned char prefixlen);
1194 void __connman_nat_disable(const char *name);
1195
1196 struct firewall_context;
1197
1198 struct firewall_context *__connman_firewall_create(void);
1199 void __connman_firewall_destroy(struct firewall_context *ctx);
1200 int __connman_firewall_enable_nat(struct firewall_context *ctx,
1201                                         char *address, unsigned char prefixlen,
1202                                         char *interface);
1203 int __connman_firewall_disable_nat(struct firewall_context *ctx);
1204 int __connman_firewall_enable_snat(struct firewall_context *ctx,
1205                                 int index, const char *ifname,
1206                                 const char *addr);
1207 int __connman_firewall_disable_snat(struct firewall_context *ctx);
1208 int __connman_firewall_enable_marking(struct firewall_context *ctx,
1209                                         enum connman_session_id_type id_type,
1210                                         char *id, const char *src_ip,
1211                                         uint32_t mark);
1212 int __connman_firewall_disable_marking(struct firewall_context *ctx);
1213
1214 int __connman_firewall_init(void);
1215 void __connman_firewall_cleanup(void);
1216
1217 typedef int (* connman_nfacct_flush_cb_t) (unsigned int error, void *user_data);
1218
1219 int __connman_nfacct_flush(connman_nfacct_flush_cb_t cb, void *user_data);
1220
1221 struct nfacct_context;
1222
1223 typedef void (* connman_nfacct_enable_cb_t) (unsigned int error,
1224                                                 struct nfacct_context *ctx,
1225                                                 void *user_data);
1226 typedef void (* connman_nfacct_disable_cb_t) (unsigned int error,
1227                                                 struct nfacct_context *ctx,
1228                                                 void *user_data);
1229 typedef void (* connman_nfacct_stats_cb_t) (struct nfacct_context *ctx,
1230                                                 uint64_t packets,
1231                                                 uint64_t bytes,
1232                                                 void *user_data);
1233
1234 struct nfacct_context *__connman_nfacct_create_context(void);
1235 void __connman_nfacct_destroy_context(struct nfacct_context *ctx);
1236
1237 int __connman_nfacct_add(struct nfacct_context *ctx, const char *name,
1238                                 connman_nfacct_stats_cb_t cb,
1239                                 void *user_data);
1240 int __connman_nfacct_enable(struct nfacct_context *ctx,
1241                                 connman_nfacct_enable_cb_t cb,
1242                                 void *user_data);
1243 int __connman_nfacct_disable(struct nfacct_context *ctx,
1244                                 connman_nfacct_disable_cb_t cb,
1245                                 void *user_data);
1246
1247 void __connman_nfacct_cleanup(void);
1248
1249 #include <connman/machine.h>
1250
1251 int __connman_machine_init(void);
1252 void __connman_machine_cleanup(void);
1253
1254 int __connman_util_get_random(uint64_t *val);
1255 unsigned int __connman_util_random_delay_ms(unsigned int secs);
1256 int __connman_util_init(void);
1257 void __connman_util_cleanup(void);
1258
1259 #ifdef TIZEN_EXT
1260 __attribute__ ((unused)) static int __tizentvextension = -1;
1261 #define TIZEN_TV_EXT (__builtin_expect(__tizentvextension != -1, 1) ? \
1262         __tizentvextension : \
1263         (__tizentvextension = connman_setting_get_bool("TizenTVExtension")))
1264 #else /* TIZEN_EXT */
1265 #define TIZEN_TV_EXT (0) /* Always False */
1266 #endif /* TIZEN_EXT */