Merge "Fix SIGSEV on freeing server domains list" into tizen
[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 char *__connman_network_get_dhcp_status(const char *ifname);
689 dbus_bool_t __connman_network_notify_dhcp_changed(const char *key, const char *val);
690 bool connman_network_get_psk_sha256(struct connman_network *network);
691 void connman_network_set_psk_sha256(struct connman_network *network, bool is_psk_sha256);
692 #endif
693
694 int __connman_config_init();
695 void __connman_config_cleanup(void);
696
697 int __connman_config_load_service(GKeyFile *keyfile, const char *group,
698                                   bool persistent);
699 int __connman_config_provision_service(struct connman_service *service);
700 int __connman_config_provision_service_ident(struct connman_service *service,
701                 const char *ident, const char *file, const char *entry);
702
703 char *__connman_config_get_string(GKeyFile *key_file,
704         const char *group_name, const char *key, GError **error);
705
706 char **__connman_config_get_string_list(GKeyFile *key_file,
707         const char *group_name, const char *key, gsize *length, GError **error);
708
709 bool __connman_config_get_bool(GKeyFile *key_file,
710         const char *group_name, const char *key, GError **error);
711 bool __connman_config_address_provisioned(const char *address,
712                                         const char *netmask);
713
714 #include <connman/tethering.h>
715
716 int __connman_tethering_init(void);
717 void __connman_tethering_cleanup(void);
718
719 const char *__connman_tethering_get_bridge(void);
720 int __connman_tethering_set_enabled(void);
721 void __connman_tethering_set_disabled(void);
722 void __connman_tethering_list_clients(DBusMessageIter *array);
723
724 int __connman_private_network_request(DBusMessage *msg, const char *owner);
725 int __connman_private_network_release(const char *path);
726
727 int __connman_ipv6pd_setup(const char *bridge);
728 void __connman_ipv6pd_cleanup(void);
729
730 #include <connman/provider.h>
731
732 bool __connman_provider_check_routes(struct connman_provider *provider);
733 int __connman_provider_append_user_route(struct connman_provider *provider,
734                         int family, const char *network, const char *netmask);
735 void __connman_provider_append_properties(struct connman_provider *provider, DBusMessageIter *iter);
736 void __connman_provider_list(DBusMessageIter *iter, void *user_data);
737 bool __connman_provider_is_immutable(struct connman_provider *provider);
738 int __connman_provider_create_and_connect(DBusMessage *msg);
739 const char * __connman_provider_get_ident(struct connman_provider *provider);
740 const char * __connman_provider_get_transport_ident(
741                                         struct connman_provider *provider);
742 int __connman_provider_indicate_state(struct connman_provider *provider,
743                                         enum connman_provider_state state);
744 int __connman_provider_indicate_error(struct connman_provider *provider,
745                                         enum connman_provider_error error);
746 int __connman_provider_connect(struct connman_provider *provider,
747                                         const char *dbus_sender);
748 int __connman_provider_remove_by_path(const char *path);
749 void __connman_provider_cleanup(void);
750 int __connman_provider_init(void);
751
752 #include <connman/service.h>
753
754 int __connman_service_init(void);
755 void __connman_service_cleanup(void);
756 int __connman_service_move(struct connman_service *service,
757                                 struct connman_service *target, bool before);
758 int __connman_service_load_modifiable(struct connman_service *service);
759
760 void __connman_service_list_struct(DBusMessageIter *iter);
761 #if defined TIZEN_EXT
762 void __connman_ins_list_struct(DBusMessageIter *iter);
763
764 int connman_service_get_ipv6_dns_method(struct connman_service *service);
765 enum connman_dnsconfig_method {
766         CONNMAN_DNSCONFIG_METHOD_UNKNOWN = 0,
767         CONNMAN_DNSCONFIG_METHOD_MANUAL  = 1,
768         CONNMAN_DNSCONFIG_METHOD_DHCP    = 2,
769 };
770 #endif
771
772 int __connman_service_compare(const struct connman_service *a,
773                                         const struct connman_service *b);
774
775 struct connman_service *__connman_service_lookup_from_index(int index);
776 struct connman_service *__connman_service_create_from_network(struct connman_network *network);
777 struct connman_service *__connman_service_create_from_provider(struct connman_provider *provider);
778 bool __connman_service_index_is_default(int index);
779 #if defined TIZEN_EXT
780 void __connman_service_notify_strength_changed(struct connman_network *network);
781 #endif
782 void __connman_service_update_from_network(struct connman_network *network);
783 void __connman_service_remove_from_network(struct connman_network *network);
784 void __connman_service_read_ip4config(struct connman_service *service);
785 void __connman_service_read_ip6config(struct connman_service *service);
786
787 struct connman_ipconfig *__connman_service_get_ip4config(
788                                 struct connman_service *service);
789 struct connman_ipconfig *__connman_service_get_ip6config(
790                                 struct connman_service *service);
791 struct connman_ipconfig *__connman_service_get_ipconfig(
792                                 struct connman_service *service, int family);
793 void __connman_service_notify_ipv4_configuration(
794                                 struct connman_service *service);
795 void __connman_service_wispr_start(struct connman_service *service,
796                                 enum connman_ipconfig_type type);
797 bool __connman_service_is_connected_state(struct connman_service *service,
798                                         enum connman_ipconfig_type type);
799 const char *__connman_service_get_path(struct connman_service *service);
800 const char *__connman_service_get_name(struct connman_service *service);
801 struct connman_network *__connman_service_get_network(struct connman_service *service);
802 enum connman_service_security __connman_service_get_security(struct connman_service *service);
803 const char *__connman_service_get_phase2(struct connman_service *service);
804 bool __connman_service_wps_enabled(struct connman_service *service);
805 #if defined TIZEN_EXT
806 void __connman_service_set_storage_reload(struct connman_service *service,
807                                                 bool storage_reload);
808 #endif
809 int __connman_service_set_favorite(struct connman_service *service,
810                                                 bool favorite);
811 int __connman_service_set_favorite_delayed(struct connman_service *service,
812                                         bool favorite,
813                                         bool delay_ordering);
814 int __connman_service_set_immutable(struct connman_service *service,
815                                                 bool immutable);
816 int __connman_service_set_ignore(struct connman_service *service,
817                                                 bool ignore);
818 void __connman_service_set_search_domains(struct connman_service *service,
819                                         char **domains);
820 int __connman_service_set_mdns(struct connman_service *service,
821                                         bool enabled);
822
823 void __connman_service_set_string(struct connman_service *service,
824                                         const char *key, const char *value);
825 void __connman_service_online_check(struct connman_service *service,
826                                         enum connman_ipconfig_type type,
827                                         bool success);
828 int __connman_service_ipconfig_indicate_state(struct connman_service *service,
829                                         enum connman_service_state new_state,
830                                         enum connman_ipconfig_type type);
831 enum connman_service_state __connman_service_ipconfig_get_state(
832                                         struct connman_service *service,
833                                         enum connman_ipconfig_type type);
834
835 #if defined TIZEN_EXT
836 void connman_check_proxy_setup_and_wispr_start(struct connman_service *service);
837 #endif
838
839 int __connman_service_indicate_error(struct connman_service *service,
840                                         enum connman_service_error error);
841 int __connman_service_clear_error(struct connman_service *service);
842 int __connman_service_indicate_default(struct connman_service *service);
843
844 int __connman_service_connect(struct connman_service *service,
845                         enum connman_service_connect_reason reason);
846 int __connman_service_disconnect(struct connman_service *service);
847 void __connman_service_set_active_session(bool enable, GSList *list);
848 void __connman_service_auto_connect(enum connman_service_connect_reason reason);
849
850 #if defined TIZEN_EXT
851 bool __connman_service_get_auto_connect_mode(void);
852 void __connman_service_set_auto_connect_mode(bool enable);
853 #endif
854
855 #if defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET
856 int __connman_service_get_use_eapol(struct connman_service *service);
857 int __connman_service_get_connect_reason(struct connman_service *service);
858 #endif /* defined TIZEN_EXT && defined TIZEN_EXT_EAP_ON_ETHERNET */
859
860 bool __connman_service_remove(struct connman_service *service);
861 bool __connman_service_is_provider_pending(struct connman_service *service);
862 void __connman_service_set_provider_pending(struct connman_service *service,
863                                                         DBusMessage *msg);
864 void __connman_service_set_hidden_data(struct connman_service *service,
865                                 gpointer user_data);
866 void __connman_service_return_error(struct connman_service *service,
867                                 int error, gpointer user_data);
868
869 int __connman_service_provision_changed(const char *ident);
870 void __connman_service_set_config(struct connman_service *service,
871                                 const char *file_id, const char *section);
872
873 const char *__connman_service_type2string(enum connman_service_type type);
874 enum connman_service_type __connman_service_string2type(const char *str);
875 enum connman_service_security __connman_service_string2security(const char *str);
876
877 #if defined TIZEN_EXT
878 int __connman_service_nameserver_append(struct connman_service *service,
879                                 const char *nameserver, bool is_auto,
880                                 enum connman_ipconfig_type type);
881 int __connman_service_nameserver_remove(struct connman_service *service,
882                                 const char *nameserver, bool is_auto,
883                                 enum connman_ipconfig_type type);
884 #else
885 int __connman_service_nameserver_append(struct connman_service *service,
886                                 const char *nameserver, bool is_auto);
887 int __connman_service_nameserver_remove(struct connman_service *service,
888                                 const char *nameserver, bool is_auto);
889 #endif
890 void __connman_service_nameserver_clear(struct connman_service *service);
891 void __connman_service_nameserver_add_routes(struct connman_service *service,
892                                                 const char *gw);
893 void __connman_service_nameserver_del_routes(struct connman_service *service,
894                                         enum connman_ipconfig_type type);
895 void __connman_service_set_timeservers(struct connman_service *service,
896                                                 char **timeservers);
897 int __connman_service_timeserver_append(struct connman_service *service,
898                                                 const char *timeserver);
899 int __connman_service_timeserver_remove(struct connman_service *service,
900                                                 const char *timeserver);
901 void __connman_service_timeserver_changed(struct connman_service *service,
902                 GSList *ts_list);
903 void __connman_service_set_pac(struct connman_service *service,
904                                         const char *pac);
905 #if defined TIZEN_EXT
906 /*
907  * Returns profile count if there is any connected profiles
908  * that use same interface
909  */
910 int __connman_service_get_connected_count_of_iface(struct connman_service *service);
911 void __connman_service_set_proxy(struct connman_service *service,
912                                        const char *proxies);
913 int check_passphrase_ext(struct connman_network *network,
914                                         const char *passphrase);
915 #endif
916 bool __connman_service_is_hidden(struct connman_service *service);
917 bool __connman_service_is_split_routing(struct connman_service *service);
918 bool __connman_service_index_is_split_routing(int index);
919 void __connman_service_set_split_routing(struct connman_service *service,
920                                                 bool split_routing);
921 void __connman_service_split_routing_changed(struct connman_service *service);
922 int __connman_service_get_index(struct connman_service *service);
923 void __connman_service_set_hidden(struct connman_service *service);
924 void __connman_service_set_hostname(struct connman_service *service,
925                                                 const char *hostname);
926 const char *__connman_service_get_hostname(struct connman_service *service);
927 void __connman_service_set_domainname(struct connman_service *service,
928                                                 const char *domainname);
929 const char *__connman_service_get_nameserver(struct connman_service *service);
930 void __connman_service_set_proxy_autoconfig(struct connman_service *service,
931                                                         const char *url);
932
933 void __connman_service_set_identity(struct connman_service *service,
934                                         const char *identity);
935 void __connman_service_set_anonymous_identity(struct connman_service *service,
936                                         const char *anonymous_identity);
937 void __connman_service_set_subject_match(struct connman_service *service,
938                                         const char *subject_match);
939 void __connman_service_set_altsubject_match(struct connman_service *service,
940                                         const char *altsubject_match);
941 void __connman_service_set_domain_suffix_match(struct connman_service *service,
942                                         const char *domain_suffix_match);
943 void __connman_service_set_domain_match(struct connman_service *service,
944                                         const char *domain_match);
945 void __connman_service_set_agent_identity(struct connman_service *service,
946                                                 const char *agent_identity);
947 int __connman_service_set_passphrase(struct connman_service *service,
948                                         const char *passphrase);
949 const char *__connman_service_get_passphrase(struct connman_service *service);
950 int __connman_service_check_passphrase(enum connman_service_security security,
951                                         const char *passphrase);
952 int __connman_service_reset_ipconfig(struct connman_service *service,
953                 enum connman_ipconfig_type type, DBusMessageIter *array,
954                 enum connman_service_state *new_state);
955
956 void __connman_service_notify(struct connman_service *service,
957                         unsigned int rx_packets, unsigned int tx_packets,
958                         unsigned int rx_bytes, unsigned int tx_bytes,
959                         unsigned int rx_error, unsigned int tx_error,
960                         unsigned int rx_dropped, unsigned int tx_dropped);
961
962 int __connman_service_counter_register(const char *counter);
963 void __connman_service_counter_unregister(const char *counter);
964
965 #include <connman/peer.h>
966
967 int __connman_peer_init(void);
968 void __connman_peer_cleanup(void);
969
970 void __connman_peer_list_struct(DBusMessageIter *array);
971 const char *__connman_peer_get_path(struct connman_peer *peer);
972 void __connman_peer_disconnect_all(void);
973
974 int __connman_peer_service_init(void);
975 void __connman_peer_service_cleanup(void);
976
977 void __connman_peer_service_set_driver(struct connman_peer_driver *driver);
978 int __connman_peer_service_register(const char *owner, DBusMessage *msg,
979                                         const unsigned char *specification,
980                                         int specification_length,
981                                         const unsigned char *query,
982                                         int query_length, int version,
983                                         bool master);
984 int __connman_peer_service_unregister(const char *owner,
985                                         const unsigned char *specification,
986                                         int specification_length,
987                                         const unsigned char *query,
988                                         int query_length, int version);
989
990 #if defined TIZEN_EXT_WIFI_MESH
991 #include <connman/mesh.h>
992
993 int __connman_mesh_init(void);
994 void __connman_mesh_cleanup(void);
995 bool __connman_technology_get_connected(enum connman_service_type type);
996 void __connman_technology_mesh_interface_create_finished(
997                                                 enum connman_service_type type, bool success,
998                                                 const char *error);
999 void __connman_technology_mesh_interface_remove_finished(
1000                                                 enum connman_service_type type, bool success);
1001 void __connman_mesh_peer_list_struct(DBusMessageIter *array);
1002 void __connman_mesh_connected_peer_list_struct(DBusMessageIter *array);
1003 void __connman_mesh_disconnected_peer_list_struct(DBusMessageIter *array);
1004 int __connman_mesh_dhcp_start(struct connman_ipconfig *ipconfig,
1005                         dhcp_cb callback, gpointer user_data);
1006 int __connman_device_abort_scan(enum connman_service_type type);
1007 void __connman_technology_notify_abort_scan(enum connman_service_type type,
1008                                                 int result);
1009 int __connman_device_request_mesh_specific_scan(enum connman_service_type type,
1010                                 const char *name, unsigned int freq);
1011 void __connman_mesh_auto_connect(void);
1012 #endif /* TIZEN_EXT_WIFI_MESH */
1013
1014 #include <connman/session.h>
1015
1016 void __connman_service_mark_dirty();
1017 void __connman_service_save(struct connman_service *service);
1018
1019 #include <connman/notifier.h>
1020
1021 int __connman_technology_init(void);
1022 void __connman_technology_cleanup(void);
1023
1024 int __connman_notifier_init(void);
1025 void __connman_notifier_cleanup(void);
1026
1027 void __connman_notifier_service_add(struct connman_service *service,
1028                                         const char *name);
1029 void __connman_notifier_service_remove(struct connman_service *service);
1030 void __connman_notifier_enter_online(enum connman_service_type type);
1031 void __connman_notifier_leave_online(enum connman_service_type type);
1032 void __connman_notifier_connect(enum connman_service_type type);
1033 void __connman_notifier_disconnect(enum connman_service_type type);
1034 void __connman_notifier_offlinemode(bool enabled);
1035 void __connman_notifier_default_changed(struct connman_service *service);
1036 void __connman_notifier_proxy_changed(struct connman_service *service);
1037 void __connman_notifier_service_state_changed(struct connman_service *service,
1038                                         enum connman_service_state state);
1039 void __connman_notifier_ipconfig_changed(struct connman_service *service,
1040                                         struct connman_ipconfig *ipconfig);
1041
1042 bool __connman_notifier_is_connected(void);
1043 const char *__connman_notifier_get_state(void);
1044
1045 #include <connman/rtnl.h>
1046
1047 #if defined TIZEN_EXT
1048 int __connman_rtnl_init(int retry_count);
1049 #else
1050 int __connman_rtnl_init(void);
1051 #endif
1052 void __connman_rtnl_start(void);
1053 void __connman_rtnl_cleanup(void);
1054
1055 #if defined TIZEN_EXT
1056 void __connman_wifi_vsie_list_struct(DBusMessageIter *iter);
1057 #endif
1058
1059 enum connman_device_type __connman_rtnl_get_device_type(int index);
1060 unsigned int __connman_rtnl_update_interval_add(unsigned int interval);
1061 unsigned int __connman_rtnl_update_interval_remove(unsigned int interval);
1062 int __connman_rtnl_request_update(void);
1063 int __connman_rtnl_send(const void *buf, size_t len);
1064
1065 #if defined TIZEN_EXT
1066 void rtnl_nameserver_add_all(struct connman_service *service,
1067                         enum connman_ipconfig_type type);
1068 #endif
1069
1070 bool __connman_session_policy_autoconnect(enum connman_service_connect_reason reason);
1071
1072 int __connman_session_create(DBusMessage *msg);
1073 int __connman_session_destroy(DBusMessage *msg);
1074
1075 int __connman_session_init(void);
1076 void __connman_session_cleanup(void);
1077
1078 struct connman_stats_data {
1079         unsigned int rx_packets;
1080         unsigned int tx_packets;
1081         unsigned int rx_bytes;
1082         unsigned int tx_bytes;
1083         unsigned int rx_errors;
1084         unsigned int tx_errors;
1085         unsigned int rx_dropped;
1086         unsigned int tx_dropped;
1087         unsigned int time;
1088 };
1089
1090 int __connman_stats_init(void);
1091 void __connman_stats_cleanup(void);
1092 int __connman_stats_service_register(struct connman_service *service);
1093 void __connman_stats_service_unregister(struct connman_service *service);
1094 int  __connman_stats_update(struct connman_service *service,
1095                                 bool roaming,
1096                                 struct connman_stats_data *data);
1097 int __connman_stats_get(struct connman_service *service,
1098                                 bool roaming,
1099                                 struct connman_stats_data *data);
1100
1101 int __connman_iptables_dump(int type,
1102                                 const char *table_name);
1103 int __connman_iptables_new_chain(int type,
1104                                 const char *table_name,
1105                                 const char *chain);
1106 int __connman_iptables_delete_chain(int type,
1107                                 const char *table_name,
1108                                 const char *chain);
1109 int __connman_iptables_flush_chain(int type,
1110                                 const char *table_name,
1111                                 const char *chain);
1112 int __connman_iptables_find_chain(int type,
1113                                 const char *table_name,
1114                                 const char *chain);
1115 int __connman_iptables_change_policy(int type,
1116                                 const char *table_name,
1117                                 const char *chain,
1118                                 const char *policy);
1119 int __connman_iptables_append(int type,
1120                                 const char *table_name,
1121                                 const char *chain,
1122                                 const char *rule_spec);
1123 int __connman_iptables_insert(int type,
1124                                 const char *table_name,
1125                                 const char *chain,
1126                                 const char *rule_spec);
1127 int __connman_iptables_delete(int type,
1128                                 const char *table_name,
1129                                 const char *chain,
1130                                 const char *rule_spec);
1131
1132 typedef void (*connman_iptables_iterate_chains_cb_t) (const char *chain_name,
1133                                                         void *user_data);
1134 int __connman_iptables_iterate_chains(int type,
1135                                 const char *table_name,
1136                                 connman_iptables_iterate_chains_cb_t cb,
1137                                 void *user_data);
1138
1139 int __connman_iptables_init(void);
1140 void __connman_iptables_cleanup(void);
1141 int __connman_iptables_commit(int type, const char *table_name);
1142
1143 int __connman_dnsproxy_init(void);
1144 void __connman_dnsproxy_cleanup(void);
1145 int __connman_dnsproxy_add_listener(int index);
1146 void __connman_dnsproxy_remove_listener(int index);
1147 int __connman_dnsproxy_append(int index, const char *domain, const char *server);
1148 int __connman_dnsproxy_remove(int index, const char *domain, const char *server);
1149 int __connman_dnsproxy_set_mdns(int index, bool enabled);
1150
1151 int __connman_6to4_probe(struct connman_service *service);
1152 void __connman_6to4_remove(struct connman_ipconfig *ipconfig);
1153 int __connman_6to4_check(struct connman_ipconfig *ipconfig);
1154
1155 struct connman_ippool;
1156
1157 typedef void (*ippool_collision_cb_t) (struct connman_ippool *pool,
1158                                         void *user_data);
1159
1160 int __connman_ippool_init(void);
1161 void __connman_ippool_cleanup(void);
1162
1163 void __connman_ippool_free(struct connman_ippool *pool);
1164
1165 struct connman_ippool *__connman_ippool_create(int index,
1166                                         unsigned int start,
1167                                         unsigned int range,
1168                                         ippool_collision_cb_t collision_cb,
1169                                         void *user_data);
1170
1171 const char *__connman_ippool_get_gateway(struct connman_ippool *pool);
1172 const char *__connman_ippool_get_broadcast(struct connman_ippool *pool);
1173 const char *__connman_ippool_get_subnet_mask(struct connman_ippool *pool);
1174 const char *__connman_ippool_get_start_ip(struct connman_ippool *pool);
1175 const char *__connman_ippool_get_end_ip(struct connman_ippool *pool);
1176
1177 void __connman_ippool_newaddr(int index, const char *address,
1178                                 unsigned char prefixlen);
1179 void __connman_ippool_deladdr(int index, const char *address,
1180                                 unsigned char prefixlen);
1181
1182 int __connman_bridge_create(const char *name);
1183 int __connman_bridge_remove(const char *name);
1184 int __connman_bridge_enable(const char *name, const char *ip_address,
1185                         int prefix_len, const char *broadcast);
1186 int __connman_bridge_disable(const char *name);
1187
1188 int __connman_nat_init(void);
1189 void __connman_nat_cleanup(void);
1190
1191 int __connman_nat_enable(const char *name, const char *address,
1192                                 unsigned char prefixlen);
1193 void __connman_nat_disable(const char *name);
1194
1195 struct firewall_context;
1196
1197 struct firewall_context *__connman_firewall_create(void);
1198 void __connman_firewall_destroy(struct firewall_context *ctx);
1199 int __connman_firewall_enable_nat(struct firewall_context *ctx,
1200                                         char *address, unsigned char prefixlen,
1201                                         char *interface);
1202 int __connman_firewall_disable_nat(struct firewall_context *ctx);
1203 int __connman_firewall_enable_snat(struct firewall_context *ctx,
1204                                 int index, const char *ifname,
1205                                 const char *addr);
1206 int __connman_firewall_disable_snat(struct firewall_context *ctx);
1207 int __connman_firewall_enable_marking(struct firewall_context *ctx,
1208                                         enum connman_session_id_type id_type,
1209                                         char *id, const char *src_ip,
1210                                         uint32_t mark);
1211 int __connman_firewall_disable_marking(struct firewall_context *ctx);
1212
1213 int __connman_firewall_init(void);
1214 void __connman_firewall_cleanup(void);
1215
1216 typedef int (* connman_nfacct_flush_cb_t) (unsigned int error, void *user_data);
1217
1218 int __connman_nfacct_flush(connman_nfacct_flush_cb_t cb, void *user_data);
1219
1220 struct nfacct_context;
1221
1222 typedef void (* connman_nfacct_enable_cb_t) (unsigned int error,
1223                                                 struct nfacct_context *ctx,
1224                                                 void *user_data);
1225 typedef void (* connman_nfacct_disable_cb_t) (unsigned int error,
1226                                                 struct nfacct_context *ctx,
1227                                                 void *user_data);
1228 typedef void (* connman_nfacct_stats_cb_t) (struct nfacct_context *ctx,
1229                                                 uint64_t packets,
1230                                                 uint64_t bytes,
1231                                                 void *user_data);
1232
1233 struct nfacct_context *__connman_nfacct_create_context(void);
1234 void __connman_nfacct_destroy_context(struct nfacct_context *ctx);
1235
1236 int __connman_nfacct_add(struct nfacct_context *ctx, const char *name,
1237                                 connman_nfacct_stats_cb_t cb,
1238                                 void *user_data);
1239 int __connman_nfacct_enable(struct nfacct_context *ctx,
1240                                 connman_nfacct_enable_cb_t cb,
1241                                 void *user_data);
1242 int __connman_nfacct_disable(struct nfacct_context *ctx,
1243                                 connman_nfacct_disable_cb_t cb,
1244                                 void *user_data);
1245
1246 void __connman_nfacct_cleanup(void);
1247
1248 #include <connman/machine.h>
1249
1250 int __connman_machine_init(void);
1251 void __connman_machine_cleanup(void);
1252
1253 int __connman_util_get_random(uint64_t *val);
1254 unsigned int __connman_util_random_delay_ms(unsigned int secs);
1255 int __connman_util_init(void);
1256 void __connman_util_cleanup(void);
1257
1258 #ifdef TIZEN_EXT
1259 __attribute__ ((unused)) static int __tizentvextension = -1;
1260 #define TIZEN_TV_EXT (__builtin_expect(__tizentvextension != -1, 1) ? \
1261         __tizentvextension : \
1262         (__tizentvextension = connman_setting_get_bool("TizenTVExtension")))
1263 #else /* TIZEN_EXT */
1264 #define TIZEN_TV_EXT (0) /* Always False */
1265 #endif /* TIZEN_EXT */