Coverage Report

Created: 2026-03-07 06:55

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/bind9/lib/dns/rdata/generic/resinfo_261.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_RESINFO_261_C
15
#define RDATA_GENERIC_RESINFO_261_C
16
17
10.5k
#define RRTYPE_RESINFO_ATTRIBUTES (DNS_RDATATYPEATTR_SINGLETON)
18
19
static isc_result_t
20
6.67k
fromtext_resinfo(ARGS_FROMTEXT) {
21
6.67k
  REQUIRE(type == dns_rdatatype_resinfo);
22
23
6.67k
  return generic_fromtext_txt(CALL_FROMTEXT);
24
6.67k
}
25
26
static isc_result_t
27
1.15k
totext_resinfo(ARGS_TOTEXT) {
28
1.15k
  REQUIRE(rdata != NULL);
29
1.15k
  REQUIRE(rdata->type == dns_rdatatype_resinfo);
30
31
1.15k
  return generic_totext_txt(CALL_TOTEXT);
32
1.15k
}
33
34
static isc_result_t
35
1.90k
fromwire_resinfo(ARGS_FROMWIRE) {
36
1.90k
  REQUIRE(type == dns_rdatatype_resinfo);
37
38
1.90k
  return generic_fromwire_txt(CALL_FROMWIRE);
39
1.90k
}
40
41
static isc_result_t
42
581
towire_resinfo(ARGS_TOWIRE) {
43
581
  REQUIRE(rdata->type == dns_rdatatype_resinfo);
44
45
581
  UNUSED(cctx);
46
47
581
  return mem_tobuffer(target, rdata->data, rdata->length);
48
581
}
49
50
static int
51
8.05k
compare_resinfo(ARGS_COMPARE) {
52
8.05k
  isc_region_t r1;
53
8.05k
  isc_region_t r2;
54
55
8.05k
  REQUIRE(rdata1->type == rdata2->type);
56
8.05k
  REQUIRE(rdata1->rdclass == rdata2->rdclass);
57
8.05k
  REQUIRE(rdata1->type == dns_rdatatype_resinfo);
58
59
8.05k
  dns_rdata_toregion(rdata1, &r1);
60
8.05k
  dns_rdata_toregion(rdata2, &r2);
61
8.05k
  return isc_region_compare(&r1, &r2);
62
8.05k
}
63
64
static isc_result_t
65
0
fromstruct_resinfo(ARGS_FROMSTRUCT) {
66
0
  REQUIRE(type == dns_rdatatype_resinfo);
67
68
0
  return generic_fromstruct_txt(CALL_FROMSTRUCT);
69
0
}
70
71
static isc_result_t
72
0
tostruct_resinfo(ARGS_TOSTRUCT) {
73
0
  dns_rdata_resinfo_t *resinfo = target;
74
75
0
  REQUIRE(resinfo != NULL);
76
0
  REQUIRE(rdata != NULL);
77
0
  REQUIRE(rdata->type == dns_rdatatype_resinfo);
78
79
0
  DNS_RDATACOMMON_INIT(resinfo, rdata->type, rdata->rdclass);
80
81
0
  return generic_tostruct_txt(CALL_TOSTRUCT);
82
0
}
83
84
static void
85
0
freestruct_resinfo(ARGS_FREESTRUCT) {
86
0
  dns_rdata_resinfo_t *resinfo = source;
87
88
0
  REQUIRE(resinfo != NULL);
89
0
  REQUIRE(resinfo->common.rdtype == dns_rdatatype_resinfo);
90
91
0
  generic_freestruct_txt(source);
92
0
}
93
94
static isc_result_t
95
0
additionaldata_resinfo(ARGS_ADDLDATA) {
96
0
  REQUIRE(rdata->type == dns_rdatatype_resinfo);
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_resinfo(ARGS_DIGEST) {
108
0
  isc_region_t r;
109
110
0
  REQUIRE(rdata->type == dns_rdatatype_resinfo);
111
112
0
  dns_rdata_toregion(rdata, &r);
113
114
0
  return (digest)(arg, &r);
115
0
}
116
117
static bool
118
0
checkowner_resinfo(ARGS_CHECKOWNER) {
119
0
  REQUIRE(type == dns_rdatatype_resinfo);
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_resinfo(ARGS_CHECKNAMES) {
131
0
  REQUIRE(rdata->type == dns_rdatatype_resinfo);
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_resinfo(ARGS_COMPARE) {
142
0
  return compare_resinfo(rdata1, rdata2);
143
0
}
144
#endif /* RDATA_GENERIC_RESINFO_261_C */