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