• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PowerDNS / pdns / 18743945403

23 Oct 2025 09:29AM UTC coverage: 65.845% (+0.02%) from 65.829%
18743945403

Pull #16356

github

web-flow
Merge 8a2027ef1 into efa3637e8
Pull Request #16356: auth 5.0: backport "pdnsutil: fix b2b-migrate to from sql to non-sql"

42073 of 92452 branches covered (45.51%)

Branch coverage included in aggregate %.

128008 of 165855 relevant lines covered (77.18%)

6379935.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.8
/pdns/recursordist/rec-rust-lib/cxxsettings-private.hh
1
/*
2
 * This file is part of PowerDNS or dnsdist.
3
 * Copyright -- PowerDNS.COM B.V. and its contributors
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of version 2 of the GNU General Public License as
7
 * published by the Free Software Foundation.
8
 *
9
 * In addition, for the avoidance of any doubt, permission is granted to
10
 * link this program with OpenSSL and to (re)distribute the binaries
11
 * produced as the result of such linking.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
 */
22
#pragma once
23

24
#include <cinttypes>
25
#include <sstream>
26
#include <variant>
27
#include <vector>
28

29
#include "rust/lib.rs.h"
30
#include "misc.hh"
31

32
using pdns::rust::settings::rec::AuthZone;
33
using pdns::rust::settings::rec::ForwardZone;
34
using pdns::rust::settings::rec::Recursorsettings;
35

36
namespace pdns::settings::rec
37
{
38
::rust::Vec<::rust::String> getStrings(const std::string& name);
39
::rust::Vec<ForwardZone> getForwardZones(const std::string& name);
40
::rust::Vec<AuthZone> getAuthZones(const std::string& name);
41

42
inline std::string to_arg(bool arg)
43
{
636✔
44
  return arg ? "yes" : "no";
636✔
45
}
636✔
46

47
inline std::string to_arg(uint64_t arg)
48
{
1,246✔
49
  return std::to_string(arg);
1,246✔
50
}
1,246✔
51

52
inline std::string to_arg(double arg)
53
{
14✔
54
  return std::to_string(arg);
14✔
55
}
14✔
56

57
inline std::string to_arg(const ::rust::String& str)
58
{
10,466✔
59
  return std::string(str);
10,466✔
60
}
10,466✔
61

62
std::string to_arg(const AuthZone& authzone);
63
std::string to_arg(const ForwardZone& forwardzone);
64

65
template <typename T>
66
std::string to_arg(const ::rust::Vec<T>& vec)
67
{
446✔
68
  std::ostringstream str;
446✔
69
  for (auto iter = vec.begin(); iter != vec.end(); ++iter) {
10,202!
70
    if (iter != vec.begin()) {
9,756!
71
      str << ',';
9,591✔
72
    }
9,591✔
73
    str << to_arg(*iter);
9,756✔
74
  }
9,756✔
75
  return str.str();
446✔
76
}
446✔
77

78
inline void to_yaml(bool& field, const std::string& val)
79
{
88✔
80
  field = val != "no" && val != "off";
88!
81
}
88✔
82

83
inline void to_yaml(::rust::String& field, const std::string& val)
84
{
98✔
85
  field = val;
98✔
86
}
98✔
87

88
inline void to_yaml(::rust::Vec<::rust::String>& field, const std::string& val)
89
{
52✔
90
  stringtok(field, val, ", ;");
52✔
91
}
52✔
92

93
void to_yaml(uint64_t& field, const std::string& val);
94
void to_yaml(double& field, const std::string& val);
95
void to_yaml(::rust::Vec<AuthZone>& field, const std::string& val);
96
void to_yaml(::rust::Vec<ForwardZone>& field, const std::string& val, bool recurse = false);
97
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc