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