Annotation of embedaddon/strongswan/src/libcharon/plugins/socket_dynamic/socket_dynamic_plugin.c, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (C) 2010 Tobias Brunner
3: * HSR Hochschule fuer Technik Rapperswil
4: * Copyright (C) 2010 Martin Willi
5: * Copyright (C) 2010 revosec AG
6: *
7: * This program is free software; you can redistribute it and/or modify it
8: * under the terms of the GNU General Public License as published by the
9: * Free Software Foundation; either version 2 of the License, or (at your
10: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11: *
12: * This program is distributed in the hope that it will be useful, but
13: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: */
17:
18: #include "socket_dynamic_plugin.h"
19:
20: #include "socket_dynamic_socket.h"
21:
22: #include <daemon.h>
23:
24: typedef struct private_socket_dynamic_plugin_t private_socket_dynamic_plugin_t;
25:
26: /**
27: * Private data of socket plugin
28: */
29: struct private_socket_dynamic_plugin_t {
30:
31: /**
32: * Implements plugin interface
33: */
34: socket_dynamic_plugin_t public;
35: };
36:
37: METHOD(plugin_t, get_features, int,
38: private_socket_dynamic_plugin_t *this, plugin_feature_t *features[])
39: {
40: static plugin_feature_t f[] = {
41: PLUGIN_CALLBACK(socket_register, socket_dynamic_socket_create),
42: PLUGIN_PROVIDE(CUSTOM, "socket"),
43: PLUGIN_SDEPEND(CUSTOM, "kernel-ipsec"),
44: };
45: *features = f;
46: return countof(f);
47: }
48:
49: METHOD(plugin_t, get_name, char*,
50: private_socket_dynamic_plugin_t *this)
51: {
52: return "socket-dynamic";
53: }
54:
55: METHOD(plugin_t, destroy, void,
56: private_socket_dynamic_plugin_t *this)
57: {
58: free(this);
59: }
60:
61: /*
62: * see header file
63: */
64: plugin_t *socket_dynamic_plugin_create()
65: {
66: private_socket_dynamic_plugin_t *this;
67:
68: INIT(this,
69: .public = {
70: .plugin = {
71: .get_name = _get_name,
72: .get_features = _get_features,
73: .destroy = _destroy,
74: },
75: },
76: );
77:
78: return &this->public.plugin;
79: }
80:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>