Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / lib / dns / rdata / generic / proforma.c
blobeae71c937ad33bc9a77591715bfa359349a99591
1 /* $NetBSD: proforma.c,v 1.4 2014/12/10 04:37:59 christos Exp $ */
3 /*
4 * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
5 * Copyright (C) 1998-2002 Internet Software Consortium.
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
20 /* Id: proforma.c,v 1.38 2009/12/04 22:06:37 tbox Exp */
22 #ifndef RDATA_GENERIC_#_#_C
23 #define RDATA_GENERIC_#_#_C
25 #define RRTYPE_#_ATTRIBUTES (0)
27 static inline isc_result_t
28 fromtext_#(ARGS_FROMTEXT) {
29 isc_token_t token;
31 REQUIRE(type == #);
32 REQUIRE(rdclass == #);
34 RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
35 ISC_FALSE));
37 return (ISC_R_NOTIMPLEMENTED);
40 static inline isc_result_t
41 totext_#(ARGS_TOTEXT) {
43 REQUIRE(rdata->type == #);
44 REQUIRE(rdata->rdclass == #);
45 REQUIRE(rdata->length != 0); /* XXX */
47 return (ISC_R_NOTIMPLEMENTED);
50 static inline isc_result_t
51 fromwire_#(ARGS_FROMWIRE) {
53 REQUIRE(type == #);
54 REQUIRE(rdclass == #);
56 /* NONE or GLOBAL14 */
57 dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
59 return (ISC_R_NOTIMPLEMENTED);
62 static inline isc_result_t
63 towire_#(ARGS_TOWIRE) {
65 REQUIRE(rdata->type == #);
66 REQUIRE(rdata->rdclass == #);
67 REQUIRE(rdata->length != 0); /* XXX */
69 /* NONE or GLOBAL14 */
70 dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
72 return (ISC_R_NOTIMPLEMENTED);
75 static inline int
76 compare_#(ARGS_COMPARE) {
77 isc_region_t r1;
78 isc_region_t r2;
80 REQUIRE(rdata1->type == rdata2->type);
81 REQUIRE(rdata1->rdclass == rdata2->rdclass);
82 REQUIRE(rdata1->type == #);
83 REQUIRE(rdata1->rdclass == #);
84 REQUIRE(rdata1->length != 0); /* XXX */
85 REQUIRE(rdata2->length != 0); /* XXX */
87 dns_rdata_toregion(rdata1, &r1);
88 dns_rdata_toregion(rdata2, &r2);
89 return (isc_region_compare(&r1, &r2));
92 static inline isc_result_t
93 fromstruct_#(ARGS_FROMSTRUCT) {
94 dns_rdata_#_t *# = source;
96 REQUIRE(type == #);
97 REQUIRE(rdclass == #);
98 REQUIRE(source != NULL);
99 REQUIRE(#->common.rdtype == type);
100 REQUIRE(#->common.rdclass == rdclass);
102 return (ISC_R_NOTIMPLEMENTED);
105 static inline isc_result_t
106 tostruct_#(ARGS_TOSTRUCT) {
108 REQUIRE(rdata->type == #);
109 REQUIRE(rdata->rdclass == #);
110 REQUIRE(rdata->length != 0); /* XXX */
112 return (ISC_R_NOTIMPLEMENTED);
115 static inline void
116 freestruct_#(ARGS_FREESTRUCT) {
117 dns_rdata_#_t *# = source;
119 REQUIRE(source != NULL);
120 REQUIRE(#->common.rdtype == #);
121 REQUIRE(#->common.rdclass == #);
125 static inline isc_result_t
126 additionaldata_#(ARGS_ADDLDATA) {
127 REQUIRE(rdata->type == #);
128 REQUIRE(rdata->rdclass == #);
130 (void)add;
131 (void)arg;
133 return (ISC_R_SUCCESS);
136 static inline isc_result_t
137 digest_#(ARGS_DIGEST) {
138 isc_region_t r;
140 REQUIRE(rdata->type == #);
141 REQUIRE(rdata->rdclass == #);
143 dns_rdata_toregion(rdata, &r);
145 return ((digest)(arg, &r));
148 static inline isc_boolean_t
149 checkowner_#(ARGS_CHECKOWNER) {
151 REQUIRE(type == #);
152 REQUIRE(rdclass == #);
154 UNUSED(name);
155 UNUSED(type);
156 UNUSED(rdclass);
157 UNUSED(wildcard);
159 return (ISC_TRUE);
162 static inline isc_boolean_t
163 checknames_#(ARGS_CHECKNAMES) {
165 REQUIRE(rdata->type == #);
166 REQUIRE(rdata->rdclass == #);
168 UNUSED(rdata);
169 UNUSED(owner);
170 UNUSED(bad);
172 return (ISC_TRUE);
175 static inline int
176 casecompare_#(ARGS_COMPARE) {
177 isc_region_t r1;
178 isc_region_t r2;
180 REQUIRE(rdata1->type == rdata2->type);
181 REQUIRE(rdata1->rdclass == rdata2->rdclass);
182 REQUIRE(rdata1->type == #);
183 REQUIRE(rdata1->rdclass == #);
184 REQUIRE(rdata1->length != 0); /* XXX */
185 REQUIRE(rdata2->length != 0); /* XXX */
187 dns_rdata_toregion(rdata1, &r1);
188 dns_rdata_toregion(rdata2, &r2);
189 return (isc_region_compare(&r1, &r2));
192 #endif /* RDATA_GENERIC_#_#_C */