daemon: Flush shunts before unloading plugins
[strongswan.git] / src / libstrongswan / resolver / resolver_manager.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 resolver_manager resolver_manager
18 * @{ @ingroup resolver
19 */
20
21 #ifndef RESOLVER_MANAGER_H_
22 #define RESOLVER_MANAGER_H_
23
24 typedef struct resolver_manager_t resolver_manager_t;
25
26 #include <resolver/resolver.h>
27
28 /**
29 * The resolver_manager manages the resolver implementations and
30 * creates instances of them.
31 *
32 * A resolver plugin is registered by providing its constructor function
33 * to the manager. The manager creates instances of the resolver plugin
34 * using the registered constructor function.
35 */
36 struct resolver_manager_t {
37
38 /**
39 * Register a resolver implementation.
40 *
41 * @param constructor resolver constructor function
42 */
43 void (*add_resolver)(resolver_manager_t *this,
44 resolver_constructor_t constructor);
45
46 /**
47 * Unregister a previously registered resolver implementation.
48 *
49 * @param constructor resolver constructor function to unregister
50 */
51 void (*remove_resolver)(resolver_manager_t *this,
52 resolver_constructor_t constructor);
53
54 /**
55 * Get a new resolver instance.
56 *
57 * @return resolver instance.
58 */
59 resolver_t* (*create)(resolver_manager_t *this);
60
61 /**
62 * Destroy a resolver_manager instance.
63 */
64 void (*destroy)(resolver_manager_t *this);
65 };
66
67 /**
68 * Create a resolver_manager instance.
69 */
70 resolver_manager_t *resolver_manager_create();
71
72 #endif /** RESOLVER_MANAGER_H_ @}*/