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