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

PowerDNS / pdns / 31093351910

06 Aug 2026 10:27AM UTC coverage: 65.579% (-0.4%) from 65.959%
31093351910

push

github

web-flow
Merge pull request #17871 from omoerbeek/prep-20260806

Prep 20260806

32971 of 61994 branches covered (53.18%)

Branch coverage included in aggregate %.

89568 of 124863 relevant lines covered (71.73%)

5158975.24 hits per line

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

80.77
/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
#include "iputils.hh"
32

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

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

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

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

73
     bind_directory = d_dir.c_str();
1✔
74
   }
1✔
75
  ~BindParser()
76
  {
1✔
77
    if(yyin) {
1!
78
      fclose(yyin);
1✔
79
      yyin=0;
1✔
80
    }
1✔
81
  }
1✔
82
  void parse(const string &fname);
83
  void commit(BindDomainInfo DI);
84
  void setDirectory(const string &dir);
85
  const string &getDirectory();
86
  const vector<BindDomainInfo>& getDomains();
87
  void setVerbose(bool verbose);
88
  void addAlsoNotify(const string &host);
89
  set<string> & getAlsoNotify() { return this->alsoNotify; } 
×
90

91
  static void lexer_error(const char *msg, const char *filename, int error);
92

93
private:
94
  string d_dir{"."};
95
  set<string> alsoNotify;
96
  vector<BindDomainInfo> d_zonedomains;
97
  bool d_verbose{false};
98
};
99

100
extern "C" {
101

102
void lexer_error(const char *msg, const char *filename, int error);
103

104
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc