Annotation of src/external/mpl/bind/dist/lib/dns/rdata/generic/ta_32768.c, Revision 1.1.1.6
1.1 christos 1: /* $NetBSD$ */
2:
3: /*
4: * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
5: *
6: * This Source Code Form is subject to the terms of the Mozilla Public
7: * License, v. 2.0. If a copy of the MPL was not distributed with this
1.1.1.5 christos 8: * file, you can obtain one at https://mozilla.org/MPL/2.0/.
1.1 christos 9: *
10: * See the COPYRIGHT file distributed with this work for additional
11: * information regarding copyright ownership.
12: */
13:
14: /* http://www.watson.org/~weiler/INI1999-19.pdf */
15:
16: #ifndef RDATA_GENERIC_TA_32768_C
17: #define RDATA_GENERIC_TA_32768_C
18:
19: #define RRTYPE_TA_ATTRIBUTES 0
20:
21: static inline isc_result_t
22: fromtext_ta(ARGS_FROMTEXT) {
23: REQUIRE(type == dns_rdatatype_ta);
24:
1.1.1.6 ! christos 25: return (generic_fromtext_ds(CALL_FROMTEXT));
1.1 christos 26: }
27:
28: static inline isc_result_t
29: totext_ta(ARGS_TOTEXT) {
30: REQUIRE(rdata->type == dns_rdatatype_ta);
31:
1.1.1.6 ! christos 32: return (generic_totext_ds(CALL_TOTEXT));
1.1 christos 33: }
34:
35: static inline isc_result_t
36: fromwire_ta(ARGS_FROMWIRE) {
37: REQUIRE(type == dns_rdatatype_ta);
38:
1.1.1.6 ! christos 39: return (generic_fromwire_ds(CALL_FROMWIRE));
1.1 christos 40: }
41:
42: static inline isc_result_t
43: towire_ta(ARGS_TOWIRE) {
44: isc_region_t sr;
45:
46: REQUIRE(rdata->type == dns_rdatatype_ta);
47: REQUIRE(rdata->length != 0);
48:
49: UNUSED(cctx);
50:
51: dns_rdata_toregion(rdata, &sr);
52: return (mem_tobuffer(target, sr.base, sr.length));
53: }
54:
55: static inline int
56: compare_ta(ARGS_COMPARE) {
57: isc_region_t r1;
58: isc_region_t r2;
59:
60: REQUIRE(rdata1->type == rdata2->type);
61: REQUIRE(rdata1->rdclass == rdata2->rdclass);
62: REQUIRE(rdata1->type == dns_rdatatype_ta);
63: REQUIRE(rdata1->length != 0);
64: REQUIRE(rdata2->length != 0);
65:
66: dns_rdata_toregion(rdata1, &r1);
67: dns_rdata_toregion(rdata2, &r2);
68: return (isc_region_compare(&r1, &r2));
69: }
70:
71: static inline isc_result_t
72: fromstruct_ta(ARGS_FROMSTRUCT) {
73: REQUIRE(type == dns_rdatatype_ta);
74:
1.1.1.6 ! christos 75: return (generic_fromstruct_ds(CALL_FROMSTRUCT));
1.1 christos 76: }
77:
78: static inline isc_result_t
79: tostruct_ta(ARGS_TOSTRUCT) {
80: dns_rdata_ds_t *ds = target;
81:
82: REQUIRE(rdata->type == dns_rdatatype_ta);
1.1.1.3 christos 83: REQUIRE(ds != NULL);
1.1 christos 84:
85: /*
86: * Checked by generic_tostruct_ds().
87: */
88: ds->common.rdclass = rdata->rdclass;
89: ds->common.rdtype = rdata->type;
90: ISC_LINK_INIT(&ds->common, link);
91:
1.1.1.6 ! christos 92: return (generic_tostruct_ds(CALL_TOSTRUCT));
1.1 christos 93: }
94:
95: static inline void
96: freestruct_ta(ARGS_FREESTRUCT) {
97: dns_rdata_ta_t *ds = source;
98:
99: REQUIRE(ds != NULL);
100: REQUIRE(ds->common.rdtype == dns_rdatatype_ta);
101:
1.1.1.4 christos 102: if (ds->mctx == NULL) {
1.1 christos 103: return;
1.1.1.4 christos 104: }
1.1 christos 105:
1.1.1.4 christos 106: if (ds->digest != NULL) {
1.1 christos 107: isc_mem_free(ds->mctx, ds->digest);
1.1.1.4 christos 108: }
1.1 christos 109: ds->mctx = NULL;
110: }
111:
112: static inline isc_result_t
113: additionaldata_ta(ARGS_ADDLDATA) {
114: REQUIRE(rdata->type == dns_rdatatype_ta);
115:
116: UNUSED(rdata);
117: UNUSED(add);
118: UNUSED(arg);
119:
120: return (ISC_R_SUCCESS);
121: }
122:
123: static inline isc_result_t
124: digest_ta(ARGS_DIGEST) {
125: isc_region_t r;
126:
127: REQUIRE(rdata->type == dns_rdatatype_ta);
128:
129: dns_rdata_toregion(rdata, &r);
130:
131: return ((digest)(arg, &r));
132: }
133:
1.1.1.2 christos 134: static inline bool
1.1 christos 135: checkowner_ta(ARGS_CHECKOWNER) {
136: REQUIRE(type == dns_rdatatype_ta);
137:
138: UNUSED(name);
139: UNUSED(type);
140: UNUSED(rdclass);
141: UNUSED(wildcard);
142:
1.1.1.2 christos 143: return (true);
1.1 christos 144: }
145:
1.1.1.2 christos 146: static inline bool
1.1 christos 147: checknames_ta(ARGS_CHECKNAMES) {
148: REQUIRE(rdata->type == dns_rdatatype_ta);
149:
150: UNUSED(rdata);
151: UNUSED(owner);
152: UNUSED(bad);
153:
1.1.1.2 christos 154: return (true);
1.1 christos 155: }
156:
157: static inline int
158: casecompare_ta(ARGS_COMPARE) {
159: return (compare_ta(rdata1, rdata2));
160: }
161:
1.1.1.4 christos 162: #endif /* RDATA_GENERIC_TA_32768_C */
CVSweb <webmaster@jp.NetBSD.org>