2 PowerDNS Versatile Database Driven Nameserver
3 Copyright (C) 2002 PowerDNS.COM BV
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License version 2
7 as published by the Free Software Foundation
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef PDNS_TCPRECEIVER_HH
20 #define PDNS_TCPRECEIVER_HH
24 #include "dnsbackend.hh"
25 #include "packethandler.hh"
27 #include <boost/shared_ptr.hpp>
29 #include <sys/select.h>
30 #include <sys/socket.h>
31 #include <netinet/in.h>
32 #include <arpa/inet.h>
37 #include <sys/select.h>
39 #include "namespaces.hh"
49 static void sendPacket(boost::shared_ptr<DNSPacket> p, int outsock);
50 static int readLength(int fd, ComboAddress *remote);
51 static void getQuestion(int fd, char *mesg, int pktlen, const ComboAddress& remote);
52 static int doAXFR(const string &target, boost::shared_ptr<DNSPacket> q, int outsock);
53 static bool canDoAXFR(boost::shared_ptr<DNSPacket> q);
54 static void *doConnection(void *data);
55 static void *launcher(void *data);
57 static pthread_mutex_t s_plock;
58 static PacketHandler *s_P;
60 static Semaphore *d_connectionroom_sem;
61 static NetmaskGroup d_ng;
64 vector<struct pollfd> d_prfds;
68 #endif /* PDNS_TCPRECEIVER_HH */