#include <stdlib.h>
#include <sstream>
-using namespace std;
+#include "namespaces.hh"
#include <dns.hh>
#include <dnsbackend.hh>
#include <string>
#include <map>
-using namespace std;
+#include "namespaces.hh"
#include <sqlcli1.h>
#include <string>
-using namespace std;
+#include "namespaces.hh"
#include <sqlcli1.h>
#include "ippreftree.hh"
-using namespace std;
+#include "namespaces.hh"
class GeoRecord {
public:
#include <cstdlib>
#include <stdint.h>
-using namespace std;
+#include "namespaces.hh"
// Use old style C structs for efficiency
typedef struct node_t {
#include <string>
#include <map>
-using namespace std;
+#include "pdns/namespaces.hh"
#include "pdns/dns.hh"
#include "pdns/dnsbackend.hh"
#include "pdns/backends/gsql/gsqlbackend.hh"
-using namespace std;
+#include "pdns/namespaces.hh"
/** The gMySQLBackend is a DNSBackend that can answer DNS related questions. It looks up data
in MySQL */
#include "pdns/misc.hh"
#include "pdns/logger.hh"
#include "pdns/dns.hh"
-using namespace std;
+#include "pdns/namespaces.hh"
bool SMySQL::s_dolog;
#include <string>
#include <map>
-using namespace std;
+#include "namespaces.hh"
#include "pdns/dns.hh"
#include "pdns/dnsbackend.hh"
#include "pdns/backends/gsql/gsqlbackend.hh"
-using namespace std;
+#include "namespaces.hh"
/** The gOracleBackend is a DNSBackend that can answer DNS related questions. It looks up data
in PostgreSQL */
#include "pdns/logger.hh"
#include "pdns/dns.hh"
#include <regex.h>
-using namespace std;
+#include "namespaces.hh"
bool SOracle::s_dolog;
#include <string>
#include <map>
-using namespace std;
+#include "pdns/namespaces.hh"
#include "pdns/dns.hh"
#include "pdns/dnsbackend.hh"
#include <map>
#include "pdns/backends/gsql/gsqlbackend.hh"
-using namespace std;
+#include "pdns/namespaces.hh"
/** The gPgSQLBackend is a DNSBackend that can answer DNS related questions. It looks up data
in PostgreSQL */
#include "pdns/logger.hh"
#include "pdns/dns.hh"
-using namespace std;
+#include "pdns/namespaces.hh"
bool SPgSQL::s_dolog;
for more information. */
#ifndef SPGSQL_HH
#define SPGSQL_HH
-using namespace std;
+#include "pdns/namespaces.hh"
#include "pdns/backends/gsql/ssql.hh"
#include <libpq-fe.h>
#include <stdlib.h>
#include <sstream>
-using namespace std;
+#include "namespaces.hh"
#include <pdns/dns.hh>
#include <pdns/dnsbackend.hh>
#include <string>
#include <map>
-using namespace std;
+#include "namespaces.hh"
#include <modules/gmysqlbackend/smysql.hh>
#include <stdlib.h>
#include <sstream>
-using namespace std;
+#include "namespaces.hh"
#include <pdns/dns.hh>
#include <pdns/dnsbackend.hh>
#include <string>
#include <map>
-using namespace std;
+#include "namespaces.hh"
#include <mysql.h>
#include <string>
-using namespace std;
+#include "namespaces.hh"
#include "pdns/dns.hh"
#include "pdns/dnsbackend.hh"
#include <oci.h>
-using namespace std;
+#include "namespaces.hh"
class OracleException : public DBException
{
#include <stdlib.h>
#include <sstream>
-using namespace std;
+#include "namespaces.hh"
#include <pdns/dns.hh>
#include <pdns/dnsbackend.hh>
#include <string>
#include <map>
-using namespace std;
+#include "namespaces.hh"
#include <mysql.h>
#include <stdio.h>
#include <string>
-using namespace std;
+#include "pdns/namespaces.hh"
class CoProcess
{
#include <sstream>
#include "coprocess.hh"
-using namespace std;
+#include "pdns/namespaces.hh"
#include <pdns/dns.hh>
#include <pdns/dnsbackend.hh>
#include <sys/types.h>
#include <regex.h>
#include <boost/shared_ptr.hpp>
-using namespace boost;
-using namespace std;
+#include "pdns/namespaces.hh"
/** very small regex wrapper */
class Regex
#include <fcntl.h>
#include <iostream>
-using namespace std;
+#include "namespaces.hh"
GDBM_FILE XGDBMWrapper::s_db;
int XGDBMWrapper::s_usecount;
#include <iostream>
-using namespace std;
+#include "namespaces.hh"
TDB_CONTEXT *XTDBWrapper::s_db;
int XTDBWrapper::s_usecount;
#include<string>
-using namespace std;
+#include "namespaces.hh"
//! Generic Exception thrown
class AhuException
#include "dnsparser.hh"
#include "namespaces.hh"
-using namespace std;
+#include "namespaces.hh"
struct QuestionIdentifier
{
#include <cctype>
#include <boost/shared_ptr.hpp>
#include <boost/regex.hpp>
-using namespace std;
+#include "namespaces.hh"
#include "namespaces.hh"
#define decl(x,y) typeof((y)) (x) = (y)
# include <grp.h>
#endif
-using namespace std;
+#include "namespaces.hh"
typedef AhuException ArgException;
#include <unistd.h>
#include "misc.hh"
-using namespace std;
+#include "namespaces.hh"
using namespace boost;
using namespace ::boost::multi_index;
#include <vector>
#include <set>
-using namespace std;
+#include "namespaces.hh"
class BindDomainInfo
{
#include <vector>
#include "../../ahuexception.hh"
-using namespace std;
+#include "namespaces.hh"
class HuffmanCodec
{
try
{
#if __GNUC__ >= 3
- ios_base::sync_with_stdio( false );
+ std::ios_base::sync_with_stdio( false );
#endif
reportAllTypes();
args.setCmd( "help", "Provide a helpful message" );
#include <iostream>
#include <stdio.h>
-using namespace std;
+#include "namespaces.hh"
#include "dns.hh"
#include "arguments.hh"
reportAllTypes();
reportFancyTypes();
#if __GNUC__ >= 3
- ios_base::sync_with_stdio(false);
+ std::ios_base::sync_with_stdio(false);
#endif
lastsoa_qname=" ";
::arg().setSwitch("mysql","Output in format suitable for mysqlbackend")="yes";
#include <string>
#include <map>
-using namespace std;
+#include "namespaces.hh"
#include "pdns/dns.hh"
#include "pdns/dnsbackend.hh"
#include <map>
#include "ssql.hh"
-using namespace std;
+#include "../../namespaces.hh"
/** The GSQLBackend is a DNSBackend that can answer DNS related questions. It looks up data
in PostgreSQL */
#include <string>
#include <vector>
-using namespace std;
+#include "../../namespaces.hh"
class SSqlException
#include <stdlib.h>
#include <iostream>
#include "base32.hh"
-using namespace std;
+#include "namespaces.hh"
/* based on freebsd:src/contrib/opie/libopie/btoe.c extract: get bit ranges from a char* */
uint32_t extract_bits(const char *s, int start, int length)
#include <sys/stat.h>
-using namespace std;
+#include "namespaces.hh"
static void imbue(char *pname, const char *search, const string &replace);
static string stringerror();
#include "lock.hh"
#include "packethandler.hh"
-using namespace std;
+#include "namespaces.hh"
struct SuckRequest
{
time_t earliest()
{
- time_t early=numeric_limits<time_t>::max() - 1;
+ time_t early=std::numeric_limits<time_t>::max() - 1;
for(d_nqueue_t::const_iterator i=d_nqueue.begin();i!=d_nqueue.end();++i)
early=min(early,i->next);
return early-time(0);
time_t next;
};
- typedef list<NotificationRequest>d_nqueue_t;
+ typedef std::list<NotificationRequest>d_nqueue_t;
d_nqueue_t d_nqueue;
};
#include "syncres.hh"
#include "namespaces.hh"
-using namespace std;
+#include "namespaces.hh"
class DevPollFDMultiplexer : public FDMultiplexer
{
#include "qtype.hh"
#include "dns.hh"
#include <vector>
-using namespace std;
+#include "namespaces.hh"
class DNSBackend;
struct DomainInfo
#include "anadns.hh"
#include "namespaces.hh"
-using namespace std;
+#include "namespaces.hh"
StatBag S;
#include "anadns.hh"
#include "namespaces.hh"
-using namespace std;
+#include "namespaces.hh"
StatBag S;
if(getEDNSOpts(mdp, &edo)) {
- d_maxreplylen=min(edo.d_packetsize, (uint16_t)1680);
+ d_maxreplylen=std::min(edo.d_packetsize, (uint16_t)1680);
// cerr<<edo.d_Z<<endl;
if(edo.d_Z & EDNSOpts::DNSSECOK)
d_dnssecOk=true;
}
#endif
}
- catch(out_of_range &re) {
+ catch(std::out_of_range &re) {
if(validPacket && d_header.tc) { // don't sweat it over truncated packets, but do adjust an, ns and arcount
if(n < d_header.ancount) {
d_header.ancount=n; d_header.nscount = d_header.arcount = 0;
void PacketReader::copyRecord(unsigned char* dest, uint16_t len)
{
if(d_pos + len > d_content.size())
- throw out_of_range("Attempt to copy outside of packet");
+ throw std::out_of_range("Attempt to copy outside of packet");
memcpy(dest, &d_content.at(d_pos), len);
d_pos+=len;
{
d_notyouroffset += by;
if(d_notyouroffset > d_packet.length())
- throw out_of_range("dns packet out of range: "+lexical_cast<string>(d_notyouroffset) +" > "
+ throw std::out_of_range("dns packet out of range: "+lexical_cast<string>(d_notyouroffset) +" > "
+ lexical_cast<string>(d_packet.length()) );
}
std::string& d_packet;
And we might be able to reverse 2 -> 3 as well
*/
-using namespace std;
+#include "namespaces.hh"
#include "namespaces.hh"
class MOADNSException : public runtime_error
#include <net/ethernet.h>
#include <vector>
#include <boost/format.hpp>
-using namespace std;
+#include "namespaces.hh"
struct pdns_pcap_file_header {
uint32_t magic;
#include "lock.hh"
#include "iputils.hh"
-using namespace std;
+#include "namespaces.hh"
/**
#include <set>
#include <bitset>
-using namespace std;
+#include "namespaces.hh"
#include "namespaces.hh"
#define includeboilerplate(RNAME) RNAME##RecordContent(const DNSRecord& dr, PacketReader& pr); \
#include "namespaces.hh"
using namespace ::boost::multi_index;
-using namespace std;
+#include "namespaces.hh"
StatBag S;
bool g_quiet=true;
{
s_wednserrors++;
}
- catch(out_of_range &e)
+ catch(std::out_of_range &e)
{
s_wednserrors++;
}
{
s_origdnserrors++;
}
- catch(out_of_range &e)
+ catch(std::out_of_range &e)
{
s_origdnserrors++;
}
#include "namespaces.hh"
using namespace ::boost::multi_index;
-using namespace std;
+#include "namespaces.hh"
StatBag S;
int main(int argc, char** argv)
#include "anadns.hh"
#include "namespaces.hh"
-using namespace std;
+#include "namespaces.hh"
StatBag S;
-struct CanonicalCompare: public binary_function<string, string, bool>
+struct CanonicalCompare: public std::binary_function<string, string, bool>
{
bool operator()(const std::string& a, const std::string& b) {
std::vector<std::string> avect, bvect;
#include "dnspcap.hh"
#include "namespaces.hh"
-using namespace std;
+#include "namespaces.hh"
StatBag S;
d_record.push_back(0);
else
for (unsigned int i = 0; i < beg->length(); i += 0xff){
- d_record.push_back(min((string::size_type)0xffU, beg->length()-i));
+ d_record.push_back(std::min((string::size_type)0xffU, beg->length()-i));
const uint8_t* ptr=(uint8_t*)(beg->c_str()) + i;
- d_record.insert(d_record.end(), ptr, ptr+min((string::size_type)0xffU, beg->length()-i));
+ d_record.insert(d_record.end(), ptr, ptr+ std::min((string::size_type)0xffU, beg->length()-i));
}
}
}
#include "utility.hh"
#endif
#include "dns.hh"
-using namespace std;
+#include "namespaces.hh"
/** this class can be used to write DNS packets. It knows about DNS in the sense that it makes
the packet header and record headers.
# include "pdnsservice.hh"
#endif // WIN32
-using namespace std;
+#include "namespaces.hh"
bool DLQuitPlease();
#include <netinet/in.h>
#endif // WIN32
-using namespace std;
+#include "namespaces.hh"
class DynListener : public boost::noncopyable
{
#include "config.h"
#include "statbag.hh"
#include "misc.hh"
-using namespace std;
+#include "namespaces.hh"
#include "namespaces.hh"
ArgvMap &arg()
#include "iputils.hh"
#include "ahuexception.hh"
-using namespace std;
+#include "namespaces.hh"
//! The DynMessenger can send messages to UNIX domain sockets and TCP sockets
class DynMessenger
#endif
#include "namespaces.hh"
-using namespace std;
+#include "namespaces.hh"
class EpollFDMultiplexer : public FDMultiplexer
{
HTimer::timers_t HTimer::s_timers;
-using namespace std;
+#include "namespaces.hh"
#include "namespaces.hh"
#include "statbag.hh"
#include <sys/socket.h>
-using namespace std;
+#include "namespaces.hh"
using namespace boost::multi_index;
struct TimeTag{};
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/lexical_cast.hpp>
-using namespace std;
+#include "namespaces.hh"
union ComboAddress {
struct sockaddr_in sin4;
return memcmp(&sin6.sin6_addr.s6_addr, &rhs.sin6.sin6_addr.s6_addr, 16) > 0;
}
- struct addressOnlyLessThan: public binary_function<string, string, bool>
+ struct addressOnlyLessThan: public std::binary_function<string, string, bool>
{
bool operator()(const ComboAddress& a, const ComboAddress& b) const
{
#include <sys/time.h>
#include "namespaces.hh"
-using namespace std;
+#include "namespaces.hh"
class KqueueFDMultiplexer : public FDMultiplexer
{
extern StatBag S;
#endif
-using namespace std;
+#include "namespaces.hh"
Logger &theL(const string &pname)
{
typedef int pthread_t;
#endif // WIN32
-using namespace std;
+#include "namespaces.hh"
//! The Logger class can be used to log messages in various ways.
class Logger
Logger& operator<<(Urgency); //!< set the urgency, << style
#ifndef WIN32
- Logger& operator<<(ostream & (&)(ostream &)); //!< this is to recognise the endl, and to commit the log
+ Logger& operator<<(std::ostream & (&)(std::ostream &)); //!< this is to recognise the endl, and to commit the log
#else
// This is a hack to keep MSVC from generating a internal compiler error.
Logger& operator<<(ostream & (hack)(ostream &)); //!< this is to recognise the endl, and to commit the log
#include <vector>
#include <stdexcept>
#include "logger.hh"
-using namespace std;
+#include "namespaces.hh"
bool netmaskMatchTable(lua_State* lua, const std::string& ip)
{
#include "ahuexception.hh"
#include "dns.hh"
-using namespace std;
+#include "namespaces.hh"
int asendto(const char *data, int len, int flags, const ComboAddress& ip, uint16_t id,
const string& domain, uint16_t qtype, int* fd);
#include "md5.hh"
-using namespace std;
+#include "namespaces.hh"
namespace {
#include <vector>
#include <boost/optional.hpp>
-using namespace std;
+#include "namespaces.hh"
bool chopOff(string &domain);
bool chopOffDotted(string &domain);
};
-struct CIStringCompare: public binary_function<string, string, bool>
+struct CIStringCompare: public std::binary_function<string, string, bool>
{
bool operator()(const string& a, const string& b) const
{
/*
PowerDNS Versatile Database Driven Nameserver
- Copyright (C) 2005 PowerDNS.COM BV
+ Copyright (C) 2005 - 2011 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
#include <vector>
#include "statbag.hh"
-using namespace std;
+#include "namespaces.hh"
/** This is the main class. It opens a socket on udp port 53 and waits for packets. Those packets can
be retrieved with the receive() member function, which returns a DNSPacket.
#include "namespaces.hh"
using namespace ::boost::multi_index;
-using namespace std;
+#include "namespaces.hh"
namespace po = boost::program_options;
po::variables_map g_vm;
#include "namespaces.hh"
using namespace ::boost::multi_index;
-using namespace std;
+#include "namespaces.hh"
namespace po = boost::program_options;
po::variables_map g_vm;
#include <map>
#include "dns.hh"
#include <boost/version.hpp>
-using namespace std;
+#include "namespaces.hh"
using namespace ::boost::multi_index;
#include "namespaces.hh"
first marks and then sweeps, a second lock is present to prevent simultaneous inserts and deletes.
*/
-struct CIBackwardsStringCompare: public binary_function<string, string, bool>
+struct CIBackwardsStringCompare: public std::binary_function<string, string, bool>
{
bool operator()(const string& str_a, const string& str_b) const
{
#include "packetcache.hh"
#include "dnsseckeeper.hh"
-using namespace std;
+#include "namespaces.hh"
// silly Solaris people define PC
#undef PC
#include <string>
#include <sstream>
-using namespace std;
+#include "namespaces.hh"
int main()
{
ostringstream str;
string RSADNSCryptoKeyEngine::getPublicKeyString() const
{
string keystring;
- char tmp[max(mpi_size(&d_context.E), mpi_size(&d_context.N))];
+ char tmp[std::max(mpi_size(&d_context.E), mpi_size(&d_context.N))];
mpi_write_binary(&d_context.E, (unsigned char*)tmp, mpi_size(&d_context.E) );
string exponent((char*)tmp, mpi_size(&d_context.E));
#include "syncres.hh"
#include "utility.hh"
#include "namespaces.hh"
-using namespace std;
+#include "namespaces.hh"
static FDMultiplexer* make()
#include "syncres.hh"
#include "namespaces.hh"
-using namespace std;
+#include "namespaces.hh"
class PortsFDMultiplexer : public FDMultiplexer
{
#include <vector>
#include <utility>
-using namespace std;
+#include "namespaces.hh"
/** The QType class is meant to deal easily with the different kind of resource types, like 'A', 'NS',
* 'CNAME' etcetera. These types have both a name and a number. This class can seemlessly move between
# include "utility.hh"
#endif
-using namespace std;
+#include "namespaces.hh"
class RecordTextException : public runtime_error
{
#include "ahuexception.hh"
-using namespace std;
+#include "namespaces.hh"
RecursorControlChannel::RecursorControlChannel()
{
#include <sys/time.h>
#endif
-using namespace std;
+#include "namespaces.hh"
#include "namespaces.hh"
map<string, const uint32_t*> d_get32bitpointers;
map<string, const uint64_t*> d_get64bitpointers;
#include "arguments.hh"
#include "config.h"
-using namespace std;
+#include "namespaces.hh"
#ifndef RECURSOR
#include "statbag.hh"
#include "recursor_cache.hh"
#include "cachecleaner.hh"
-using namespace std;
+#include "namespaces.hh"
#include "namespaces.hh"
#include "config.h"
#include "recursor_memcached.hh"
#include <boost/lexical_cast.hpp>
-using namespace std;
+#include "namespaces.hh"
using boost::lexical_cast;
MemcachedCommunicator::MemcachedCommunicator(const std::string& servers)
#include "ahuexception.hh"
#include "dns.hh"
-using namespace std;
+#include "namespaces.hh"
class ResolverException : public AhuException
{
#include "namespaces.hh"
-using namespace std;
+#include "namespaces.hh"
static FDMultiplexer* make()
{
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>
#include <csignal>
-using namespace std;
+#include "namespaces.hh"
#include "namespaces.hh"
#include "arguments.hh"
#include "lock.hh"
-using namespace std;
+#include "namespaces.hh"
StatBag::StatBag()
{
#include <string>
#include <vector>
#include "lock.hh"
-using namespace std;
+#include "namespaces.hh"
class StatRing
{
# include <sys/select.h>
#endif // WIN32
-using namespace std;
+#include "namespaces.hh"
class TCPNameserver
{
#include "dnspacket.hh"
#include "dnsbackend.hh"
-using namespace std;
+#include "namespaces.hh"
class BackendReporter;
#endif
-using namespace std;
+#include "namespaces.hh"
// Closes a socket.
int Utility::closesocket( Utility::sock_t socket )
#endif // WIN32
#include <string>
-using namespace std;
+#include "namespaces.hh"
//! A semaphore class.
class Semaphore
#include <string>
-using namespace std;
+#include "namespaces.hh"
class Server;
class WebServer
#include "arguments.hh"
#include "statbag.hh"
#include "misc.hh"
-using namespace std;
+#include "namespaces.hh"
ArgvMap &arg()
{
#include "logger.hh"
#include "ntservice.hh"
#include "pdnsmsg.hh"
-using namespace std;
+#include "namespaces.hh"
Logger &theL(const string &pname)
{
#include "ahuexception.hh"
-using namespace std;
+#include "namespaces.hh"
RecursorControlChannel::RecursorControlChannel()
{
#endif // HAVE_CONFIG_H
#include "misc.hh"
-using namespace std;
+#include "namespaces.hh"
class Ewma
{
#include <stdexcept>
#include <stack>
-using namespace std;
+#include "namespaces.hh"
class ZoneParserTNG
{
string d_filename;
int d_lineno;
};
- stack<filestate> d_filestates;
+ std::stack<filestate> d_filestates;
};
#endif