proforma.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004, 2007, 2009  Internet Systems Consortium, Inc. ("ISC")
00003  * Copyright (C) 1998-2002  Internet Software Consortium.
00004  *
00005  * Permission to use, copy, modify, and/or distribute this software for any
00006  * purpose with or without fee is hereby granted, provided that the above
00007  * copyright notice and this permission notice appear in all copies.
00008  *
00009  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00010  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00011  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00012  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00013  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00014  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00015  * PERFORMANCE OF THIS SOFTWARE.
00016  */
00017 
00018 /* $Id: proforma.c,v 1.38 2009/12/04 22:06:37 tbox Exp $ */
00019 
00020 #ifndef RDATA_GENERIC_#_#_C
00021 #define RDATA_GENERIC_#_#_C
00022 
00023 #define RRTYPE_#_ATTRIBUTES (0)
00024 
00025 static inline isc_result_t
00026 fromtext_#(ARGS_FROMTEXT) {
00027         isc_token_t token;
00028 
00029         REQUIRE(type == #);
00030         REQUIRE(rdclass == #);
00031 
00032         RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
00033                                       ISC_FALSE));
00034 
00035         return (ISC_R_NOTIMPLEMENTED);
00036 }
00037 
00038 static inline isc_result_t
00039 totext_#(ARGS_TOTEXT) {
00040 
00041         REQUIRE(rdata->type == #);
00042         REQUIRE(rdata->rdclass == #);
00043         REQUIRE(rdata->length != 0);    /* XXX */
00044 
00045         return (ISC_R_NOTIMPLEMENTED);
00046 }
00047 
00048 static inline isc_result_t
00049 fromwire_#(ARGS_FROMWIRE) {
00050 
00051         REQUIRE(type == #);
00052         REQUIRE(rdclass == #);
00053 
00054         /* NONE or GLOBAL14 */
00055         dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
00056 
00057         return (ISC_R_NOTIMPLEMENTED);
00058 }
00059 
00060 static inline isc_result_t
00061 towire_#(ARGS_TOWIRE) {
00062 
00063         REQUIRE(rdata->type == #);
00064         REQUIRE(rdata->rdclass == #);
00065         REQUIRE(rdata->length != 0);    /* XXX */
00066 
00067         /* NONE or GLOBAL14 */
00068         dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
00069 
00070         return (ISC_R_NOTIMPLEMENTED);
00071 }
00072 
00073 static inline int
00074 compare_#(ARGS_COMPARE) {
00075         isc_region_t r1;
00076         isc_region_t r2;
00077 
00078         REQUIRE(rdata1->type == rdata2->type);
00079         REQUIRE(rdata1->rdclass == rdata2->rdclass);
00080         REQUIRE(rdata1->type == #);
00081         REQUIRE(rdata1->rdclass == #);
00082         REQUIRE(rdata1->length != 0);   /* XXX */
00083         REQUIRE(rdata2->length != 0);   /* XXX */
00084 
00085         dns_rdata_toregion(rdata1, &r1);
00086         dns_rdata_toregion(rdata2, &r2);
00087         return (isc_region_compare(&r1, &r2));
00088 }
00089 
00090 static inline isc_result_t
00091 fromstruct_#(ARGS_FROMSTRUCT) {
00092         dns_rdata_#_t *# = source;
00093 
00094         REQUIRE(type == #);
00095         REQUIRE(rdclass == #);
00096         REQUIRE(source != NULL);
00097         REQUIRE(#->common.rdtype == type);
00098         REQUIRE(#->common.rdclass == rdclass);
00099 
00100         return (ISC_R_NOTIMPLEMENTED);
00101 }
00102 
00103 static inline isc_result_t
00104 tostruct_#(ARGS_TOSTRUCT) {
00105 
00106         REQUIRE(rdata->type == #);
00107         REQUIRE(rdata->rdclass == #);
00108         REQUIRE(rdata->length != 0);    /* XXX */
00109 
00110         return (ISC_R_NOTIMPLEMENTED);
00111 }
00112 
00113 static inline void
00114 freestruct_#(ARGS_FREESTRUCT) {
00115         dns_rdata_#_t *# = source;
00116 
00117         REQUIRE(source != NULL);
00118         REQUIRE(#->common.rdtype == #);
00119         REQUIRE(#->common.rdclass == #);
00120 
00121 }
00122 
00123 static inline isc_result_t
00124 additionaldata_#(ARGS_ADDLDATA) {
00125         REQUIRE(rdata->type == #);
00126         REQUIRE(rdata->rdclass == #);
00127 
00128         (void)add;
00129         (void)arg;
00130 
00131         return (ISC_R_SUCCESS);
00132 }
00133 
00134 static inline isc_result_t
00135 digest_#(ARGS_DIGEST) {
00136         isc_region_t r;
00137 
00138         REQUIRE(rdata->type == #);
00139         REQUIRE(rdata->rdclass == #);
00140 
00141         dns_rdata_toregion(rdata, &r);
00142 
00143         return ((digest)(arg, &r));
00144 }
00145 
00146 static inline isc_boolean_t
00147 checkowner_#(ARGS_CHECKOWNER) {
00148 
00149         REQUIRE(type == #);
00150         REQUIRE(rdclass == #);
00151 
00152         UNUSED(name);
00153         UNUSED(type);
00154         UNUSED(rdclass);
00155         UNUSED(wildcard);
00156 
00157         return (ISC_TRUE);
00158 }
00159 
00160 static inline isc_boolean_t
00161 checknames_#(ARGS_CHECKNAMES) {
00162 
00163         REQUIRE(rdata->type == #);
00164         REQUIRE(rdata->rdclass == #);
00165 
00166         UNUSED(rdata);
00167         UNUSED(owner);
00168         UNUSED(bad);
00169 
00170         return (ISC_TRUE);
00171 }
00172 
00173 static inline int
00174 casecompare_#(ARGS_COMPARE) {
00175         isc_region_t r1;
00176         isc_region_t r2;
00177 
00178         REQUIRE(rdata1->type == rdata2->type);
00179         REQUIRE(rdata1->rdclass == rdata2->rdclass);
00180         REQUIRE(rdata1->type == #);
00181         REQUIRE(rdata1->rdclass == #);
00182         REQUIRE(rdata1->length != 0);   /* XXX */
00183         REQUIRE(rdata2->length != 0);   /* XXX */
00184 
00185         dns_rdata_toregion(rdata1, &r1);
00186         dns_rdata_toregion(rdata2, &r2);
00187         return (isc_region_compare(&r1, &r2));
00188 }
00189 
00190 #endif  /* RDATA_GENERIC_#_#_C */

Generated on Tue Apr 28 17:41:00 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha