Added unbound plugin implementing the resolver interface using libunbound
[strongswan.git] / src / libstrongswan / plugins / unbound / unbound_resolver.c
1 /*
2 * Copyright (C) 2011-2012 Reto Guadagnini
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 <string.h>
17
18 #include <library.h>
19 #include <utils/debug.h>
20
21 #include "unbound_resolver.h"
22
23 typedef struct private_resolver_t private_resolver_t;
24
25 /**
26 * private data of a unbound_resolver_t object.
27 */
28 struct private_resolver_t {
29
30 /**
31 * Public data
32 */
33 resolver_t public;
34 };
35
36 /**
37 * query method implementation
38 */
39 METHOD(resolver_t, query, resolver_response_t*,
40 private_resolver_t *this, char *domain, rr_class_t rr_class,
41 rr_type_t rr_type)
42 {
43 /* TODO: Implement */
44 return NULL;
45 }
46
47 /**
48 * destroy method implementation
49 */
50 METHOD(resolver_t, destroy, void,
51 private_resolver_t *this)
52 {
53 free(this);
54 }
55
56 /*
57 * Described in header.
58 */
59 resolver_t *unbound_resolver_create()
60 {
61 private_resolver_t *this;
62
63 INIT(this,
64 .public = {
65 .query = _query,
66 .destroy = _destroy,
67 },
68 );
69
70 /* TODO: Implement */
71 destroy(this);
72 return NULL;
73 }
74