Coverage Report

Created: 2025-11-11 07:03

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
96.1k
#define RRTYPE_SPF_ATTRIBUTES (0)
18
19
static isc_result_t
20
234k
fromtext_spf(ARGS_FROMTEXT) {
21
234k
  REQUIRE(type == dns_rdatatype_spf);
22
23
234k
  return generic_fromtext_txt(CALL_FROMTEXT);
24
234k
}
25
26
static isc_result_t
27
815
totext_spf(ARGS_TOTEXT) {
28
815
  REQUIRE(rdata != NULL);
29
815
  REQUIRE(rdata->type == dns_rdatatype_spf);
30
31
815
  return generic_totext_txt(CALL_TOTEXT);
32
815
}
33
34
static isc_result_t
35
1.19k
fromwire_spf(ARGS_FROMWIRE) {
36
1.19k
  REQUIRE(type == dns_rdatatype_spf);
37
38
1.19k
  return generic_fromwire_txt(CALL_FROMWIRE);
39
1.19k
}
40
41
static isc_result_t
42
414
towire_spf(ARGS_TOWIRE) {
43
414
  REQUIRE(rdata->type == dns_rdatatype_spf);
44
45
414
  UNUSED(cctx);
46
47
414
  return mem_tobuffer(target, rdata->data, rdata->length);
48
414
}
49
50
static int
51
112M
compare_spf(ARGS_COMPARE) {
52
112M
  isc_region_t r1;
53
112M
  isc_region_t r2;
54
55
112M
  REQUIRE(rdata1->type == rdata2->type);
56
112M
  REQUIRE(rdata1->rdclass == rdata2->rdclass);
57
112M
  REQUIRE(rdata1->type == dns_rdatatype_spf);
58
59
112M
  dns_rdata_toregion(rdata1, &r1);
60
112M
  dns_rdata_toregion(rdata2, &r2);
61
112M
  return isc_region_compare(&r1, &r2);
62
112M
}
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 void
85
0
freestruct_spf(ARGS_FREESTRUCT) {
86
0
  dns_rdata_spf_t *spf = source;
87
88
0
  REQUIRE(spf != NULL);
89
0
  REQUIRE(spf->common.rdtype == dns_rdatatype_spf);
90
91
0
  generic_freestruct_txt(source);
92
0
}
93
94
static isc_result_t
95
0
additionaldata_spf(ARGS_ADDLDATA) {
96
0
  REQUIRE(rdata->type == dns_rdatatype_spf);
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_spf(ARGS_DIGEST) {
108
0
  isc_region_t r;
109
110
0
  REQUIRE(rdata->type == dns_rdatatype_spf);
111
112
0
  dns_rdata_toregion(rdata, &r);
113
114
0
  return (digest)(arg, &r);
115
0
}
116
117
static bool
118
0
checkowner_spf(ARGS_CHECKOWNER) {
119
0
  REQUIRE(type == dns_rdatatype_spf);
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_spf(ARGS_CHECKNAMES) {
131
0
  REQUIRE(rdata->type == dns_rdatatype_spf);
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_spf(ARGS_COMPARE) {
142
0
  return compare_spf(rdata1, rdata2);
143
0
}
144
#endif /* RDATA_GENERIC_SPF_99_C */