363aaf00395ddf790956f81b9dccc5ad967ba158
[strongswan.git] / src / libcharon / plugins / xauth_pam / xauth_pam_plugin.c
1 /*
2 * Copyright (C) 2012 Martin Willi
3 * Copyright (C) 2012 revosec AG
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_pam_plugin.h"
17 #include "xauth_pam.h"
18
19 #include <daemon.h>
20
21 METHOD(plugin_t, get_name, char*,
22 xauth_pam_plugin_t *this)
23 {
24 return "xauth-pam";
25 }
26
27 METHOD(plugin_t, get_features, int,
28 xauth_pam_plugin_t *this, plugin_feature_t *features[])
29 {
30 static plugin_feature_t f[] = {
31 PLUGIN_CALLBACK(xauth_method_register, xauth_pam_create_server),
32 PLUGIN_PROVIDE(XAUTH_SERVER, "pam"),
33 };
34 *features = f;
35 return countof(f);
36 }
37
38 METHOD(plugin_t, destroy, void,
39 xauth_pam_plugin_t *this)
40 {
41 free(this);
42 }
43
44 /*
45 * see header file
46 */
47 plugin_t *xauth_pam_plugin_create()
48 {
49 xauth_pam_plugin_t *this;
50
51 INIT(this,
52 .plugin = {
53 .get_name = _get_name,
54 .get_features = _get_features,
55 .destroy = _destroy,
56 },
57 );
58
59 return &this->plugin;
60 }