/src/bind9/lib/dns/rdata/generic/dlv_32769.c
Line | Count | Source |
1 | | /* |
2 | | * Copyright (C) Internet Systems Consortium, Inc. ("ISC") |
3 | | * |
4 | | * SPDX-License-Identifier: MPL-2.0 |
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 |
8 | | * file, you can obtain one at https://mozilla.org/MPL/2.0/. |
9 | | * |
10 | | * See the COPYRIGHT file distributed with this work for additional |
11 | | * information regarding copyright ownership. |
12 | | */ |
13 | | |
14 | | /* RFC3658 */ |
15 | | |
16 | | #ifndef RDATA_GENERIC_DLV_32769_C |
17 | | #define RDATA_GENERIC_DLV_32769_C |
18 | | |
19 | 8.89k | #define RRTYPE_DLV_ATTRIBUTES 0 |
20 | | |
21 | | #include <dns/ds.h> |
22 | | |
23 | | static isc_result_t |
24 | 221 | fromtext_dlv(ARGS_FROMTEXT) { |
25 | 221 | REQUIRE(type == dns_rdatatype_dlv); |
26 | | |
27 | 221 | return generic_fromtext_ds(CALL_FROMTEXT); |
28 | 221 | } |
29 | | |
30 | | static isc_result_t |
31 | 552 | totext_dlv(ARGS_TOTEXT) { |
32 | 552 | REQUIRE(rdata != NULL); |
33 | 552 | REQUIRE(rdata->type == dns_rdatatype_dlv); |
34 | | |
35 | 552 | return generic_totext_ds(CALL_TOTEXT); |
36 | 552 | } |
37 | | |
38 | | static isc_result_t |
39 | 807 | fromwire_dlv(ARGS_FROMWIRE) { |
40 | 807 | REQUIRE(type == dns_rdatatype_dlv); |
41 | | |
42 | 807 | return generic_fromwire_ds(CALL_FROMWIRE); |
43 | 807 | } |
44 | | |
45 | | static int |
46 | 1.10k | compare_dlv(ARGS_COMPARE) { |
47 | 1.10k | isc_region_t r1; |
48 | 1.10k | isc_region_t r2; |
49 | | |
50 | 1.10k | REQUIRE(rdata1->type == rdata2->type); |
51 | 1.10k | REQUIRE(rdata1->rdclass == rdata2->rdclass); |
52 | 1.10k | REQUIRE(rdata1->type == dns_rdatatype_dlv); |
53 | 1.10k | REQUIRE(rdata1->length != 0); |
54 | 1.10k | REQUIRE(rdata2->length != 0); |
55 | | |
56 | 1.10k | dns_rdata_toregion(rdata1, &r1); |
57 | 1.10k | dns_rdata_toregion(rdata2, &r2); |
58 | 1.10k | return isc_region_compare(&r1, &r2); |
59 | 1.10k | } |
60 | | |
61 | | static isc_result_t |
62 | 0 | fromstruct_dlv(ARGS_FROMSTRUCT) { |
63 | 0 | REQUIRE(type == dns_rdatatype_dlv); |
64 | |
|
65 | 0 | return generic_fromstruct_ds(CALL_FROMSTRUCT); |
66 | 0 | } |
67 | | |
68 | | static isc_result_t |
69 | 0 | tostruct_dlv(ARGS_TOSTRUCT) { |
70 | 0 | dns_rdata_dlv_t *dlv = target; |
71 | |
|
72 | 0 | REQUIRE(rdata->type == dns_rdatatype_dlv); |
73 | 0 | REQUIRE(dlv != NULL); |
74 | |
|
75 | 0 | DNS_RDATACOMMON_INIT(dlv, rdata->type, rdata->rdclass); |
76 | |
|
77 | 0 | return generic_tostruct_ds(CALL_TOSTRUCT); |
78 | 0 | } |
79 | | |
80 | | static isc_result_t |
81 | 0 | additionaldata_dlv(ARGS_ADDLDATA) { |
82 | 0 | REQUIRE(rdata->type == dns_rdatatype_dlv); |
83 | |
|
84 | 0 | UNUSED(rdata); |
85 | 0 | UNUSED(owner); |
86 | 0 | UNUSED(add); |
87 | 0 | UNUSED(arg); |
88 | |
|
89 | 0 | return ISC_R_SUCCESS; |
90 | 0 | } |
91 | | |
92 | | static isc_result_t |
93 | 0 | digest_dlv(ARGS_DIGEST) { |
94 | 0 | isc_region_t r; |
95 | |
|
96 | 0 | REQUIRE(rdata->type == dns_rdatatype_dlv); |
97 | |
|
98 | 0 | dns_rdata_toregion(rdata, &r); |
99 | |
|
100 | 0 | return (digest)(arg, &r); |
101 | 0 | } |
102 | | |
103 | | static bool |
104 | 0 | checkowner_dlv(ARGS_CHECKOWNER) { |
105 | 0 | REQUIRE(type == dns_rdatatype_dlv); |
106 | |
|
107 | 0 | UNUSED(name); |
108 | 0 | UNUSED(type); |
109 | 0 | UNUSED(rdclass); |
110 | 0 | UNUSED(wildcard); |
111 | |
|
112 | 0 | return true; |
113 | 0 | } |
114 | | |
115 | | static bool |
116 | 0 | checknames_dlv(ARGS_CHECKNAMES) { |
117 | 0 | REQUIRE(rdata->type == dns_rdatatype_dlv); |
118 | |
|
119 | 0 | UNUSED(rdata); |
120 | 0 | UNUSED(owner); |
121 | 0 | UNUSED(bad); |
122 | |
|
123 | 0 | return true; |
124 | 0 | } |
125 | | |
126 | | static int |
127 | 0 | casecompare_dlv(ARGS_COMPARE) { |
128 | 0 | return compare_dlv(rdata1, rdata2); |
129 | 0 | } |
130 | | |
131 | | #endif /* RDATA_GENERIC_DLV_32769_C */ |