summaryrefslogtreecommitdiff
path: root/vpn/vpn-provider.h
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-11-12 14:07:21 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-11-23 12:58:50 +0200
commit4ba04eb6172f898402e0aa66f0dc8f564a12279f (patch)
tree7a67e489ea3de6f65e65d6034b2a0951db709cd0 /vpn/vpn-provider.h
parenta426464354273a5586612b6577288e3662e3f8ac (diff)
downloadconnman-4ba04eb6172f898402e0aa66f0dc8f564a12279f.tar.gz
connman-4ba04eb6172f898402e0aa66f0dc8f564a12279f.tar.bz2
connman-4ba04eb6172f898402e0aa66f0dc8f564a12279f.zip
vpn: New vpn daemon that handles vpn connections and clients
Diffstat (limited to 'vpn/vpn-provider.h')
-rw-r--r--vpn/vpn-provider.h121
1 files changed, 121 insertions, 0 deletions
diff --git a/vpn/vpn-provider.h b/vpn/vpn-provider.h
new file mode 100644
index 00000000..0f139b09
--- /dev/null
+++ b/vpn/vpn-provider.h
@@ -0,0 +1,121 @@
+/*
+ *
+ * ConnMan VPN daemon
+ *
+ * Copyright (C) 2007-2012 Intel Corporation. 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 __VPN_PROVIDER_H
+#define __VPN_PROVIDER_H
+
+#include <glib.h>
+#include <connman/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * SECTION:provider
+ * @title: Provider premitives
+ * @short_description: Functions for handling providers
+ */
+
+enum vpn_provider_type {
+ VPN_PROVIDER_TYPE_UNKNOWN = 0,
+ VPN_PROVIDER_TYPE_VPN = 1,
+};
+
+enum vpn_provider_state {
+ VPN_PROVIDER_STATE_UNKNOWN = 0,
+ VPN_PROVIDER_STATE_IDLE = 1,
+ VPN_PROVIDER_STATE_CONNECT = 2,
+ VPN_PROVIDER_STATE_READY = 3,
+ VPN_PROVIDER_STATE_DISCONNECT = 4,
+ VPN_PROVIDER_STATE_FAILURE = 5,
+};
+
+enum vpn_provider_error {
+ VPN_PROVIDER_ERROR_UNKNOWN = 0,
+ VPN_PROVIDER_ERROR_CONNECT_FAILED = 1,
+ VPN_PROVIDER_ERROR_LOGIN_FAILED = 2,
+ VPN_PROVIDER_ERROR_AUTH_FAILED = 3,
+};
+
+struct vpn_provider;
+struct connman_ipaddress;
+
+#define vpn_provider_ref(provider) \
+ vpn_provider_ref_debug(provider, __FILE__, __LINE__, __func__)
+
+#define vpn_provider_unref(provider) \
+ vpn_provider_unref_debug(provider, __FILE__, __LINE__, __func__)
+
+struct vpn_provider *
+vpn_provider_ref_debug(struct vpn_provider *provider,
+ const char *file, int line, const char *caller);
+void vpn_provider_unref_debug(struct vpn_provider *provider,
+ const char *file, int line, const char *caller);
+
+int vpn_provider_set_string(struct vpn_provider *provider,
+ const char *key, const char *value);
+const char *vpn_provider_get_string(struct vpn_provider *provider,
+ const char *key);
+
+int vpn_provider_set_state(struct vpn_provider *provider,
+ enum vpn_provider_state state);
+
+int vpn_provider_indicate_error(struct vpn_provider *provider,
+ enum vpn_provider_error error);
+
+void vpn_provider_set_index(struct vpn_provider *provider, int index);
+int vpn_provider_get_index(struct vpn_provider *provider);
+
+void vpn_provider_set_data(struct vpn_provider *provider, void *data);
+void *vpn_provider_get_data(struct vpn_provider *provider);
+int vpn_provider_set_ipaddress(struct vpn_provider *provider,
+ struct connman_ipaddress *ipaddress);
+int vpn_provider_set_pac(struct vpn_provider *provider,
+ const char *pac);
+int vpn_provider_set_domain(struct vpn_provider *provider,
+ const char *domain);
+int vpn_provider_set_nameservers(struct vpn_provider *provider,
+ const char *nameservers);
+int vpn_provider_append_route(struct vpn_provider *provider,
+ const char *key, const char *value);
+
+const char *vpn_provider_get_driver_name(struct vpn_provider *provider);
+const char *vpn_provider_get_save_group(struct vpn_provider *provider);
+
+struct vpn_provider_driver {
+ const char *name;
+ enum vpn_provider_type type;
+ int (*probe) (struct vpn_provider *provider);
+ int (*remove) (struct vpn_provider *provider);
+ int (*connect) (struct vpn_provider *provider);
+ int (*disconnect) (struct vpn_provider *provider);
+ int (*save) (struct vpn_provider *provider, GKeyFile *keyfile);
+};
+
+int vpn_provider_driver_register(struct vpn_provider_driver *driver);
+void vpn_provider_driver_unregister(struct vpn_provider_driver *driver);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __VPN_PROVIDER_H */