1 /* $NetBSD: proforma.c,v 1.4 2014/12/10 04:37:59 christos Exp $ */
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) {
32 REQUIRE(rdclass
== #);
34 RETERR(isc_lex_getmastertoken(lexer
, &token
, isc_tokentype_string
,
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) {
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
);
76 compare_
#(ARGS_COMPARE) {
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;
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
);
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
== #);
133 return (ISC_R_SUCCESS
);
136 static inline isc_result_t
137 digest_
#(ARGS_DIGEST) {
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) {
152 REQUIRE(rdclass
== #);
162 static inline isc_boolean_t
163 checknames_
#(ARGS_CHECKNAMES) {
165 REQUIRE(rdata
->type
== #);
166 REQUIRE(rdata
->rdclass
== #);
176 casecompare_
#(ARGS_COMPARE) {
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 */