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

PowerDNS / pdns / 18776176249

24 Oct 2025 09:51AM UTC coverage: 73.028% (+15.6%) from 57.383%
18776176249

Pull #16370

github

web-flow
Merge 0f309894e into 39f7f1b27
Pull Request #16370: auth: xfr churning

38273 of 63104 branches covered (60.65%)

Branch coverage included in aggregate %.

186 of 264 new or added lines in 1 file covered. (70.45%)

14471 existing lines in 217 files now uncovered.

127487 of 163878 relevant lines covered (77.79%)

5632363.83 hits per line

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

0.0
/pdns/dynlistener.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 <vector>
25
#include <sys/types.h>
26
#include <cerrno>
27
#include <iostream>
28
#include <sstream>
29
#include "iputils.hh"
30
#include <boost/utility.hpp>
31
#include <unistd.h>
32
#include <sys/un.h>
33
#include <dlfcn.h>
34
#include <sys/socket.h>
35
#include <netinet/in.h>
36

37
#include "namespaces.hh"
38

39
class DynListener : public boost::noncopyable
40
{
41
public:
42
  explicit DynListener(const string &pname="");
43
  explicit DynListener(const ComboAddress& addr);
44
  ~DynListener();
45
  void go();
46
  void theListener();
47

48
  typedef string g_funk_t(const vector<string> &parts, Utility::pid_t ppid); // guido!
49
  typedef struct { g_funk_t *func; string args; string usage; } g_funkwithusage_t;
50
  typedef map<string,g_funkwithusage_t> g_funkdb_t;
51
  
52
  static void registerExitFunc(const string &name, g_funk_t *gf);
53
  static void registerFunc(const string &name, g_funk_t *gf, const string &usage="", const string &args="");
54
  static void registerRestFunc(g_funk_t *gf);
UNCOV
55
  static g_funk_t* getFunc(const string& fname) { return s_funcdb[fname].func; } 
×
56
private:
57
  void sendlines(const string &lines);
58
  string getHelp();
59
  string getLine();
60

61
  void listenOnUnixDomain(const std::string& fname);
62
  void listenOnTCP(const ComboAddress&);
63
  void createSocketAndBind(int family, struct sockaddr*local, size_t len);
64

65
  NetmaskGroup d_tcprange;
66
  int d_s{-1};
67
  int d_client{-1};
68
  bool d_nonlocal;
69
  bool d_tcp{false};
70
  pid_t d_ppid{0};
71
  
72
  string d_socketname;
73
  ComboAddress d_socketaddress;
74
  static g_funkdb_t s_funcdb;
75
  static g_funk_t* s_restfunc;
76
  static string s_exitfuncname;
77
  bool testLive(const string& fname);
78
};
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