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

PowerDNS / pdns / 18679017918

21 Oct 2025 09:15AM UTC coverage: 69.743% (+2.0%) from 67.713%
18679017918

Pull #16307

github

web-flow
Merge ba88af487 into da98764c6
Pull Request #16307: rec: explicit disabling/enabling of tls-gnutls for full and least configs and packages

26192 of 45526 branches covered (57.53%)

Branch coverage included in aggregate %.

6 of 6 new or added lines in 1 file covered. (100.0%)

2282 existing lines in 57 files now uncovered.

86265 of 115719 relevant lines covered (74.55%)

4323875.05 hits per line

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

80.0
/pdns/ednssubnet.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 "iputils.hh"
25

26
class EDNSSubnetOpts
27
{
28
public:
29
  void setSource(const Netmask& netmask)
30
  {
634✔
31
    source = netmask;
634✔
32
  }
634✔
33
  [[nodiscard]] const Netmask& getSource() const
34
  {
544✔
35
    return source;
544✔
36
  }
544✔
37
  [[nodiscard]] uint8_t getFamily() const
38
  {
39
    return source.getNetwork().sin4.sin_family;
40
  }
41
  [[nodiscard]] uint8_t getSourcePrefixLength() const
UNCOV
42
  {
×
UNCOV
43
    return source.getBits();
×
UNCOV
44
  }
×
45
  void setScopePrefixLength(uint8_t scope)
46
  {
346✔
47
    scopeBits = scope;
346✔
48
  }
346✔
49
  [[nodiscard]] uint8_t getScopePrefixLength() const
50
  {
274✔
51
    return scopeBits;
274✔
52
  }
274✔
53
  [[nodiscard]] Netmask getScope() const
54
  {
55
    return {source.getNetwork(), scopeBits};
56
  }
57
  [[nodiscard]] std::string makeOptString() const;
58
  static bool getFromString(const std::string& options, EDNSSubnetOpts* eso);
59
  static bool getFromString(const char* options, unsigned int len, EDNSSubnetOpts* eso);
60

61
private:
62
  Netmask source;
63
  uint8_t scopeBits{};
64
};
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