daemon: Flush shunts before unloading plugins
[strongswan.git] / src / libstrongswan / resolver / resolver.h
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 /**
17 * @defgroup resolveri resolver
18 * @{ @ingroup resolver
19 */
20
21 #ifndef RESOLVER_H_
22 #define RESOLVER_H_
23
24 typedef struct resolver_t resolver_t;
25
26 /**
27 * Constructor function which creates DNS resolver instances.
28 */
29 typedef resolver_t* (*resolver_constructor_t)(void);
30
31 #include <resolver/resolver_response.h>
32 #include <resolver/rr_set.h>
33 #include <resolver/rr.h>
34
35 /**
36 * Interface of a security-aware DNS resolver.
37 *
38 */
39 struct resolver_t {
40
41 /**
42 * Perform a DNS query.
43 *
44 * @param domain domain (FQDN) to query
45 * @param rr_class class of the desired RRs
46 * @param rr_type type of the desired RRs
47 * @return response to the query, NULL on failure
48 */
49 resolver_response_t *(*query)(resolver_t *this, char *domain,
50 rr_class_t rr_class, rr_type_t rr_type);
51
52 /**
53 * Destroy the resolver instance.
54 */
55 void (*destroy)(resolver_t *this);
56 };
57
58 #endif /** RESOLVER_H_ @}*/