5 * Copyright (C) 2012 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #define VPN_API_SUBJECT_TO_CHANGE
26 #include <connman/dbus.h>
27 #include <connman/types.h>
29 int __vpn_manager_init(void);
30 void __vpn_manager_cleanup(void);
34 unsigned char __vpn_ipconfig_netmask_prefix_len(const char *netmask);
35 unsigned short __vpn_ipconfig_get_type_from_index(int index);
36 unsigned int __vpn_ipconfig_get_flags_from_index(int index);
37 void __vpn_ipconfig_foreach(void (*function) (int index,
38 void *user_data), void *user_data);
39 void __vpn_ipconfig_set_local(struct vpn_ipconfig *ipconfig,
41 const char *__vpn_ipconfig_get_local(struct vpn_ipconfig *ipconfig);
42 void __vpn_ipconfig_set_peer(struct vpn_ipconfig *ipconfig,
44 const char *__vpn_ipconfig_get_peer(struct vpn_ipconfig *ipconfig);
45 void __vpn_ipconfig_set_broadcast(struct vpn_ipconfig *ipconfig,
46 const char *broadcast);
47 void __vpn_ipconfig_set_gateway(struct vpn_ipconfig *ipconfig,
49 const char *__vpn_ipconfig_get_gateway(struct vpn_ipconfig *ipconfig);
50 void __vpn_ipconfig_set_prefixlen(struct vpn_ipconfig *ipconfig,
51 unsigned char prefixlen);
52 unsigned char __vpn_ipconfig_get_prefixlen(struct vpn_ipconfig *ipconfig);
53 int __vpn_ipconfig_address_add(struct vpn_ipconfig *ipconfig, int family);
54 int __vpn_ipconfig_gateway_add(struct vpn_ipconfig *ipconfig, int family);
55 void __vpn_ipconfig_unref_debug(struct vpn_ipconfig *ipconfig,
56 const char *file, int line, const char *caller);
57 #define __vpn_ipconfig_unref(ipconfig) \
58 __vpn_ipconfig_unref_debug(ipconfig, __FILE__, __LINE__, __func__)
59 struct vpn_ipconfig *__vpn_ipconfig_create(int index, int family);
60 void __vpn_ipconfig_set_index(struct vpn_ipconfig *ipconfig,
62 struct rtnl_link_stats;
64 void __vpn_ipconfig_newlink(int index, unsigned short type,
65 unsigned int flags, const char *address,
67 struct rtnl_link_stats *stats);
68 void __vpn_ipconfig_dellink(int index, struct rtnl_link_stats *stats);
69 int __vpn_ipconfig_init(void);
70 void __vpn_ipconfig_cleanup(void);
72 #include "vpn-provider.h"
74 char *__vpn_provider_create_identifier(const char *host, const char *domain);
75 connman_bool_t __vpn_provider_check_routes(struct vpn_provider *provider);
76 int __vpn_provider_append_user_route(struct vpn_provider *provider,
77 int family, const char *network,
78 const char *netmask, const char *gateway);
79 void __vpn_provider_append_properties(struct vpn_provider *provider, DBusMessageIter *iter);
80 void __vpn_provider_list(DBusMessageIter *iter, void *user_data);
81 int __vpn_provider_create(DBusMessage *msg);
82 int __vpn_provider_create_from_config(GHashTable *settings,
83 const char *config_ident, const char *config_entry);
84 DBusMessage *__vpn_provider_get_connections(DBusMessage *msg);
85 const char * __vpn_provider_get_ident(struct vpn_provider *provider);
86 struct vpn_provider *__vpn_provider_lookup(const char *identifier);
87 int __vpn_provider_indicate_state(struct vpn_provider *provider,
88 enum vpn_provider_state state);
89 int __vpn_provider_indicate_error(struct vpn_provider *provider,
90 enum vpn_provider_error error);
91 int __vpn_provider_connect(struct vpn_provider *provider, DBusMessage *msg);
92 int __vpn_provider_connect_path(const char *path);
93 int __vpn_provider_disconnect(struct vpn_provider *provider);
94 int __vpn_provider_remove(const char *path);
95 int __vpn_provider_delete(struct vpn_provider *provider);
96 void __vpn_provider_check_connections(void);
97 void __vpn_provider_cleanup(void);
98 int __vpn_provider_init(gboolean handle_routes);
100 #include "vpn-rtnl.h"
102 int __vpn_rtnl_init(void);
103 void __vpn_rtnl_start(void);
104 void __vpn_rtnl_cleanup(void);
106 unsigned int __vpn_rtnl_update_interval_add(unsigned int interval);
107 unsigned int __vpn_rtnl_update_interval_remove(unsigned int interval);
108 int __vpn_rtnl_request_update(void);
109 int __vpn_rtnl_send(const void *buf, size_t len);
111 int __vpn_config_init(void);
112 void __vpn_config_cleanup(void);