diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-11-12 14:07:21 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-11-23 12:58:50 +0200 |
commit | 4ba04eb6172f898402e0aa66f0dc8f564a12279f (patch) | |
tree | 7a67e489ea3de6f65e65d6034b2a0951db709cd0 /vpn/plugins/vpn.h | |
parent | a426464354273a5586612b6577288e3662e3f8ac (diff) | |
download | connman-4ba04eb6172f898402e0aa66f0dc8f564a12279f.tar.gz connman-4ba04eb6172f898402e0aa66f0dc8f564a12279f.tar.bz2 connman-4ba04eb6172f898402e0aa66f0dc8f564a12279f.zip |
vpn: New vpn daemon that handles vpn connections and clients
Diffstat (limited to 'vpn/plugins/vpn.h')
-rw-r--r-- | vpn/plugins/vpn.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/vpn/plugins/vpn.h b/vpn/plugins/vpn.h new file mode 100644 index 00000000..6693cdba --- /dev/null +++ b/vpn/plugins/vpn.h @@ -0,0 +1,63 @@ +/* + * + * ConnMan VPN daemon + * + * Copyright (C) 2010 BMW Car IT GmbH. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __CONNMAN_VPND_VPN_H +#define __CONNMAN_VPND_VPN_H + +#include "../vpn-provider.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define VPN_FLAG_NO_TUN 1 + +enum vpn_state { + VPN_STATE_UNKNOWN = 0, + VPN_STATE_IDLE = 1, + VPN_STATE_CONNECT = 2, + VPN_STATE_READY = 3, + VPN_STATE_DISCONNECT = 4, + VPN_STATE_FAILURE = 5, + VPN_STATE_AUTH_FAILURE = 6, +}; + +struct vpn_driver { + int flags; + int (*notify) (DBusMessage *msg, struct vpn_provider *provider); + int (*connect) (struct vpn_provider *provider, + struct connman_task *task, const char *if_name); + void (*disconnect) (void); + int (*error_code) (int exit_code); + int (*save) (struct vpn_provider *provider, GKeyFile *keyfile); +}; + +int vpn_register(const char *name, struct vpn_driver *driver, + const char *program); +void vpn_unregister(const char *provider_name); +void vpn_died(struct connman_task *task, int exit_code, void *user_data); +int vpn_set_ifname(struct vpn_provider *provider, const char *ifname); + +#ifdef __cplusplus +} +#endif + +#endif /* __CONNMAN_VPND_VPN_H */ |