daemon: Flush shunts before unloading plugins
[strongswan.git] / src / libstrongswan / resolver / rr_set.h
1 /*
2 * Copyright (C) 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 rr_set rr_set
18 * @{ @ingroup resolver
19 */
20
21 #ifndef RR_SET_H_
22 #define RR_SET_H_
23
24 typedef struct rr_set_t rr_set_t;
25
26 #include <library.h>
27 #include <collections/enumerator.h>
28 #include <collections/linked_list.h>
29
30 /**
31 * A set of DNS Resource Records.
32 *
33 * Represents a RRset as defined in RFC 2181. This RRset consists of a set of
34 * Resource Records with the same label, class and type but different data.
35 *
36 * The DNSSEC signature Resource Records (RRSIGs) which sign the RRs of this set
37 * are also part of an object of this type.
38 */
39 struct rr_set_t {
40
41 /**
42 * Create an enumerator over all Resource Records of this RRset.
43 *
44 * @note The enumerator's position is invalid before the first call
45 * to enumerate().
46 *
47 * @return enumerator over Resource Records
48 */
49 enumerator_t *(*create_rr_enumerator)(rr_set_t *this);
50
51 /**
52 * Create an enumerator over all RRSIGs of this RRset
53 *
54 * @note The enumerator's position is invalid before the first call
55 * to enumerate().
56 *
57 * @return enumerator over RRSIG Resource Records,
58 * NULL if there are no RRSIGs for this RRset
59 */
60 enumerator_t *(*create_rrsig_enumerator)(rr_set_t *this);
61
62 /**
63 * Destroy this RRset with all its Resource Records.
64 */
65 void (*destroy) (rr_set_t *this);
66 };
67
68 /**
69 * Create an rr_set instance.
70 *
71 * @param list_of_rr list of Resource Records which form this RRset
72 * @param list_of_rrsig list of the signatures (RRSIGs) of the
73 * Resource Records of this set
74 * @return Resource Record set, NULL on failure
75 */
76 rr_set_t *rr_set_create(linked_list_t *list_of_rr,
77 linked_list_t *list_of_rrsig);
78
79 #endif /** RR_SET_H_ @}*/