8a6298a57bca6fd32244e74975cee0f977d5c062
[strongswan.git] / src / libcharon / plugins / tnccs_dynamic / tnccs_dynamic_plugin.c
1 /*
2 * Copyright (C) 2011 Andreas Steffen
3 * HSR 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 "tnccs_dynamic_plugin.h"
17 #include "tnccs_dynamic.h"
18
19 #include <daemon.h>
20
21 METHOD(plugin_t, get_name, char*,
22 tnccs_dynamic_plugin_t *this)
23 {
24 return "tnccs-dynamic";
25 }
26
27 METHOD(plugin_t, get_features, int,
28 tnccs_dynamic_plugin_t *this, plugin_feature_t *features[])
29 {
30 static plugin_feature_t f[] = {
31 PLUGIN_CALLBACK(tnccs_method_register, tnccs_dynamic_create),
32 PLUGIN_PROVIDE(CUSTOM, "tnccs-dynamic"),
33 PLUGIN_DEPENDS(CUSTOM, "tnccs-1.1"),
34 PLUGIN_DEPENDS(CUSTOM, "tnccs-2.0"),
35 PLUGIN_DEPENDS(EAP_SERVER, EAP_TNC),
36 PLUGIN_DEPENDS(EAP_PEER, EAP_TNC),
37 };
38 *features = f;
39 return countof(f);
40 }
41
42 METHOD(plugin_t, destroy, void,
43 tnccs_dynamic_plugin_t *this)
44 {
45 free(this);
46 }
47
48 /*
49 * see header file
50 */
51 plugin_t *tnccs_dynamic_plugin_create()
52 {
53 tnccs_dynamic_plugin_t *this;
54
55 INIT(this,
56 .plugin = {
57 .get_name = _get_name,
58 .get_features = _get_features,
59 .destroy = _destroy,
60 },
61 );
62
63 return &this->plugin;
64 }
65