Removed backend for old Android frontend patch
[strongswan.git] / src / libcharon / plugins / android_dns / android_dns_plugin.c
1 /*
2 * Copyright (C) 2010-2013 Tobias Brunner
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 "android_dns_plugin.h"
17 #include "android_dns_handler.h"
18
19 #include <hydra.h>
20 #include <daemon.h>
21
22 typedef struct private_android_dns_plugin_t private_android_dns_plugin_t;
23
24 /**
25 * Private data of an android_dns_plugin_t object.
26 */
27 struct private_android_dns_plugin_t {
28
29 /**
30 * Public interface
31 */
32 android_dns_plugin_t public;
33
34 /**
35 * Android specific DNS handler
36 */
37 android_dns_handler_t *handler;
38 };
39
40 METHOD(plugin_t, get_name, char*,
41 private_android_dns_plugin_t *this)
42 {
43 return "android-dns";
44 }
45
46 METHOD(plugin_t, destroy, void,
47 private_android_dns_plugin_t *this)
48 {
49 hydra->attributes->remove_handler(hydra->attributes,
50 &this->handler->handler);
51 this->handler->destroy(this->handler);
52 free(this);
53 }
54
55 /**
56 * See header
57 */
58 plugin_t *android_dns_plugin_create()
59 {
60 private_android_dns_plugin_t *this;
61
62 INIT(this,
63 .public = {
64 .plugin = {
65 .get_name = _get_name,
66 .reload = (void*)return_false,
67 .destroy = _destroy,
68 },
69 },
70 .handler = android_dns_handler_create(),
71 );
72
73 hydra->attributes->add_handler(hydra->attributes, &this->handler->handler);
74
75 return &this->public.plugin;
76 }