aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/xauth_generic/xauth_generic_plugin.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2011-12-12 18:26:26 +0100
committerTobias Brunner <tobias@strongswan.org>2012-03-20 17:31:17 +0100
commit3d44d735c649559b9768ae635a6bee7fec932902 (patch)
treea83022a6186310b80f35b112ce38ab5644afca1b /src/libcharon/plugins/xauth_generic/xauth_generic_plugin.c
parent41e1e435d9c70c28c3e38074d34c43e639ae79e6 (diff)
downloadstrongswan-3d44d735c649559b9768ae635a6bee7fec932902.tar.bz2
strongswan-3d44d735c649559b9768ae635a6bee7fec932902.tar.xz
Added generic XAuth backend, using secrets provided by credential sets.
Diffstat (limited to 'src/libcharon/plugins/xauth_generic/xauth_generic_plugin.c')
-rw-r--r--src/libcharon/plugins/xauth_generic/xauth_generic_plugin.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/libcharon/plugins/xauth_generic/xauth_generic_plugin.c b/src/libcharon/plugins/xauth_generic/xauth_generic_plugin.c
new file mode 100644
index 000000000..a87084e20
--- /dev/null
+++ b/src/libcharon/plugins/xauth_generic/xauth_generic_plugin.c
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2011 Tobias Brunner
+ * Hochschule fuer Technik Rapperswil
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * 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.
+ */
+
+#include "xauth_generic_plugin.h"
+#include "xauth_generic.h"
+
+#include <daemon.h>
+
+METHOD(plugin_t, get_name, char*,
+ xauth_generic_plugin_t *this)
+{
+ return "xauth-generic";
+}
+
+METHOD(plugin_t, get_features, int,
+ xauth_generic_plugin_t *this, plugin_feature_t *features[])
+{
+ static plugin_feature_t f[] = {
+ PLUGIN_CALLBACK(xauth_method_register, xauth_generic_create_server),
+ PLUGIN_PROVIDE(XAUTH_SERVER, "generic"),
+ PLUGIN_CALLBACK(xauth_method_register, xauth_generic_create_peer),
+ PLUGIN_PROVIDE(XAUTH_PEER, "generic"),
+ };
+ *features = f;
+ return countof(f);
+}
+
+METHOD(plugin_t, destroy, void,
+ xauth_generic_plugin_t *this)
+{
+ free(this);
+}
+
+/*
+ * see header file
+ */
+plugin_t *xauth_generic_plugin_create()
+{
+ xauth_generic_plugin_t *this;
+
+ INIT(this,
+ .plugin = {
+ .get_name = _get_name,
+ .get_features = _get_features,
+ .destroy = _destroy,
+ },
+ );
+
+ return &this->plugin;
+}