/*
- PowerDNS Versatile Database Driven Nameserver
- Copyright (C) 2002 - 2008 PowerDNS.COM BV
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License version 2
- as published by the Free Software Foundation
-
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
#ifndef PDNS_DYNLISTENER
#define PDNS_DYNLISTENER
#include <sstream>
#include "iputils.hh"
#include <boost/utility.hpp>
-#ifndef WIN32
#include <unistd.h>
#include <sys/un.h>
#include <dlfcn.h>
-
#include <sys/socket.h>
#include <netinet/in.h>
-#endif // WIN32
#include "namespaces.hh"
static void registerRestFunc(g_funk_t *gf);
static g_funk_t* getFunc(const string& fname) { return s_funcdb[fname].func; }
private:
- void sendLine(const string &line);
+ void sendlines(const string &lines);
string getHelp();
string getLine();
void listenOnTCP(const ComboAddress&);
void createSocketAndBind(int family, struct sockaddr*local, size_t len);
-#ifndef WIN32
- struct sockaddr_un d_remote;
-#else
- HANDLE m_pipeHandle;
-#endif // WIN32
-
- Utility::socklen_t d_addrlen;
NetmaskGroup d_tcprange;
- int d_s;
- int d_client;
- pthread_t d_tid;
+ int d_s{-1};
+ int d_client{-1};
+ pthread_t d_tid{0};
bool d_nonlocal;
- bool d_tcp;
- pid_t d_ppid;
+ bool d_tcp{false};
+ pid_t d_ppid{0};
string d_socketname;
ComboAddress d_socketaddress;