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

PowerDNS / pdns / 19741624072

27 Nov 2025 03:45PM UTC coverage: 73.086% (+0.02%) from 73.065%
19741624072

Pull #16570

github

web-flow
Merge 08a2cdb1d into f94a3f63f
Pull Request #16570: rec: rewrite all unwrap calls in web.rs

38523 of 63408 branches covered (60.75%)

Branch coverage included in aggregate %.

128044 of 164496 relevant lines covered (77.84%)

6531485.83 hits per line

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

55.56
/pdns/dnsdistdist/dnsdist-actions.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 <cstdint>
25
#include <map>
26
#include <string>
27

28
/* so what could you do:
29
   drop,
30
   fake up nxdomain,
31
   provide actual answer,
32
   allow & and stop processing,
33
   continue processing,
34
   modify header:    (servfail|refused|notimp), set TC=1,
35
   send to pool */
36

37
struct DNSQuestion;
38
struct DNSResponse;
39

40
class DNSAction
41
{
42
public:
43
  enum class Action : uint8_t
44
  {
45
    Drop,
46
    Nxdomain,
47
    Refused,
48
    Spoof,
49
    Allow,
50
    HeaderModify,
51
    Pool,
52
    Delay,
53
    Truncate,
54
    ServFail,
55
    None,
56
    NoOp,
57
    NoRecurse,
58
    SpoofRaw,
59
    SpoofPacket,
60
    SetTag,
61
  };
62
  static Action typeFromString(const std::string& str);
63
  static std::string typeToString(Action action);
64

65
  virtual Action operator()(DNSQuestion*, std::string* ruleresult) const = 0;
66
  virtual ~DNSAction() = default;
375✔
67
  virtual std::string toString() const = 0;
68
  virtual std::map<std::string, double> getStats() const
69
  {
535✔
70
    return {{}};
535✔
71
  }
535✔
72
  virtual void reload()
73
  {
×
74
  }
×
75
};
76

77
class DNSResponseAction
78
{
79
public:
80
  enum class Action : uint8_t
81
  {
82
    Allow,
83
    Delay,
84
    Drop,
85
    HeaderModify,
86
    ServFail,
87
    Truncate,
88
    None
89
  };
90
  virtual Action operator()(DNSResponse*, std::string* ruleresult) const = 0;
91
  virtual ~DNSResponseAction() = default;
74✔
92
  virtual std::string toString() const = 0;
93
  virtual void reload()
94
  {
×
95
  }
×
96
};
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