Coverage Report

Created: 2026-01-09 06:42

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/bind9/lib/dns/rdata/generic/ninfo_56.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_NINFO_56_C
15
#define RDATA_GENERIC_NINFO_56_C
16
17
14.1k
#define RRTYPE_NINFO_ATTRIBUTES (0)
18
19
static isc_result_t
20
1.12k
fromtext_ninfo(ARGS_FROMTEXT) {
21
1.12k
  REQUIRE(type == dns_rdatatype_ninfo);
22
23
1.12k
  return generic_fromtext_txt(CALL_FROMTEXT);
24
1.12k
}
25
26
static isc_result_t
27
1.01k
totext_ninfo(ARGS_TOTEXT) {
28
1.01k
  REQUIRE(rdata != NULL);
29
1.01k
  REQUIRE(rdata->type == dns_rdatatype_ninfo);
30
31
1.01k
  return generic_totext_txt(CALL_TOTEXT);
32
1.01k
}
33
34
static isc_result_t
35
2.68k
fromwire_ninfo(ARGS_FROMWIRE) {
36
2.68k
  REQUIRE(type == dns_rdatatype_ninfo);
37
38
2.68k
  return generic_fromwire_txt(CALL_FROMWIRE);
39
2.68k
}
40
41
static isc_result_t
42
514
towire_ninfo(ARGS_TOWIRE) {
43
514
  REQUIRE(rdata->type == dns_rdatatype_ninfo);
44
45
514
  UNUSED(cctx);
46
47
514
  return mem_tobuffer(target, rdata->data, rdata->length);
48
514
}
49
50
static int
51
78.4k
compare_ninfo(ARGS_COMPARE) {
52
78.4k
  isc_region_t r1;
53
78.4k
  isc_region_t r2;
54
55
78.4k
  REQUIRE(rdata1->type == rdata2->type);
56
78.4k
  REQUIRE(rdata1->rdclass == rdata2->rdclass);
57
78.4k
  REQUIRE(rdata1->type == dns_rdatatype_ninfo);
58
59
78.4k
  dns_rdata_toregion(rdata1, &r1);
60
78.4k
  dns_rdata_toregion(rdata2, &r2);
61
78.4k
  return isc_region_compare(&r1, &r2);
62
78.4k
}
63
64
static isc_result_t
65
0
fromstruct_ninfo(ARGS_FROMSTRUCT) {
66
0
  REQUIRE(type == dns_rdatatype_ninfo);
67
68
0
  return generic_fromstruct_txt(CALL_FROMSTRUCT);
69
0
}
70
71
static isc_result_t
72
0
tostruct_ninfo(ARGS_TOSTRUCT) {
73
0
  dns_rdata_ninfo_t *ninfo = target;
74
75
0
  REQUIRE(rdata->type == dns_rdatatype_ninfo);
76
0
  REQUIRE(ninfo != NULL);
77
78
0
  DNS_RDATACOMMON_INIT(ninfo, rdata->type, rdata->rdclass);
79
80
0
  return generic_tostruct_txt(CALL_TOSTRUCT);
81
0
}
82
83
static void
84
0
freestruct_ninfo(ARGS_FREESTRUCT) {
85
0
  dns_rdata_ninfo_t *ninfo = source;
86
87
0
  REQUIRE(ninfo != NULL);
88
0
  REQUIRE(ninfo->common.rdtype == dns_rdatatype_ninfo);
89
90
0
  generic_freestruct_txt(source);
91
0
}
92
93
static isc_result_t
94
0
additionaldata_ninfo(ARGS_ADDLDATA) {
95
0
  REQUIRE(rdata->type == dns_rdatatype_ninfo);
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_ninfo(ARGS_DIGEST) {
107
0
  isc_region_t r;
108
109
0
  REQUIRE(rdata->type == dns_rdatatype_ninfo);
110
111
0
  dns_rdata_toregion(rdata, &r);
112
113
0
  return (digest)(arg, &r);
114
0
}
115
116
static bool
117
0
checkowner_ninfo(ARGS_CHECKOWNER) {
118
0
  REQUIRE(type == dns_rdatatype_ninfo);
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_ninfo(ARGS_CHECKNAMES) {
130
0
  REQUIRE(rdata->type == dns_rdatatype_ninfo);
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_ninfo(ARGS_COMPARE) {
141
0
  return compare_ninfo(rdata1, rdata2);
142
0
}
143
144
isc_result_t
145
0
dns_rdata_ninfo_first(dns_rdata_ninfo_t *ninfo) {
146
0
  REQUIRE(ninfo != NULL);
147
0
  REQUIRE(ninfo->common.rdtype == dns_rdatatype_ninfo);
148
149
0
  return generic_txt_first(ninfo);
150
0
}
151
152
isc_result_t
153
0
dns_rdata_ninfo_next(dns_rdata_ninfo_t *ninfo) {
154
0
  REQUIRE(ninfo != NULL);
155
0
  REQUIRE(ninfo->common.rdtype == dns_rdatatype_ninfo);
156
157
0
  return generic_txt_next(ninfo);
158
0
}
159
160
isc_result_t
161
dns_rdata_ninfo_current(dns_rdata_ninfo_t *ninfo,
162
0
      dns_rdata_ninfo_string_t *string) {
163
0
  REQUIRE(ninfo != NULL);
164
0
  REQUIRE(ninfo->common.rdtype == dns_rdatatype_ninfo);
165
166
0
  return generic_txt_current(ninfo, string);
167
0
}
168
#endif /* RDATA_GENERIC_NINFO_56_C */