Coverage Report

Created: 2026-10-17 06:53

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/bind9/lib/dns/rdata/generic/spf_99.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_SPF_99_C
15
#define RDATA_GENERIC_SPF_99_C
16
17
74.6k
#define RRTYPE_SPF_ATTRIBUTES (0)
18
19
static isc_result_t
20
464k
fromtext_spf(ARGS_FROMTEXT) {
21
464k
  REQUIRE(type == dns_rdatatype_spf);
22
23
464k
  return generic_fromtext_txt(CALL_FROMTEXT);
24
464k
}
25
26
static isc_result_t
27
3.81k
totext_spf(ARGS_TOTEXT) {
28
3.81k
  REQUIRE(rdata != NULL);
29
3.81k
  REQUIRE(rdata->type == dns_rdatatype_spf);
30
31
3.81k
  return generic_totext_txt(CALL_TOTEXT);
32
3.81k
}
33
34
static isc_result_t
35
4.88k
fromwire_spf(ARGS_FROMWIRE) {
36
4.88k
  REQUIRE(type == dns_rdatatype_spf);
37
38
4.88k
  return generic_fromwire_txt(CALL_FROMWIRE);
39
4.88k
}
40
41
static isc_result_t
42
1.91k
towire_spf(ARGS_TOWIRE) {
43
1.91k
  REQUIRE(rdata->type == dns_rdatatype_spf);
44
45
1.91k
  UNUSED(cctx);
46
47
1.91k
  return mem_tobuffer(target, rdata->data, rdata->length);
48
1.91k
}
49
50
static int
51
10.6M
compare_spf(ARGS_COMPARE) {
52
10.6M
  isc_region_t r1;
53
10.6M
  isc_region_t r2;
54
55
10.6M
  REQUIRE(rdata1->type == rdata2->type);
56
10.6M
  REQUIRE(rdata1->rdclass == rdata2->rdclass);
57
10.6M
  REQUIRE(rdata1->type == dns_rdatatype_spf);
58
59
10.6M
  dns_rdata_toregion(rdata1, &r1);
60
10.6M
  dns_rdata_toregion(rdata2, &r2);
61
10.6M
  return isc_region_compare(&r1, &r2);
62
10.6M
}
63
64
static isc_result_t
65
0
fromstruct_spf(ARGS_FROMSTRUCT) {
66
0
  REQUIRE(type == dns_rdatatype_spf);
67
68
0
  return generic_fromstruct_txt(CALL_FROMSTRUCT);
69
0
}
70
71
static isc_result_t
72
0
tostruct_spf(ARGS_TOSTRUCT) {
73
0
  dns_rdata_spf_t *spf = target;
74
75
0
  REQUIRE(spf != NULL);
76
0
  REQUIRE(rdata != NULL);
77
0
  REQUIRE(rdata->type == dns_rdatatype_spf);
78
79
0
  DNS_RDATACOMMON_INIT(spf, rdata->type, rdata->rdclass);
80
81
0
  return generic_tostruct_txt(CALL_TOSTRUCT);
82
0
}
83
84
static isc_result_t
85
0
additionaldata_spf(ARGS_ADDLDATA) {
86
0
  REQUIRE(rdata->type == dns_rdatatype_spf);
87
88
0
  UNUSED(rdata);
89
0
  UNUSED(owner);
90
0
  UNUSED(add);
91
0
  UNUSED(arg);
92
93
0
  return ISC_R_SUCCESS;
94
0
}
95
96
static isc_result_t
97
0
digest_spf(ARGS_DIGEST) {
98
0
  isc_region_t r;
99
100
0
  REQUIRE(rdata->type == dns_rdatatype_spf);
101
102
0
  dns_rdata_toregion(rdata, &r);
103
104
0
  return (digest)(arg, &r);
105
0
}
106
107
static bool
108
0
checkowner_spf(ARGS_CHECKOWNER) {
109
0
  REQUIRE(type == dns_rdatatype_spf);
110
111
0
  UNUSED(name);
112
0
  UNUSED(type);
113
0
  UNUSED(rdclass);
114
0
  UNUSED(wildcard);
115
116
0
  return true;
117
0
}
118
119
static bool
120
0
checknames_spf(ARGS_CHECKNAMES) {
121
0
  REQUIRE(rdata->type == dns_rdatatype_spf);
122
123
0
  UNUSED(rdata);
124
0
  UNUSED(owner);
125
0
  UNUSED(bad);
126
127
0
  return true;
128
0
}
129
130
static int
131
0
casecompare_spf(ARGS_COMPARE) {
132
0
  return compare_spf(rdata1, rdata2);
133
0
}
134
#endif /* RDATA_GENERIC_SPF_99_C */