2 * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1998-2002 Internet Software Consortium.
5 * Permission to use, copy, modify, and/or 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.
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.
18 /* $Id: proforma.c,v 1.36 2007/06/19 23:47:17 tbox Exp $ */
20 #ifndef RDATA_GENERIC_#_#_C
21 #define RDATA_GENERIC_#_#_C
23 #define RRTYPE_#_ATTRIBUTES (0)
25 static inline isc_result_t
26 fromtext_
#(ARGS_FROMTEXT) {
30 REQUIRE(rdclass
== #);
32 RETERR(isc_lex_getmastertoken(lexer
, &token
, isc_tokentype_string
,
35 return (ISC_R_NOTIMPLEMENTED
);
38 static inline isc_result_t
39 totext_
#(ARGS_TOTEXT) {
41 REQUIRE(rdata
->type
== #);
42 REQUIRE(rdata
->rdclass
== #);
43 REQUIRE(rdata
->length
!= 0); /* XXX */
45 return (ISC_R_NOTIMPLEMENTED
);
48 static inline isc_result_t
49 fromwire_
#(ARGS_FROMWIRE) {
52 REQUIRE(rdclass
== #);
54 /* NONE or GLOBAL14 */
55 dns_decompress_setmethods(dctx
, DNS_COMPRESS_NONE
);
57 return (ISC_R_NOTIMPLEMENTED
);
60 static inline isc_result_t
61 towire_
#(ARGS_TOWIRE) {
63 REQUIRE(rdata
->type
== #);
64 REQUIRE(rdata
->rdclass
== #);
65 REQUIRE(rdata
->length
!= 0); /* XXX */
67 /* NONE or GLOBAL14 */
68 dns_compress_setmethods(cctx
, DNS_COMPRESS_NONE
);
70 return (ISC_R_NOTIMPLEMENTED
);
74 compare_
#(ARGS_COMPARE) {
78 REQUIRE(rdata1
->type
== rdata2
->type
);
79 REQUIRE(rdata1
->rdclass
== rdata2
->rdclass
);
80 REQUIRE(rdata1
->type
== #);
81 REQUIRE(rdata1
->rdclass
== #);
82 REQUIRE(rdata1
->length
!= 0); /* XXX */
83 REQUIRE(rdata2
->length
!= 0); /* XXX */
85 dns_rdata_toregion(rdata1
, &r1
);
86 dns_rdata_toregion(rdata2
, &r2
);
87 return (isc_region_compare(&r1
, &r2
));
90 static inline isc_result_t
91 fromstruct_
#(ARGS_FROMSTRUCT) {
92 dns_rdata_
#_t *# = source;
95 REQUIRE(rdclass
== #);
96 REQUIRE(source
!= NULL
);
97 REQUIRE(#->common.rdtype == type);
98 REQUIRE(#->common.rdclass == rdclass);
100 return (ISC_R_NOTIMPLEMENTED
);
103 static inline isc_result_t
104 tostruct_
#(ARGS_TOSTRUCT) {
106 REQUIRE(rdata
->type
== #);
107 REQUIRE(rdata
->rdclass
== #);
108 REQUIRE(rdata
->length
!= 0); /* XXX */
110 return (ISC_R_NOTIMPLEMENTED
);
114 freestruct_
#(ARGS_FREESTRUCT) {
115 dns_rdata_
#_t *# = source;
117 REQUIRE(source
!= NULL
);
118 REQUIRE(#->common.rdtype == #);
119 REQUIRE(#->common.rdclass == #);
123 static inline isc_result_t
124 additionaldata_
#(ARGS_ADDLDATA) {
125 REQUIRE(rdata
->type
== #);
126 REQUIRE(rdata
->rdclass
== #);
131 return (ISC_R_SUCCESS
);
134 static inline isc_result_t
135 digest_
#(ARGS_DIGEST) {
138 REQUIRE(rdata
->type
== #);
139 REQUIRE(rdata
->rdclass
== #);
141 dns_rdata_toregion(rdata
, &r
);
143 return ((digest
)(arg
, &r
));
146 static inline isc_boolean_t
147 checkowner_
#(ARGS_CHECKOWNER) {
150 REQUIRE(rdclass
== #);
160 static inline isc_boolean_t
161 checknames_
#(ARGS_CHECKNAMES) {
163 REQUIRE(rdata
->type
== #);
164 REQUIRE(rdata
->rdclass
== #);
173 #endif /* RDATA_GENERIC_#_#_C */