Merge from vendor branch CVS:
[dragonfly.git] / contrib / bind-9.2.4rc7 / lib / dns / include / dns / rcode.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: rcode.h,v 1.12.2.1 2004/03/09 06:11:20 marka Exp $ */
19
20 #ifndef DNS_RCODE_H
21 #define DNS_RCODE_H 1
22
23 #include <isc/lang.h>
24
25 #include <dns/types.h>
26
27 ISC_LANG_BEGINDECLS
28
29 isc_result_t dns_rcode_fromtext(dns_rcode_t *rcodep, isc_textregion_t *source);
30 /*
31  * Convert the text 'source' refers to into a DNS error value.
32  *
33  * Requires:
34  *      'rcodep' is a valid pointer.
35  *
36  *      'source' is a valid text region.
37  *
38  * Returns:
39  *      ISC_R_SUCCESS                   on success
40  *      DNS_R_UNKNOWN                   type is unknown
41  */
42
43 isc_result_t dns_rcode_totext(dns_rcode_t rcode, isc_buffer_t *target);
44 /*
45  * Put a textual representation of error 'rcode' into 'target'.
46  *
47  * Requires:
48  *      'rcode' is a valid rcode.
49  *
50  *      'target' is a valid text buffer.
51  *
52  * Ensures:
53  *      If the result is success:
54  *              The used space in 'target' is updated.
55  *
56  * Returns:
57  *      ISC_R_SUCCESS                   on success
58  *      ISC_R_NOSPACE                   target buffer is too small
59  */
60
61 isc_result_t dns_tsigrcode_fromtext(dns_rcode_t *rcodep,
62                                     isc_textregion_t *source);
63 /*
64  * Convert the text 'source' refers to into a TSIG/TKEY error value.
65  *
66  * Requires:
67  *      'rcodep' is a valid pointer.
68  *
69  *      'source' is a valid text region.
70  *
71  * Returns:
72  *      ISC_R_SUCCESS                   on success
73  *      DNS_R_UNKNOWN                   type is unknown
74  */
75
76 isc_result_t dns_tsigrcode_totext(dns_rcode_t rcode, isc_buffer_t *target);
77 /*
78  * Put a textual representation of TSIG/TKEY error 'rcode' into 'target'.
79  *
80  * Requires:
81  *      'rcode' is a valid TSIG/TKEY error code.
82  *
83  *      'target' is a valid text buffer.
84  *
85  * Ensures:
86  *      If the result is success:
87  *              The used space in 'target' is updated.
88  *
89  * Returns:
90  *      ISC_R_SUCCESS                   on success
91  *      ISC_R_NOSPACE                   target buffer is too small
92  */
93
94 ISC_LANG_ENDDECLS
95
96 #endif /* DNS_RCODE_H */