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

PowerDNS / pdns / 17094357417

20 Aug 2025 09:28AM UTC coverage: 30.381% (-34.3%) from 64.683%
17094357417

Pull #15994

github

web-flow
Merge de3b7cf17 into b46c65b05
Pull Request #15994: REST API: normalize record contents received

9841 of 44300 branches covered (22.21%)

Branch coverage included in aggregate %.

0 of 30 new or added lines in 1 file covered. (0.0%)

27380 existing lines in 238 files now uncovered.

28140 of 80715 relevant lines covered (34.86%)

860897.95 hits per line

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

92.31
/pdns/bindparserclasses.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
#include <string>
24
#include <map>
25
#include <vector>
26
#include <set>
27
#include <stdio.h>
28
#include <sys/stat.h>
29

30
#include "namespaces.hh"
31

32
class BindDomainInfo 
33
{
34
public:
35
  void clear() 
36
  {
108✔
37
    name=ZoneName();
108✔
38
    filename=type="";
108✔
39
    primaries.clear();
108✔
40
    alsoNotify.clear();
108✔
41
    d_dev=0;
108✔
42
    d_ino=0;
108✔
43
  }
108✔
44
  ZoneName name;
45
  string viewName;
46
  string filename;
47
  vector<ComboAddress> primaries;
48
  set<string> alsoNotify;
49
  string type;
50
  bool hadFileDirective{false};
51

52
  dev_t d_dev{0};
53
  ino_t d_ino{0};
54

55
  bool operator<(const BindDomainInfo& b) const
56
  {
384✔
57
    return pair(d_dev, d_ino) < pair(b.d_dev, b.d_ino);
384✔
58
  }
384✔
59
};
60

61
extern const char *bind_directory;
62
extern FILE *yyin;
63
class BindParser
64
{
65
 public:
66
   BindParser()
67
   {
12✔
68
     yyin = 0;
12✔
69
     extern int include_stack_ptr;
12✔
70
     include_stack_ptr = 0;
12✔
71

72
     bind_directory = d_dir.c_str();
12✔
73
   }
12✔
74
  ~BindParser()
75
  {
12✔
76
    if(yyin) {
12!
77
      fclose(yyin);
12✔
78
      yyin=0;
12✔
79
    }
12✔
80
  }
12✔
81
  void parse(const string &fname);
82
  void commit(BindDomainInfo DI);
83
  void setDirectory(const string &dir);
84
  const string &getDirectory();
85
  const vector<BindDomainInfo>& getDomains();
86
  void setVerbose(bool verbose);
87
  void addAlsoNotify(const string &host);
UNCOV
88
  set<string> & getAlsoNotify() { return this->alsoNotify; } 
×
89
private:
90
  string d_dir{"."};
91
  set<string> alsoNotify;
92
  vector<BindDomainInfo> d_zonedomains;
93
  bool d_verbose{false};
94
};
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

© 2026 Coveralls, Inc