5 * Copyright (C) 2010,2014 BMW Car IT GmbH.
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
22 #ifndef __CONNMAN_VPND_VPN_H
23 #define __CONNMAN_VPND_VPN_H
25 #include "../vpn-provider.h"
31 #define VPN_FLAG_NO_TUN 1
32 #define VPN_FLAG_NO_DAEMON 2
35 VPN_STATE_UNKNOWN = 0,
37 VPN_STATE_CONNECT = 2,
39 VPN_STATE_DISCONNECT = 4,
40 VPN_STATE_FAILURE = 5,
41 VPN_STATE_AUTH_FAILURE = 6,
46 int (*notify) (DBusMessage *msg, struct vpn_provider *provider);
47 int (*connect) (struct vpn_provider *provider,
48 struct connman_task *task, const char *if_name,
49 vpn_provider_connect_cb_t cb, const char *dbus_sender,
51 void (*disconnect) (struct vpn_provider *provider);
52 int (*remove) (struct vpn_provider *provider);
53 int (*error_code) (struct vpn_provider *provider, int exit_code);
54 int (*save) (struct vpn_provider *provider, GKeyFile *keyfile);
55 int (*device_flags) (struct vpn_provider *provider);
56 int (*route_env_parse) (struct vpn_provider *provider, const char *key,
57 int *family, unsigned long *idx,
58 enum vpn_provider_route_type *type);
61 int vpn_register(const char *name, const struct vpn_driver *driver,
63 void vpn_unregister(const char *provider_name);
64 void vpn_died(struct connman_task *task, int exit_code, void *user_data);
65 int vpn_set_ifname(struct vpn_provider *provider, const char *ifname);
71 #endif /* __CONNMAN_VPND_VPN_H */