/src/bind9/lib/dns/rdata/generic/avc_258.c
Line | Count | Source (jump to first uncovered line) |
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 | | #ifndef RDATA_GENERIC_AVC_258_C |
15 | | #define RDATA_GENERIC_AVC_258_C |
16 | | |
17 | 9.32k | #define RRTYPE_AVC_ATTRIBUTES (0) |
18 | | |
19 | | static isc_result_t |
20 | 683 | fromtext_avc(ARGS_FROMTEXT) { |
21 | 683 | REQUIRE(type == dns_rdatatype_avc); |
22 | | |
23 | 683 | return generic_fromtext_txt(CALL_FROMTEXT); |
24 | 683 | } |
25 | | |
26 | | static isc_result_t |
27 | 1.07k | totext_avc(ARGS_TOTEXT) { |
28 | 1.07k | REQUIRE(rdata != NULL); |
29 | 1.07k | REQUIRE(rdata->type == dns_rdatatype_avc); |
30 | | |
31 | 1.07k | return generic_totext_txt(CALL_TOTEXT); |
32 | 1.07k | } |
33 | | |
34 | | static isc_result_t |
35 | 1.20k | fromwire_avc(ARGS_FROMWIRE) { |
36 | 1.20k | REQUIRE(type == dns_rdatatype_avc); |
37 | | |
38 | 1.20k | return generic_fromwire_txt(CALL_FROMWIRE); |
39 | 1.20k | } |
40 | | |
41 | | static isc_result_t |
42 | 557 | towire_avc(ARGS_TOWIRE) { |
43 | 557 | REQUIRE(rdata->type == dns_rdatatype_avc); |
44 | | |
45 | 557 | UNUSED(cctx); |
46 | | |
47 | 557 | return mem_tobuffer(target, rdata->data, rdata->length); |
48 | 557 | } |
49 | | |
50 | | static int |
51 | 2.21k | compare_avc(ARGS_COMPARE) { |
52 | 2.21k | isc_region_t r1; |
53 | 2.21k | isc_region_t r2; |
54 | | |
55 | 2.21k | REQUIRE(rdata1->type == rdata2->type); |
56 | 2.21k | REQUIRE(rdata1->rdclass == rdata2->rdclass); |
57 | 2.21k | REQUIRE(rdata1->type == dns_rdatatype_avc); |
58 | | |
59 | 2.21k | dns_rdata_toregion(rdata1, &r1); |
60 | 2.21k | dns_rdata_toregion(rdata2, &r2); |
61 | 2.21k | return isc_region_compare(&r1, &r2); |
62 | 2.21k | } |
63 | | |
64 | | static isc_result_t |
65 | 0 | fromstruct_avc(ARGS_FROMSTRUCT) { |
66 | 0 | REQUIRE(type == dns_rdatatype_avc); |
67 | |
|
68 | 0 | return generic_fromstruct_txt(CALL_FROMSTRUCT); |
69 | 0 | } |
70 | | |
71 | | static isc_result_t |
72 | 0 | tostruct_avc(ARGS_TOSTRUCT) { |
73 | 0 | dns_rdata_avc_t *avc = target; |
74 | |
|
75 | 0 | REQUIRE(rdata->type == dns_rdatatype_avc); |
76 | 0 | REQUIRE(avc != NULL); |
77 | |
|
78 | 0 | avc->common.rdclass = rdata->rdclass; |
79 | 0 | avc->common.rdtype = rdata->type; |
80 | |
|
81 | 0 | return generic_tostruct_txt(CALL_TOSTRUCT); |
82 | 0 | } |
83 | | |
84 | | static void |
85 | 0 | freestruct_avc(ARGS_FREESTRUCT) { |
86 | 0 | dns_rdata_avc_t *avc = source; |
87 | |
|
88 | 0 | REQUIRE(avc != NULL); |
89 | 0 | REQUIRE(avc->common.rdtype == dns_rdatatype_avc); |
90 | |
|
91 | 0 | generic_freestruct_txt(source); |
92 | 0 | } |
93 | | |
94 | | static isc_result_t |
95 | 0 | additionaldata_avc(ARGS_ADDLDATA) { |
96 | 0 | REQUIRE(rdata->type == dns_rdatatype_avc); |
97 | |
|
98 | 0 | UNUSED(rdata); |
99 | 0 | UNUSED(owner); |
100 | 0 | UNUSED(add); |
101 | 0 | UNUSED(arg); |
102 | |
|
103 | 0 | return ISC_R_SUCCESS; |
104 | 0 | } |
105 | | |
106 | | static isc_result_t |
107 | 0 | digest_avc(ARGS_DIGEST) { |
108 | 0 | isc_region_t r; |
109 | |
|
110 | 0 | REQUIRE(rdata->type == dns_rdatatype_avc); |
111 | |
|
112 | 0 | dns_rdata_toregion(rdata, &r); |
113 | |
|
114 | 0 | return (digest)(arg, &r); |
115 | 0 | } |
116 | | |
117 | | static bool |
118 | 0 | checkowner_avc(ARGS_CHECKOWNER) { |
119 | 0 | REQUIRE(type == dns_rdatatype_avc); |
120 | |
|
121 | 0 | UNUSED(name); |
122 | 0 | UNUSED(type); |
123 | 0 | UNUSED(rdclass); |
124 | 0 | UNUSED(wildcard); |
125 | |
|
126 | 0 | return true; |
127 | 0 | } |
128 | | |
129 | | static bool |
130 | 0 | checknames_avc(ARGS_CHECKNAMES) { |
131 | 0 | REQUIRE(rdata->type == dns_rdatatype_avc); |
132 | |
|
133 | 0 | UNUSED(rdata); |
134 | 0 | UNUSED(owner); |
135 | 0 | UNUSED(bad); |
136 | |
|
137 | 0 | return true; |
138 | 0 | } |
139 | | |
140 | | static int |
141 | 0 | casecompare_avc(ARGS_COMPARE) { |
142 | 0 | return compare_avc(rdata1, rdata2); |
143 | 0 | } |
144 | | #endif /* RDATA_GENERIC_AVC_258_C */ |