Merge from vendor branch LESS:
[dragonfly.git] / contrib / bind-9.3 / lib / dns / include / dns / rdatalist.h
1 /*
2  * Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 1999-2001  Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15  * PERFORMANCE OF THIS SOFTWARE.
16  */
17
18 /* $Id: rdatalist.h,v 1.13.206.1 2004/03/06 08:13:59 marka Exp $ */
19
20 #ifndef DNS_RDATALIST_H
21 #define DNS_RDATALIST_H 1
22
23 /*****
24  ***** Module Info
25  *****/
26
27 /*
28  * DNS Rdatalist
29  *
30  * A DNS rdatalist is a list of rdata of a common type and class.
31  *
32  * MP:
33  *      Clients of this module must impose any required synchronization.
34  *
35  * Reliability:
36  *      No anticipated impact.
37  *
38  * Resources:
39  *      <TBS>
40  *
41  * Security:
42  *      No anticipated impact.
43  *
44  * Standards:
45  *      None.
46  */
47
48 #include <isc/lang.h>
49
50 #include <dns/types.h>
51
52 /*
53  * Clients may use this type directly.
54  */
55 struct dns_rdatalist {
56         dns_rdataclass_t                rdclass;
57         dns_rdatatype_t                 type;
58         dns_rdatatype_t                 covers;
59         dns_ttl_t                       ttl;
60         ISC_LIST(dns_rdata_t)           rdata;
61         ISC_LINK(dns_rdatalist_t)       link;
62 };
63
64 ISC_LANG_BEGINDECLS
65
66 void
67 dns_rdatalist_init(dns_rdatalist_t *rdatalist);
68 /*
69  * Initialize rdatalist.
70  *
71  * Ensures:
72  *      All fields of rdatalist have been initialized to their default
73  *      values.
74  */
75
76 isc_result_t
77 dns_rdatalist_tordataset(dns_rdatalist_t *rdatalist,
78                          dns_rdataset_t *rdataset);
79 /*
80  * Make 'rdataset' refer to the rdata in 'rdatalist'.
81  *
82  * Note:
83  *      The caller must ensure that 'rdatalist' remains valid and unchanged
84  *      while 'rdataset' is associated with it.
85  *
86  * Requires:
87  *
88  *      'rdatalist' is a valid rdatalist.
89  *
90  *      'rdataset' is a valid rdataset that is not currently associated with
91  *      any rdata.
92  *
93  * Ensures:
94  *      On success,
95  *
96  *              'rdataset' is associated with the rdata in rdatalist.
97  *
98  * Returns:
99  *      ISC_R_SUCCESS
100  */
101
102 ISC_LANG_ENDDECLS
103
104 #endif /* DNS_RDATALIST_H */