* 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_BINDBACKEND_HH
-#define PDNS_BINDBACKEND_HH
-
+#pragma once
#include <string>
#include <map>
#include <set>
static void doEmptyNonTerminals(std::shared_ptr<recordstorage_t>& records, const DNSName& zoneName, bool nsec3zone, NSEC3PARAMRecordContent ns3pr);
void loadConfig(string *status=nullptr);
};
-
-#endif /* PDNS_BINDBACKEND_HH */
* 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_GEOIPBACKEND_HH
-#define PDNS_GEOIPBACKEND_HH
-
+#pragma once
#include "pdns/namespaces.hh"
#include <vector>
vector<DNSResourceRecord> d_result;
vector<GeoIPInterface> d_files;
};
-
-#endif /* PDNS_GEOIPBACKEND_HH */
* 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_GEOIPINTERFACE_HH
-#define PDNS_GEOIPINTERFACE_HH
-
+#pragma once
#include "boost/optional.hpp"
#include "geoipbackend.hh"
static unique_ptr<GeoIPInterface> makeMMDBInterface(const string &fname, const map<string, string>& opts);
static unique_ptr<GeoIPInterface> makeDATInterface(const string& fname, const map<string, string>& opts);
};
-
-#endif
* 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_GMYSQLBACKEND_HH
-#define PDNS_GMYSQLBACKEND_HH
-
+#pragma once
#include <string>
#include <map>
#include "pdns/backends/gsql/gsqlbackend.hh"
protected:
void reconnect() override;
};
-
-#endif /* PDNS_GMYSQLBACKEND_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef SMYSQL_HH
-#define SMYSQL_HH
-
+#pragma once
#include <mysql.h>
#include "pdns/backends/gsql/ssql.hh"
#include "pdns/utility.hh"
bool d_threadCleanup;
bool d_clientSSL;
};
-
-#endif /* SSMYSQL_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#pragma once
#include <string>
#include "pdns/backends/gsql/gsqlbackend.hh"
gODBCBackend( const std::string & mode, const std::string & suffix );
};
-
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef SODBC_HH
-#define SODBC_HH
-
+#pragma once
#include <string>
#include <vector>
SSqlException sPerrorException( const std::string & reason ) override;
};
-
-
-#endif // SODBC_HH
* 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_GPGSQLBACKEND_HH
-#define PDNS_GPGSQLBACKEND_HH
-
+#pragma once
#include <string>
#include <map>
#include "pdns/backends/gsql/gsqlbackend.hh"
void reconnect() override;
bool inTransaction() override;
};
-
-#endif /* PDNS_GPGSQLBACKEND_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef SPGSQL_HH
-#define SPGSQL_HH
+#pragma once
#include "pdns/namespaces.hh"
#include "pdns/backends/gsql/ssql.hh"
static bool s_dolog;
bool d_in_trx;
};
-
-#endif /* SPGSQL_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef GSQLITEBACKEND_HH
-#define GSQLITEBACKEND_HH
-
+#pragma once
#include <string>
#include "pdns/backends/gsql/gsqlbackend.hh"
//! Constructs the backend, throws an exception if it failed..
gSQLite3Backend( const std::string & mode, const std::string & suffix );
};
-
-#endif // GSQLITEBACKEND_HH
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
-#ifndef LUA2API_2_HH
-#define LUA2API_2_HH 1
-
#include "boost/lexical_cast.hpp"
#include "boost/algorithm/string/join.hpp"
#include "pdns/arguments.hh"
deinit_call_t f_deinit;
};
-
-#endif
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
-#ifndef LUA2BACKEND_HH
-#define LUA2BACKEND_HH 1
-
#include "pdns/dnsbackend.hh"
#include "pdns/lua-auth4.hh"
#include "lua2api2.hh"
-
-#endif
* 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_COPROCESS_HH
-#define PDNS_COPROCESS_HH
-
+#pragma once
#include <iostream>
#include <stdio.h>
#include <string>
FILE *d_fp;
};
bool isUnixSocket(const string& fname);
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef PIPEBACKEND_HH
-#define PIPEBACKEND_HH
-
+#pragma once
#include <string>
#include <map>
#include <sys/types.h>
-
#include "pdns/namespaces.hh"
#include "pdns/misc.hh"
bool d_disavow;
int d_abiVersion;
};
-
-
-#endif
-
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef REMOTEBACKEND_REMOTEBACKEND_HH
-
+#pragma once
#include <sys/types.h>
#include <sys/wait.h>
void parseDomainInfo(const json11::Json &obj, DomainInfo &di);
};
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef TINYDNSBACKEND_HH
-#define TINYDNSBACKEND_HH
-
+#pragma once
#include "pdns/dnsbackend.hh"
#include "pdns/logger.hh"
#include "pdns/iputils.hh"
static TDI_suffix_t s_domainInfo;
static uint32_t s_lastId; // used to give a domain an id.
};
-
-#endif // TINYDNSBACKEND_HH
* 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_ANADNS_HH
-#define PDNS_ANADNS_HH
+#pragma once
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <string>
s<<" to " << qi.d_dest.toStringWithPort();
return s;
}
-
-
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef ARGUMENTS_HH
-#define ARGUMENTS_HH
-
+#pragma once
#include <map>
#include <set>
#include <string>
};
extern ArgvMap &arg();
-
-#endif /* ARGUMENTS_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef AUTH_CACHES_HH
-#define AUTH_CACHES_HH
-
+#pragma once
#include <string>
#include <cstdint>
uint64_t purgeAuthCaches(); /* empty all caches */
uint64_t purgeAuthCaches(const std::string& match); /* remove specific entries from all caches, can be $ terminated */
uint64_t purgeAuthCachesExact(const DNSName& qname); /* remove specific entries from all caches, no wildcard matching */
-
-#endif /* AUTH_CACHES_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef AUTH_PACKETCACHE_HH
-#define AUTH_PACKETCACHE_HH
-
+#pragma once
#include <string>
#include <map>
#include "dns.hh"
static const unsigned int s_mincleaninterval=1000, s_maxcleaninterval=300000;
};
-
-#endif /* AUTH_PACKETCACHE_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef AUTH_QUERYCACHE_HH
-#define AUTH_QUERYCACHE_HH
-
+#pragma once
#include <string>
#include <map>
#include "dns.hh"
static const unsigned int s_mincleaninterval=1000, s_maxcleaninterval=300000;
};
-
-#endif /* AUTH_QUERYCACHE_HH */
* 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_GSQLBACKEND_HH
-#define PDNS_GSQLBACKEND_HH
-
+#pragma once
#include <string>
#include <map>
#include "ssql.hh"
bool d_dnssecQueries;
bool d_inTransaction{false};
};
-
-#endif /* PDNS_GSQLBACKEND_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef SSQL_HH
-#define SSQL_HH
-
+#pragma once
#include <string>
#include <vector>
#include <inttypes.h>
virtual void reconnect() {};
virtual ~SSql(){};
};
-
-#endif /* SSQL_HH */
* 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_BASE32_HH
-#define PDNS_BASE32_HH
+#pragma once
#include <string>
std::string toBase32Hex(const std::string& input);
std::string fromBase32Hex(const std::string& input);
-
-#endif
* 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_BASE64_HH
-#define PDNS_BASE64_HH
-
+#pragma once
#include <string>
int B64Decode(const std::string& src, std::string& dst);
std::string Base64Encode (const std::string& src);
-
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef BINDPARSER_HH
-#define BINDPARSER_HH
+#pragma once
#include <string>
#include <map>
#include <vector>
vector<BindDomainInfo> d_zonedomains;
bool d_verbose;
};
-
-#endif /* BINDPARSER_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef CDB_HH
-#define CDB_HH
-
+#pragma once
#include <cdb.h>
#include "misc.hh"
struct cdb_make d_cdbm;
int d_fd{-1};
};
-
-#endif // CDB_HH
* 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_COMMENT_HH
-#define PDNS_COMMENT_HH
-
+#pragma once
#include "utility.hh"
#include "qtype.hh"
#include <sys/types.h>
int domain_id;
QType qtype; //!< qtype of the associated RRset, ie A, CNAME, MX etc
};
-
-#endif /* PDNS_COMMENT_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef COMMON_STARTUP_HH
-#define COMMON_STARTUP_HH
-
+#pragma once
#include "auth-packetcache.hh"
#include "auth-querycache.hh"
#include "utility.hh"
extern time_t g_luaHealthChecksInterval;
extern time_t g_luaHealthChecksExpireDelay;
#endif // HAVE_LUA_RECORDS
-
-#endif // COMMON_STARTUP_HH
* 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_COMMUNICATOR_HH
-#define PDNS_COMMUNICATOR_HH
-
+#pragma once
#include <pthread.h>
#include <string>
#include <semaphore.h>
}
}
};
-
-
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef DISTRIBUTOR_HH
-#define DISTRIBUTOR_HH
-
+#pragma once
#include <string>
#include <deque>
#include <queue>
return ret;
}
-
-#endif // DISTRIBUTOR_HH
-
* 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_DNS_RANDOM
-#define PDNS_DNS_RANDOM
+#pragma once
#include <cstdint>
void dns_random_init(const std::string& data = "", bool force_reinit = false);
uint32_t dns_random(uint32_t n);
uint16_t dns_random_uint16();
-
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef DNSBACKEND_HH
-#define DNSBACKEND_HH
+#pragma once
class DNSPacket;
void fillSOAData(const DNSZoneRecord& in, SOAData& data);
// the reverse
std::shared_ptr<DNSRecordContent> makeSOAContent(const SOAData& sd);
-
-#endif
-#ifndef DNSDIST_SNMP_HH
-#define DNSDIST_SNMP_HH
-
+/*
+ * 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.
+ */
#pragma once
#include "snmp-agent.hh"
bool sendCustomTrap(const std::string& reason);
bool sendDNSTrap(const DNSQuestion&, const std::string& reason="");
};
-
-#endif /* DNSDIST_SNMP_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef DNSPACKET_HH
-
-#define DNSPACKET_HH
-
+#pragma once
#include <cstdio>
#include <cstring>
#include <cstdlib>
bool d_haveednssection{false};
bool d_isQuery;
};
-
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef DNSPARSER_HH
-#define DNSPARSER_HH
-
+#pragma once
#include <map>
#include <sstream>
#include <stdexcept>
uint32_t d_notyouroffset; // only 'moveOffset' can touch this
const uint32_t& d_offset; // look.. but don't touch
};
-
-#endif
* 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_DNSPCAP_HH
-#define PDNS_DNSPCAP_HH
-
+#pragma once
#include <cstdio>
#include <stdexcept>
#include "iputils.hh"
FILE *d_fp;
bool d_first{true};
};
-
-#endif // DNSPCAP_HH
* 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_DNSPROXY
-#define PDNS_DNSPROXY
+#pragma once
#include <pthread.h>
#include <map>
#include <sys/socket.h>
int getID_locked();
uint16_t d_xor;
};
-
-#endif
* 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_DNSRECORDS_HH
-#define PDNS_DNSRECORDS_HH
-
+#pragma once
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
void reportAllTypes();
ComboAddress getAddr(const DNSRecord& dr, uint16_t defport=0);
void checkHostnameCorrectness(const DNSResourceRecord& rr);
-#endif
* 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_DNSSECINFRA_HH
-#define PDNS_DNSSECINFRA_HH
-
+#pragma once
#include "dnsrecords.hh"
#include <string>
bool validateTSIG(const std::string& packet, size_t sigPos, const TSIGTriplet& tt, const TSIGRecordContent& trc, const std::string& previousMAC, const std::string& theirMAC, bool timersOnly, unsigned int dnsHeaderOffset=0);
uint64_t signatureCacheSize(const std::string& str);
-#endif
* 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_DNSWRITER_HH
-#define PDNS_DNSWRITER_HH
-
+#pragma once
#include <string>
#include <vector>
#include <map>
typedef vector<pair<string::size_type, string::size_type> > labelparts_t;
// bool labeltokUnescape(labelparts_t& parts, const DNSName& label);
std::vector<string> segmentDNSText(const string& text); // from dnslabeltext.rl
-#endif
+std::deque<string> segmentDNSName(const string& input); // from dnslabeltext.rl
+/*
+ * 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.
+ */
#pragma once
#include "iputils.hh"
#include "libssl.hh"
* 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_DYNHANDLER_HH
-#define PDNS_DYNHANDLER_HH
-
+#pragma once
#include <vector>
#include <string>
#include <stdlib.h>
string DLListZones(const vector<string>&parts, Utility::pid_t ppid);
string DLTokenLogin(const vector<string>&parts, Utility::pid_t ppid);
uint64_t udpErrorStats(const std::string& str);
-#endif /* PDNS_DYNHANDLER_HH */
* 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
-
+#pragma once
#include <string>
#include <vector>
#include <pthread.h>
static g_funk_t* s_restfunc;
bool testLive(const string& fname);
};
-#endif /* PDNS_DYNLISTENER */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef DYNMESSENGER_HH
-#define DYNMESSENGER_HH
-
+#pragma once
#include <string>
#include <sys/types.h>
#include <sys/socket.h>
int send(const string &message) const; //!< Send a message to a DynListener
string receive() const; //!< receive an answer from a DynListener
};
-
-#endif
* 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_EDNSCOOKIES_HH
-#define PDNS_EDNSCOOKIES_HH
-
+#pragma once
#include "namespaces.hh"
struct EDNSCookiesOpt
bool getEDNSCookiesOptFromString(const char* option, unsigned int len, EDNSCookiesOpt* eco);
bool getEDNSCookiesOptFromString(const string& option, EDNSCookiesOpt* eco);
string makeEDNSCookiesOptString(const EDNSCookiesOpt& eco);
-#endif
* 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_EDNSOPTIONS_HH
-#define PDNS_EDNSOPTIONS_HH
-
+#pragma once
#include "namespaces.hh"
struct EDNSOptionCode
bool getEDNSOptionsFromContent(const std::string& content, std::vector<std::pair<uint16_t, std::string>>& options);
void generateEDNSOption(uint16_t optionCode, const std::string& payload, std::string& res);
-
-#endif
* 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_EDNSSUBNET_HH
-#define PDNS_EDNSSUBNET_HH
-
+#pragma once
#include "namespaces.hh"
#include "iputils.hh"
#include "dnsname.hh"
bool getEDNSSubnetOptsFromString(const string& options, EDNSSubnetOpts* eso);
bool getEDNSSubnetOptsFromString(const char* options, unsigned int len, EDNSSubnetOpts* eso);
string makeEDNSSubnetOptsString(const EDNSSubnetOpts& eso);
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef GSS_CONTEXT_HH
-#define GSS_CONTEXT_HH
#pragma once
#ifdef ENABLE_GSS_TSIG
bool gss_add_signature(const DNSName& context, const std::string& message, std::string& mac); //<! Create signature
bool gss_verify_signature(const DNSName& context, const std::string& message, const std::string& mac); //<! Validate signature
-
-#endif
* 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_IPUTILSHH
-#define PDNS_IPUTILSHH
-
+#pragma once
#include <string>
#include <sys/socket.h>
#include <netinet/in.h>
bool isTCPSocketUsable(int sock);
extern template class NetmaskTree<bool>;
-
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef LAZY_ALLOCATOR_HH
-#define LAZY_ALLOCATOR_HH
-
+#pragma once
#include <cstddef>
#include <utility>
#include <type_traits>
bool operator!= (lazy_allocator<T> const&, lazy_allocator<T> const&) noexcept {
return false;
}
-
-#endif // LAZY_ALLOCATOR_HH
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef LOCK_HH
-#define LOCK_HH
-
+#pragma once
#include <pthread.h>
#include <errno.h>
#include "misc.hh"
WriteLock(const WriteLock& rhs) = delete;
WriteLock& operator=(const WriteLock& rhs) = delete;
-
};
class TryWriteLock
ReadLock(const ReadLock& rhs) = delete;
ReadLock& operator=(const ReadLock& rhs) = delete;
};
-#endif
* 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_LWRES_HH
-#define PDNS_LWRES_HH
+#pragma once
#include <string>
#include <vector>
#include <sys/types.h>
};
int asyncresolve(const ComboAddress& ip, const DNSName& domain, int type, bool doTCP, bool sendRDQuery, int EDNS0Level, struct timeval* now, boost::optional<Netmask>& srcmask, boost::optional<const ResolveContext&> context, const std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>>& outgoingLoggers, const std::shared_ptr<std::vector<std::unique_ptr<FrameStreamLogger>>>& fstrmLoggers, const std::set<uint16_t>& exportTypes, LWResult* res, bool* chained);
-#endif // PDNS_LWRES_HH
* 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_MPLEXER_HH
-#define PDNS_MPLEXER_HH
+#pragma once
#include <boost/function.hpp>
#include <boost/any.hpp>
#include <boost/shared_array.hpp>
}
}
};
-
-
-#endif
-
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MTASKER_HH
-#define MTASKER_HH
+#pragma once
#include <stdint.h>
#include <queue>
#include <vector>
EventKey d_eventkey; // for waitEvent, contains exact key it was awoken for
};
#include "mtasker.cc"
-
-#endif // MTASKER_HH
-
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MTASKER_CONTEXT_HH
-#define MTASKER_CONTEXT_HH
-
+#pragma once
#include "lazy_allocator.hh"
#include <boost/function.hpp>
#include <vector>
#endif /* HAVE_SANITIZER_FINISH_SWITCH_FIBER_SINGLE_PTR */
#endif /* HAVE_FIBER_SANITIZER */
}
-
-
-#endif // MTASKER_CONTEXT_HH
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef NAMESERVER_HH
-#define NAMESERVER_HH
-
+#pragma once
#include <poll.h>
#include <sys/types.h>
#include <sys/socket.h>
bool AddressIsUs(const ComboAddress& remote);
extern ResponseStats g_rs;
-
-#endif
* 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_NAMESPACES_HH
-#define PDNS_NAMESPACES_HH
+#pragma once
#include <boost/tuple/tuple.hpp>
#include <boost/shared_array.hpp>
#include <boost/scoped_array.hpp>
using boost::equals;
using boost::ends_with;
using boost::iends_with;
-
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef PACKETCACHE_HH
-#define PACKETCACHE_HH
-
+#pragma once
#include "ednsoptions.hh"
#include "misc.hh"
#include "iputils.hh"
}
};
-
-#endif /* PACKETCACHE_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef PACKETHANDLER_HH
-#define PACKETHANDLER_HH
-
+#pragma once
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
};
std::shared_ptr<DNSRecordContent> makeSOAContent(const SOAData& sd);
-#endif /* PACKETHANDLER */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef PDNSEXCEPTION_HH
-#define PDNSEXCEPTION_HH
-/* (C) 2002 POWERDNS.COM BV */
-
+#pragma once
#include<string>
#include "namespaces.hh"
TimeoutException() : PDNSException() {}
TimeoutException(string r) : PDNSException(r) {}
};
-
-#endif
* 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_PKCS11SIGNERS_HH
-#define PDNS_PKCS11SIGNERS_HH
+#pragma once
class PKCS11DNSCryptoKeyEngine : public DNSCryptoKeyEngine
{
};
bool PKCS11ModuleSlotLogin(const std::string& module, const string& tokenId, const std::string& pin);
-
-#endif /* PDNS_PKCS11SIGNERS_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef QTYPE_HH
-#define QTYPE_HH
-// $Id$
+#pragma once
#include <string>
#include <vector>
#include "namespaces.hh"
{
enum QClassEnum {IN=1, CHAOS=3, NONE=254, ANY=255};
};
-#endif
* 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_RCPGENERATOR_HH
-#define PDNS_RCPGENERATOR_HH
+#pragma once
#include <inttypes.h>
#include <string>
#include <stdexcept>
string& d_string;
bool d_nodot;
};
-#endif
-#ifndef REC_SNMP_HH
-#define REC_SNMP_HH
-
+/*
+ * 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.
+ */
#pragma once
#include "snmp-agent.hh"
};
extern std::shared_ptr<RecursorSNMPAgent> g_snmpAgent;
-
-#endif /* REC_SNMP_HH */
* 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_RECPACKETCACHE_HH
-#define PDNS_RECPACKETCACHE_HH
+#pragma once
#include <string>
#include <inttypes.h>
#include "dns.hh"
{
}
};
-
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef RECURSOR_CACHE_HH
-#define RECURSOR_CACHE_HH
+#pragma once
#include <string>
#include <set>
#include "dns.hh"
}
}
};
-#endif
* 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_RESOLVER_HH
-#define PDNS_RESOLVER_HH
-
+#pragma once
#include <string>
#include <vector>
#include <sys/types.h>
size_t d_maxReceivedBytes;
TSIGRecordContent d_trc;
};
-
-
-#endif /* PDNS_RESOLVER_HH */
* 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_SECPOLL_AUTH_HH
-#define PDNS_SECPOLL_AUTH_HH
+#pragma once
#include <time.h>
#include "namespaces.hh"
#include "stubresolver.hh"
void doSecPoll(bool first);
extern std::string g_security_message;
-
-#endif
* 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_SECPOLL_RECURSOR_HH
-#define PDNS_SECPOLL_RECURSOR_HH
+#pragma once
#include <time.h>
#include "namespaces.hh"
#include <stdint.h>
void doSecPoll(time_t* );
extern uint32_t g_security_status;
extern std::string g_security_message;
-
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef _SHA_HH
-#define _SHA_HH
-
+#pragma once
#include <string>
#include <stdint.h>
#include <openssl/sha.h>
SHA512(reinterpret_cast<const unsigned char*>(input.c_str()), input.length(), result);
return std::string(result, result + sizeof result);
}
-
-#endif /* sha.hh */
* 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_SIGNINGPIPE
-#define PDNS_SIGNINGPIPE
+#pragma once
#include <stdio.h>
#include <thread>
#include <vector>
bool d_mustSign;
bool d_final;
};
-
-#endif
-#ifndef SNMP_AGENT_HH
-#define SNMP_AGENT_HH
-
+#pragma once
#include "config.h"
#include <string>
std::thread d_thread;
};
-
-#endif /* SNMP_AGENT_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef SSQLITE3_HH
-#define SSQLITE3_HH
-
+#pragma once
#include <sqlite3.h>
#include "pdns/backends/gsql/ssql.hh"
//! Used to create an backend specific exception message.
SSqlException sPerrorException( const std::string & reason ) override;
};
-
-#endif // SSQLITE3_HH
-
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef SSTUFF_HH
-#define SSTUFF_HH
-
+#pragma once
#include <string>
#include <sstream>
#include <iostream>
std::string d_buffer;
int d_socket;
};
-
-
-#endif
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef STATBAG_HH
-#define STATBAG_HH
+#pragma once
#include <pthread.h>
#include <map>
#include <mutex>
#include "circular_buffer.hh"
-
template<typename T, typename Comp=std::less<T> >
class StatRing
{
{
deposit(key,1);
}
-
-
-#endif /* STATBAG_HH */
* 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_TCPRECEIVER_HH
-#define PDNS_TCPRECEIVER_HH
-
+#pragma once
#include "dns.hh"
#include "iputils.hh"
#include "dnsbackend.hh"
vector<int>d_sockets;
vector<struct pollfd> d_prfds;
};
-
-#endif /* PDNS_TCPRECEIVER_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef UEBERBACKEND_HH
-#define UEBERBACKEND_HH
-
+#pragma once
#include <vector>
#include <map>
#include <string>
void addCache(const Question &q, const vector<DNSZoneRecord> &rrs);
};
-
-#endif
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
// Utility class specification.
-
-#ifndef UTILITY_HH
-#define UTILITY_HH
+#pragma once
#ifdef NEED_POSIX_TYPEDEF
typedef unsigned char uint8_t;
static time_t timegm(struct tm *tm);
};
-
-
-#endif // UTILITY_HH
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef VERSION_HH
-#define VERSION_HH
-
+#pragma once
#include "namespaces.hh"
enum ProductType { ProductAuthoritative, ProductRecursor };
string productTypeApiType();
void versionSetProduct(ProductType pt);
ProductType versionGetProduct();
-
-#endif //!VERSION_HH
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef WEBSERVER_HH
-#define WEBSERVER_HH
+#pragma once
#include <map>
#include <string>
#include <list>
// Describes the amount of logging the webserver does
WebServer::LogLevel d_loglevel{WebServer::LogLevel::Detailed};
};
-
-#endif /* WEBSERVER_HH */
* 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_WSAPI_HH
-#define PDNS_WSAPI_HH
-
+#pragma once
#include <map>
#include "webserver.hh"
// To be provided by product code.
void productServerStatisticsFetch(std::map<string,string>& out);
boost::optional<uint64_t> productServerStatisticsFetch(const std::string& name);
-
-#endif /* PDNS_WSAPI_HH */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef WS_HH
-#define WS_HH
+#pragma once
#include <string>
#include <map>
#include <time.h>
Ewma d_qcachehits, d_qcachemisses;
WebServer *d_ws{nullptr};
};
-
-#endif
* 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_WSRECURSOR_HH
-#define PDNS_WSRECURSOR_HH
-
+#pragma once
#include <boost/utility.hpp>
#include "namespaces.hh"
#include "mplexer.hh"
private:
std::unique_ptr<AsyncWebServer> d_ws{nullptr};
};
-
-#endif /* PDNS_WSRECURSOR_HH */
* 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_ZONEPARSER_TNG
-#define PDNS_ZONEPARSER_TNG
+#pragma once
#include <string>
#include <cstdio>
#include <stdexcept>
bool d_fromfile;
bool d_generateEnabled{true};
};
-
-#endif