28ea7af8d5f5561627ccff01b83c62071d271821
[strongswan.git] / src / libcharon / plugins / xauth_null / xauth_null_plugin.c
1 /*
2 * Copyright (C) 2008 Martin Willi
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 #include "xauth_null_plugin.h"
17 #include "xauth_null.h"
18
19 #include <daemon.h>
20
21 METHOD(plugin_t, get_name, char*,
22 xauth_null_plugin_t *this)
23 {
24 return "xauth-null";
25 }
26
27 METHOD(plugin_t, get_features, int,
28 xauth_null_plugin_t *this, plugin_feature_t *features[])
29 {
30 static plugin_feature_t f[] = {
31 PLUGIN_CALLBACK(xauth_method_register, xauth_null_create_server),
32 PLUGIN_PROVIDE(XAUTH_SERVER, "null"),
33 PLUGIN_CALLBACK(xauth_method_register, xauth_null_create_peer),
34 PLUGIN_PROVIDE(XAUTH_PEER, "null"),
35 };
36 *features = f;
37 return countof(f);
38 }
39
40 METHOD(plugin_t, destroy, void,
41 xauth_null_plugin_t *this)
42 {
43 free(this);
44 }
45
46 /*
47 * see header file
48 */
49 plugin_t *xauth_null_plugin_create()
50 {
51 xauth_null_plugin_t *this;
52
53 INIT(this,
54 .plugin = {
55 .get_name = _get_name,
56 .get_features = _get_features,
57 .destroy = _destroy,
58 },
59 );
60
61 return &this->plugin;
62 }