]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix warnings about dup/missing prototypes 9056/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 24 Apr 2020 13:36:08 +0000 (15:36 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 24 Apr 2020 13:36:08 +0000 (15:36 +0200)
54 files changed:
modules/geoipbackend/geoipbackend.cc
modules/lmdbbackend/lmdbbackend.cc
pdns/auth-caches.cc
pdns/base32.cc
pdns/bindparser.yy
pdns/common_startup.hh
pdns/dnsbulktest.cc
pdns/dnsgram.cc
pdns/dnslabeltext.rl
pdns/dnsreplay.cc
pdns/dnsscan.cc
pdns/dnsscope.cc
pdns/dnstcpbench.cc
pdns/dnswasher.cc
pdns/dynhandler.hh
pdns/fuzz_dnsdistcache.cc
pdns/fuzz_moadnsparser.cc
pdns/fuzz_packetcache.cc
pdns/fuzz_proxyprotocol.cc
pdns/fuzz_zoneparsertng.cc
pdns/ixfrdist-stats.hh
pdns/ixfrdist-web.cc
pdns/ixfrdist.cc
pdns/ixplore.cc
pdns/lua-record.cc
pdns/notify.cc
pdns/nproxy.cc
pdns/nsec3dig.cc
pdns/packethandler.hh
pdns/pdns_recursor.cc
pdns/pdnsutil.cc
pdns/rcpgenerator.cc
pdns/rec_channel_rec.cc
pdns/receiver.cc
pdns/recursordist/test-nod_cc.cc
pdns/recursordist/test-rpzloader_cc.cc
pdns/recursordist/test-secpoll_cc.cc
pdns/recursordist/test-syncres_cc.cc
pdns/recursordist/test-syncres_cc.hh
pdns/recursordist/test-syncres_cc2.cc
pdns/recursordist/testrunner.cc
pdns/reczones.cc
pdns/sdig.cc
pdns/secpoll.cc
pdns/ssqlite3.cc
pdns/stubquery.cc
pdns/tcpreceiver.cc
pdns/test-dnsrecords_cc.cc
pdns/testrunner.cc
pdns/tsigutils.cc
pdns/ueberbackend.cc
pdns/ws-auth.cc
pdns/zone2ldap.cc
pdns/zoneparser-tng.cc

index 2238ababdfd3a3ef776171e926acfbdf4e3b5ae1..d812efa31504669740d53be5d90d650c17778e1f 100644 (file)
@@ -519,7 +519,7 @@ string getGeoForLua(const std::string& ip, int qaint)
   return "";
 }
 
-bool queryGeoLocation(const Netmask& addr, GeoIPNetmask& gl, double& lat, double& lon,
+static bool queryGeoLocation(const Netmask& addr, GeoIPNetmask& gl, double& lat, double& lon,
                       boost::optional<int>& alt, boost::optional<int>& prec)
 {
   for(auto const& gi: s_geoip_files) {
index 624a4c1432540dde4ad257b55b2f39281748f266..56096cd4609c6bc6ff128415aef864737e715526 100644 (file)
@@ -231,13 +231,13 @@ void serFromString(const string_view& str, DNSResourceRecord& rr)
 }
 
 
-std::string serializeContent(uint16_t qtype, const DNSName& domain, const std::string& content)
+static std::string serializeContent(uint16_t qtype, const DNSName& domain, const std::string& content)
 {
   auto drc = DNSRecordContent::mastermake(qtype, 1, content);
   return drc->serialize(domain, false);
 }
 
-std::shared_ptr<DNSRecordContent> deserializeContentZR(uint16_t qtype, const DNSName& qname, const std::string& content)
+static std::shared_ptr<DNSRecordContent> deserializeContentZR(uint16_t qtype, const DNSName& qname, const std::string& content)
 {
   if(qtype == QType::A && content.size() == 4) {
     return std::make_shared<ARecordContent>(*((uint32_t*)content.c_str()));
index c33575a23d87ba702a93ee29a6fac8387ed0f1be..4fd75bb74a9624987200346d3abf8876d4b294f3 100644 (file)
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#include "auth-caches.hh"
 #include "auth-querycache.hh"
 #include "auth-packetcache.hh"
 
index 16d9d4bab44469bc2b44e3b0fb0eff99edcd3053..b07ed50cee6f4d7a1595395f60a547318b991ee7 100644 (file)
@@ -33,7 +33,7 @@
 
 /* based on freebsd:src/contrib/opie/libopie/btoe.c extract: get bit ranges from a char* */
 /* NOTE: length should not exceed 8; all callers inside PowerDNS only pass length=5 though */
-unsigned char extract_bits(const char *s, int start, int length)
+static unsigned char extract_bits(const char *s, int start, int length)
 {
   uint16_t x;
   unsigned char cl, cc;
index df05341467d5178de4a6e22d201d3360b77e1ef1..4557c832a1de157865f12e683ac7317eb6cbfce1 100644 (file)
@@ -22,7 +22,8 @@ extern "C"
        int yyparse(void);
        int yylex(void);
        void yyrestart(FILE *);
-       int yywrap()
+       int yywrap(void);
+       int yywrap(void)
        {
                return 1;
        }
index 45c8045c0c817bcc267bfc483ec131ac0509331f..9ce7101b941a66ba7054d3d65fa000d7b48f7fcb 100644 (file)
@@ -45,7 +45,6 @@ extern std::shared_ptr<UDPNameserver> N;
 extern vector<std::shared_ptr<UDPNameserver> > g_udpReceivers;
 extern int avg_latency;
 extern std::unique_ptr<TCPNameserver> TN;
-extern ArgvMap & arg( void );
 extern void declareArguments();
 extern void declareStats();
 extern void mainthread();
index a93866e99dbc436d0829b826afa2bcde809fd807..5570728b9114494b424a22ec87cd2fa0a9bcf227 100644 (file)
@@ -215,7 +215,7 @@ struct SendReceive
   unsigned int d_receiveds, d_receiveerrors, d_senderrors;
 };
 
-void usage(po::options_description &desc) {
+static void usage(po::options_description &desc) {
   cerr << "Usage: dnsbulktest [OPTION].. IPADDRESS PORTNUMBER [LIMIT]"<<endl;
   cerr << desc << "\n";
 }
index 34fd0ca1d2c8238a9b986ad64081ed769ad2a884..a3bdc7d8d146cc5f3bbe9ead760a1d64084db61e 100644 (file)
@@ -40,7 +40,7 @@
 
 StatBag S;
 
-struct tm* pdns_localtime_r(const uint32_t* then, struct tm* tm)
+static struct tm* pdns_localtime_r(const uint32_t* then, struct tm* tm)
 {
   time_t t = *then;
   
@@ -49,7 +49,8 @@ struct tm* pdns_localtime_r(const uint32_t* then, struct tm* tm)
 
 int32_t g_clientQuestions, g_clientResponses, g_serverQuestions, g_serverResponses, g_skipped;
 struct pdns_timeval g_lastanswerTime, g_lastquestionTime;
-void makeReport(const struct pdns_timeval& tv)
+
+static void makeReport(const struct pdns_timeval& tv)
 {
   int64_t clientdiff = g_clientQuestions - g_clientResponses;
   int64_t serverdiff = g_serverQuestions - g_serverResponses;
@@ -100,7 +101,7 @@ void makeReport(const struct pdns_timeval& tv)
   g_skipped=0;
 }
 
-void usage() {
+static void usage() {
   cerr<<"syntax: dnsgram INFILE..."<<endl;
 }
 
index 826f666845bf3efcbdac60b737757686ce268b0c..ebd8944e11039b42e10b778cbe7e6c54d2549faf 100644 (file)
@@ -5,6 +5,7 @@
 #include <string>
 #include "dnsname.hh"
 #include "namespaces.hh"
+#include "dnswriter.hh"
 
 namespace {
 void appendSplit(vector<string>& ret, string& segment, char c)
index f82d6542b0f179478f3cf6562bdd6e996e87453e..c7cda449bb4ac108a088b2943f102fce0c8ffde8 100644 (file)
@@ -93,7 +93,7 @@ namespace po = boost::program_options;
 
 po::variables_map g_vm;
 
-const struct timeval operator*(float fact, const struct timeval& rhs)
+static const struct timeval operator*(float fact, const struct timeval& rhs)
 {
   //  cout<<"In: "<<rhs.tv_sec<<" + "<<rhs.tv_usec<<"\n";
   struct timeval ret;
@@ -121,7 +121,7 @@ const struct timeval operator*(float fact, const struct timeval& rhs)
 }
 
 bool g_pleaseQuit;
-void pleaseQuitHandler(int)
+static void pleaseQuitHandler(int)
 {
   g_pleaseQuit=true;
 }
@@ -164,7 +164,7 @@ private:
 } s_idmanager;
 
 
-void setSocketBuffer(int fd, int optname, uint32_t size)
+static void setSocketBuffer(int fd, int optname, uint32_t size)
 {
   uint32_t psize=0;
   socklen_t len=sizeof(psize);
@@ -225,7 +225,7 @@ unsigned int s_wednserrors, s_origdnserrors, s_duplicates;
 
 
 
-void WeOrigSlowQueriesDelta(int& weOutstanding, int& origOutstanding, int& weSlow, int& origSlow)
+static void WeOrigSlowQueriesDelta(int& weOutstanding, int& origOutstanding, int& weSlow, int& origSlow)
 {
   struct timeval now;
   gettimeofday(&now, 0);
@@ -265,21 +265,21 @@ void WeOrigSlowQueriesDelta(int& weOutstanding, int& origOutstanding, int& weSlo
   }
 }
 
-void compactAnswerSet(MOADNSParser::answers_t orig, set<DNSRecord>& compacted)
+static void compactAnswerSet(MOADNSParser::answers_t orig, set<DNSRecord>& compacted)
 {
   for(MOADNSParser::answers_t::const_iterator i=orig.begin(); i != orig.end(); ++i)
     if(i->first.d_place==DNSResourceRecord::ANSWER)
       compacted.insert(i->first);
 }
 
-bool isRcodeOk(int rcode)
+static bool isRcodeOk(int rcode)
 {
   return rcode==0 || rcode==3;
 }
 
 set<pair<DNSName,uint16_t> > s_origbetterset;
 
-bool isRootReferral(const MOADNSParser::answers_t& answers)
+static bool isRootReferral(const MOADNSParser::answers_t& answers)
 {
   if(answers.empty())
     return false;
@@ -296,7 +296,7 @@ bool isRootReferral(const MOADNSParser::answers_t& answers)
 }
 
 vector<uint32_t> flightTimes;
-void accountFlightTime(qids_t::const_iterator iter)
+static void accountFlightTime(qids_t::const_iterator iter)
 {
   if(flightTimes.empty())
     flightTimes.resize(2050); 
@@ -310,7 +310,7 @@ void accountFlightTime(qids_t::const_iterator iter)
   flightTimes[mdiff]++;
 }
 
-uint64_t countLessThan(unsigned int msec)
+static uint64_t countLessThan(unsigned int msec)
 {
   uint64_t ret=0;
   for(unsigned int i = 0 ; i < msec && i < flightTimes.size() ; ++i) {
@@ -319,7 +319,7 @@ uint64_t countLessThan(unsigned int msec)
   return ret;
 }
 
-void emitFlightTimes()
+static void emitFlightTimes()
 {
   uint64_t totals = countLessThan(flightTimes.size());
   unsigned int limits[]={1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 100, 200, 500, 1000, (unsigned int) flightTimes.size()};
@@ -338,7 +338,7 @@ void emitFlightTimes()
   }
 }
 
-void measureResultAndClean(qids_t::const_iterator iter)
+static void measureResultAndClean(qids_t::const_iterator iter)
 {
   const QuestionData& qd=*iter;
   accountFlightTime(iter);
@@ -406,7 +406,7 @@ void measureResultAndClean(qids_t::const_iterator iter)
 
 std::unique_ptr<Socket> s_socket = nullptr;
 
-void receiveFromReference()
+static void receiveFromReference()
 try
 {
   string packet;
@@ -469,7 +469,7 @@ catch(...)
   exit(1);
 }
 
-void pruneQids()
+static void pruneQids()
 {
   struct timeval now;
   gettimeofday(&now, 0);
@@ -491,7 +491,7 @@ void pruneQids()
   }
 }
 
-void printStats(uint64_t origWaitingFor=0, uint64_t weWaitingFor=0)
+static void printStats(uint64_t origWaitingFor=0, uint64_t weWaitingFor=0)
 {
   format headerfmt   ("%|9t|Questions - Pend. - Drop = Answers = (On time + Late) = (Err + Ok)\n");
   format datafmt("%s%|9t|%d %|21t|%d %|29t|%d %|36t|%d %|47t|%d %|57t|%d %|66t|%d %|72t|%d\n");
@@ -511,7 +511,7 @@ void printStats(uint64_t origWaitingFor=0, uint64_t weWaitingFor=0)
 
 }
 
-void houseKeeping()
+static void houseKeeping()
 {
   static timeval last;
 
@@ -703,7 +703,7 @@ static bool sendPacketFromPR(PcapPacketReader& pr, const ComboAddress& remote, i
   return sent;
 }
 
-void usage(po::options_description &desc) {
+static void usage(po::options_description &desc) {
   cerr << "Usage: dnsreplay [OPTIONS] FILENAME [IP-ADDRESS] [PORT]"<<endl;
   cerr << desc << "\n";
 }
index 936a05dd9390707348fa20b898c9a4be03d3d51d..e447c1a681b6a614d4862625c1652e57c4ed9075 100644 (file)
@@ -44,7 +44,7 @@ using namespace ::boost::multi_index;
 #include "namespaces.hh"
 StatBag S;
 
-void usage() {
+static void usage() {
   cerr<<"syntax: dnsscan INFILE ..."<<endl;
 }
 
index e58be17ba3b687cb3ef2e05a56813ed1388cdc70..1427b1921651effb9fa1db6f6e2aa6c0846bac48 100644 (file)
@@ -74,7 +74,7 @@ struct QuestionData
 typedef map<QuestionIdentifier, QuestionData> statmap_t;
 statmap_t statmap;
 
-unsigned int liveQuestions()
+static unsigned int liveQuestions()
 {
   unsigned int ret=0;
   for(statmap_t::value_type& val :  statmap) {
@@ -107,7 +107,7 @@ struct LiveCounts
   }
 };
 
-void visitor(const StatNode* node, const StatNode::Stat& selfstat, const StatNode::Stat& childstat)
+static void visitor(const StatNode* node, const StatNode::Stat& selfstat, const StatNode::Stat& childstat)
 {
   // 20% servfails, >100 children, on average less than 2 copies of a query
   // >100 different subqueries
@@ -123,7 +123,7 @@ void visitor(const StatNode* node, const StatNode::Stat& selfstat, const StatNod
   }
 }
 
-const struct timeval operator-(const struct pdns_timeval& lhs, const struct pdns_timeval& rhs)
+static const struct timeval operator-(const struct pdns_timeval& lhs, const struct pdns_timeval& rhs)
 {
   struct timeval a{lhs.tv_sec, static_cast<suseconds_t>(lhs.tv_usec)}, b{rhs.tv_sec, static_cast<suseconds_t>(rhs.tv_usec)};
   return operator-(a,b);
index eef62272903e951465ddf1863ee9db6078a9adc9..922c05ff226e8471856e0472b192ebd08a07c6db 100644 (file)
@@ -51,7 +51,7 @@ unsigned int g_timeoutMsec;
 AtomicCounter g_networkErrors, g_otherErrors, g_OK, g_truncates, g_authAnswers, g_timeOuts;
 ComboAddress g_dest;
 
-unsigned int makeUsec(const struct timeval& tv)
+static unsigned int makeUsec(const struct timeval& tv)
 {
   return 1000000*tv.tv_sec + tv.tv_usec;
 }
@@ -69,7 +69,7 @@ struct BenchQuery
   time_t answerSecond;
 };
 
-void doQuery(BenchQuery* q)
+static void doQuery(BenchQuery* q)
 try
 {
   vector<uint8_t> packet;
@@ -185,7 +185,7 @@ static void* worker(void*)
   return 0;
 }
 
-void usage(po::options_description &desc) {
+static void usage(po::options_description &desc) {
   cerr<<"Syntax: dnstcpbench REMOTE [PORT] < QUERIES"<<endl;
   cerr<<"Where QUERIES is one query per line, format: qname qtype, just 1 space"<<endl;
   cerr<<desc<<endl;
index c3da28c2d595845a749e49d34922b9b72779ce00..62142228616dee05f5ba7e76585af6aec9580544 100644 (file)
@@ -161,7 +161,7 @@ private:
 };
 
 
-void usage() {
+static void usage() {
   cerr<<"Syntax: dnswasher INFILE1 [INFILE2..] OUTFILE"<<endl;
 }
 
index 774ae5c4bac23e05516db4062d73bf266a91a453..6ac9d982ead8d25c6150d29072bce94938514743 100644 (file)
@@ -54,4 +54,3 @@ string DLNotifyRetrieveHandler(const vector<string>&parts, Utility::pid_t ppid);
 string DLCurrentConfigHandler(const vector<string>&parts, Utility::pid_t ppid);
 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);
index 8b2ed7d1fefbc438221bd146256b260d94a8da4d..8b670fe470d4022ba1ed63a8b8c42365a43ba9c4 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "dnsdist-cache.hh"
 
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
+
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
 
   if (size > std::numeric_limits<uint16_t>::max()) {
index ea5fe25e9f7491f54c8872a013c27585b5837f26..2605ea82047efcb4abf3c630d32fb89080667641 100644 (file)
@@ -31,6 +31,8 @@ static void init()
   reportAllTypes();
 }
 
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
+
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   static bool initialized = false;
 
index faea0169205cf99f4225f1a58f9200740550b1de..1658b18f55be6d624290cce3c72adf434f8ed012 100644 (file)
@@ -25,6 +25,8 @@
 
 StatBag S;
 
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
+
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
 
   if (size > std::numeric_limits<uint16_t>::max()) {
index d138d6faacf0614981513460807bf43bdb41776b..25885c8883d08952f2233f94b5a7eff5bcb31e4e 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "proxy-protocol.hh"
 
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
+
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
 
   std::vector<ProxyProtocolValue> values;
index 442555b12200d17b07640c0e22608ba589fe9c5f..3285860a9d1669b284ff95a25e50a2c8d404afdb 100644 (file)
@@ -33,6 +33,8 @@ static void init()
   reportAllTypes();
 }
 
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
+
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   static bool initialized = false;
 
index 4c8b25b846b6bb876f88bb92ee8f6f1e0b1a009c..addfe060030e2b48e97280a478a98ec25a2bf9da 100644 (file)
@@ -96,3 +96,5 @@ class ixfrdistStats {
       return ret;
     };
 };
+
+extern string doGetStats();
index 485e720bcd8d2700be491a236f88feb1ed52b321..dababdc3fd749c7629878a0953201dc1939ffc08 100644 (file)
@@ -25,8 +25,6 @@
 #include "iputils.hh"
 #include "ixfrdist-stats.hh"
 
-string doGetStats();
-
 IXFRDistWebServer::IXFRDistWebServer(const ComboAddress &listenAddress, const NetmaskGroup &acl, const string &loglevel) :
   d_ws(std::unique_ptr<WebServer>(new WebServer(listenAddress.toString(), listenAddress.getPort())))
 {
index 7d9a0eb0274c6c14cddc0c04c243cbf24fa8c254..0ad22589efb472d2a0ceee7a8a343604fb2c1aeb 100644 (file)
@@ -271,7 +271,7 @@ static void updateCurrentZoneInfo(const DNSName& domain, std::shared_ptr<ixfrinf
   // FIXME: also report zone size?
 }
 
-void updateThread(const string& workdir, const uint16_t& keep, const uint16_t& axfrTimeout, const uint16_t& soaRetry, const uint32_t axfrMaxRecords) {
+static void updateThread(const string& workdir, const uint16_t& keep, const uint16_t& axfrTimeout, const uint16_t& soaRetry, const uint32_t axfrMaxRecords) {
   setThreadName("ixfrdist/update");
   std::map<DNSName, time_t> lastCheck;
 
index 9b525de1b00f925387376265a529d04865e6a2ef..b68e884a8697c7a4e2c875432b5e9351696e7638 100644 (file)
@@ -46,7 +46,7 @@ ArgvMap &arg()
   return theArg;
 }
 
-void usage() {
+static void usage() {
   cerr<<"Syntax: ixplore diff ZONE BEFORE_FILE AFTER_FILE"<<endl;
   cerr<<"Syntax: ixplore track IP-ADDRESS PORT ZONE DIRECTORY [TSIGKEY TSIGALGO TSIGSECRET]"<<endl;
 }
index ddcb3f7da04e719892db59cc910751e2cbce9070..ee38aeb61bd761538f7c6e0e875489556a7832f5 100644 (file)
@@ -284,7 +284,7 @@ bool doCompare(const T& var, const std::string& res, const C& cmp)
 }
 
 
-std::string getGeo(const std::string& ip, GeoIPInterface::GeoIPQueryAttribute qa)
+static std::string getGeo(const std::string& ip, GeoIPInterface::GeoIPQueryAttribute qa)
 {
   static bool initialized;
   extern std::function<std::string(const std::string& ip, int)> g_getGeo;
@@ -527,7 +527,7 @@ typedef struct AuthLuaRecordContext
 
 static thread_local unique_ptr<lua_record_ctx_t> s_lua_record_ctx;
 
-void setupLuaRecords()
+static void setupLuaRecords()
 {
   LuaContext& lua = *s_LUA->getLua();
 
index dace6775c03291eeee7dc14c2247d9c5e69793f7..597b833492343320445e175d98c2ef861d9574d6 100644 (file)
@@ -52,7 +52,7 @@ ArgvMap &arg()
   return arg;
 }
 
-void usage() {
+static void usage() {
   cerr<<"Syntax: pdns_notify IP_ADDRESS/HOSTNAME[:PORT] DOMAIN"<<endl;
 }
 
index e79f8de75966accec800dc6336413b08e6f8dc10..44d2f31d9f67bb59b2d0f4a70f1ef1be070e3bae 100644 (file)
@@ -67,13 +67,13 @@ struct NotificationInFlight
 typedef map<uint16_t, NotificationInFlight> nifs_t;
 nifs_t g_nifs;
 
-void syslogFmt(const boost::format& fmt)
+static void syslogFmt(const boost::format& fmt)
 {
   cerr<<"nproxy: "<<fmt<<endl;
   syslog(LOG_WARNING, "%s", str(fmt).c_str());
 }
 
-void handleOutsideUDPPacket(int fd, boost::any&)
+static void handleOutsideUDPPacket(int fd, boost::any&)
 try
 {
   char buffer[1500];
@@ -145,7 +145,7 @@ catch(std::exception &e)
 }
 
 
-void handleInsideUDPPacket(int fd, boost::any&)
+static void handleInsideUDPPacket(int fd, boost::any&)
 try
 {
   char buffer[1500];
@@ -191,7 +191,7 @@ catch(std::exception &e)
   syslogFmt(boost::format("Error parsing packet from internal nameserver: %s") % e.what());
 }
 
-void expireOldNotifications()
+static void expireOldNotifications()
 {
   time_t limit = time(0) - 10;
   for(nifs_t::iterator iter = g_nifs.begin(); iter != g_nifs.end(); ) {
@@ -204,9 +204,19 @@ void expireOldNotifications()
   }
 }
 
-void daemonize(int null_fd);
+static void daemonize(int null_fd)
+{
+  if(fork())
+    exit(0); // bye bye
 
-void usage(po::options_description &desc) {
+  setsid();
+
+  dup2(null_fd,0); /* stdin */
+  dup2(null_fd,1); /* stderr */
+  dup2(null_fd,2); /* stderr */
+}
+
+static void usage(po::options_description &desc) {
   cerr<<"nproxy"<<endl;
   cerr<<desc<<endl;
 }
@@ -353,15 +363,3 @@ catch(PDNSException& e)
 {
   syslogFmt(boost::format("Fatal: %s") % e.reason);
 }
-
-void daemonize(int null_fd)
-{
-  if(fork())
-    exit(0); // bye bye
-
-  setsid();
-
-  dup2(null_fd,0); /* stdin */
-  dup2(null_fd,1); /* stderr */
-  dup2(null_fd,2); /* stderr */
-}
index 35ca57bf18835e84af66e78c74e08380a1561c93..d448b2eec4f462c18dc5ec3ee27408d3f0afca31 100644 (file)
@@ -37,7 +37,7 @@ StatBag S;
 typedef std::pair<string,string> nsec3;
 typedef set<nsec3> nsec3set;
 
-string nsec3Hash(const DNSName &qname, const string &salt, unsigned int iters)
+static string nsec3Hash(const DNSName &qname, const string &salt, unsigned int iters)
 {
   NSEC3PARAMRecordContent ns3prc;
   ns3prc.d_iterations = iters;
@@ -45,7 +45,7 @@ string nsec3Hash(const DNSName &qname, const string &salt, unsigned int iters)
   return toBase32Hex(hashQNameWithSalt(ns3prc, qname));
 }
 
-void proveOrDeny(const nsec3set &nsec3s, const DNSName &qname, const string &salt, unsigned int iters, set<DNSName> &proven, set<DNSName> &denied)
+static void proveOrDeny(const nsec3set &nsec3s, const DNSName &qname, const string &salt, unsigned int iters, set<DNSName> &proven, set<DNSName> &denied)
 {
   string hashed = nsec3Hash(qname, salt, iters);
 
@@ -79,7 +79,7 @@ void proveOrDeny(const nsec3set &nsec3s, const DNSName &qname, const string &sal
   }
 }
 
-void usage() {
+static void usage() {
   cerr<<"nsec3dig"<<endl;
   cerr<<"Syntax: nsec3dig IP-ADDRESS PORT QUESTION QUESTION-TYPE [recurse]\n";
 }
index 48cdfbabdad8adafa95bdcadb01b0ac0342c2070..cd41c16259b19d6d8e659601d23f31b856854474 100644 (file)
@@ -115,4 +115,3 @@ private:
   DNSSECKeeper d_dk; // B is shared with DNSSECKeeper
 };
 
-std::shared_ptr<DNSRecordContent> makeSOAContent(const SOAData& sd);
index 53b6fc525687fc35cc9c885a549c17a434823fc1..712c9cc6cbe97b44dc88eeb8fc3090ffba900cac 100644 (file)
@@ -371,11 +371,6 @@ unsigned int getRecursorThreadId()
   return t_id;
 }
 
-int getMTaskerTID()
-{
-  return MT->getTid();
-}
-
 static bool isDistributorThread()
 {
   if (t_id == 0) {
@@ -3488,19 +3483,13 @@ template<class T> void *voider(const boost::function<T*()>& func)
   return func();
 }
 
-vector<ComboAddress>& operator+=(vector<ComboAddress>&a, const vector<ComboAddress>& b)
-{
-  a.insert(a.end(), b.begin(), b.end());
-  return a;
-}
-
-vector<pair<string, uint16_t> >& operator+=(vector<pair<string, uint16_t> >&a, const vector<pair<string, uint16_t> >& b)
+static vector<ComboAddress>& operator+=(vector<ComboAddress>&a, const vector<ComboAddress>& b)
 {
   a.insert(a.end(), b.begin(), b.end());
   return a;
 }
 
-vector<pair<DNSName, uint16_t> >& operator+=(vector<pair<DNSName, uint16_t> >&a, const vector<pair<DNSName, uint16_t> >& b)
+static vector<pair<DNSName, uint16_t> >& operator+=(vector<pair<DNSName, uint16_t> >&a, const vector<pair<DNSName, uint16_t> >& b)
 {
   a.insert(a.end(), b.begin(), b.end());
   return a;
@@ -3747,7 +3736,7 @@ retryWithName:
   }
 }
 
-FDMultiplexer* getMultiplexer()
+static FDMultiplexer* getMultiplexer()
 {
   FDMultiplexer* ret;
   for(const auto& i : FDMultiplexer::getMultiplexerMap()) {
@@ -4060,7 +4049,7 @@ static void setupNODThread()
   }
 }
 
-void parseNODWhitelist(const std::string& wlist)
+static void parseNODWhitelist(const std::string& wlist)
 {
   vector<string> parts;
   stringtok(parts, wlist, ",; ");
index cf2a2b63b03d81f305734243931cc0a544dc7843..406f5b074df398429ba1febd1e9ea984af8d29ac 100644 (file)
@@ -51,7 +51,7 @@ ArgvMap &arg()
   return arg;
 }
 
-void loadMainConfig(const std::string& configdir)
+static void loadMainConfig(const std::string& configdir)
 {
   ::arg().set("config-dir","Location of configuration directory (pdns.conf)")=configdir;
   ::arg().set("default-ttl","Seconds a result is valid if not set otherwise")="3600";
@@ -149,7 +149,7 @@ void loadMainConfig(const std::string& configdir)
   UeberBackend::go();
 }
 
-bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone, bool quiet = false, bool rectifyTransaction = true)
+static bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone, bool quiet = false, bool rectifyTransaction = true)
 {
   string output;
   string error;
@@ -166,7 +166,7 @@ bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone, bool quiet = false, bool
   return ret;
 }
 
-void dbBench(const std::string& fname)
+static void dbBench(const std::string& fname)
 {
   ::arg().set("query-cache-ttl")="0";
   ::arg().set("negquery-cache-ttl")="0";
@@ -209,7 +209,7 @@ void dbBench(const std::string& fname)
   cout<<"Packet cache reports: "<<S.read("query-cache-hit")<<" hits (should be 0) and "<<S.read("query-cache-miss") <<" misses"<<endl;
 }
 
-bool rectifyAllZones(DNSSECKeeper &dk, bool quiet = false)
+static bool rectifyAllZones(DNSSECKeeper &dk, bool quiet = false)
 {
   UeberBackend B("default");
   vector<DomainInfo> domainInfo;
@@ -230,7 +230,7 @@ bool rectifyAllZones(DNSSECKeeper &dk, bool quiet = false)
   return result;
 }
 
-int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, const vector<DNSResourceRecord>* suppliedrecords=0)
+static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, const vector<DNSResourceRecord>* suppliedrecords=0)
 {
   uint64_t numerrors=0, numwarnings=0;
 
@@ -604,7 +604,7 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, const vect
   return EXIT_FAILURE;
 }
 
-int checkAllZones(DNSSECKeeper &dk, bool exitOnError)
+static int checkAllZones(DNSSECKeeper &dk, bool exitOnError)
 {
   UeberBackend B("default");
   vector<DomainInfo> domainInfo;
@@ -648,7 +648,7 @@ int checkAllZones(DNSSECKeeper &dk, bool exitOnError)
   return EXIT_FAILURE;
 }
 
-int increaseSerial(const DNSName& zone, DNSSECKeeper &dk)
+static int increaseSerial(const DNSName& zone, DNSSECKeeper &dk)
 {
   UeberBackend B("default");
   SOAData sd;
@@ -698,7 +698,7 @@ int increaseSerial(const DNSName& zone, DNSSECKeeper &dk)
   return 0;
 }
 
-int deleteZone(const DNSName &zone) {
+static int deleteZone(const DNSName &zone) {
   UeberBackend B;
   DomainInfo di;
   if (! B.getDomainInfo(zone, di)) {
@@ -713,7 +713,7 @@ int deleteZone(const DNSName &zone) {
   return EXIT_FAILURE;
 }
 
-void listKey(DomainInfo const &di, DNSSECKeeper& dk, bool printHeader = true) {
+static void listKey(DomainInfo const &di, DNSSECKeeper& dk, bool printHeader = true) {
   if (printHeader) {
     cout<<"Zone                          Type    Size    Algorithm    ID   Location    Keytag"<<endl;
     cout<<"----------------------------------------------------------------------------------"<<endl;
@@ -768,7 +768,7 @@ void listKey(DomainInfo const &di, DNSSECKeeper& dk, bool printHeader = true) {
   }
 }
 
-int listKeys(const string &zname, DNSSECKeeper& dk){
+static int listKeys(const string &zname, DNSSECKeeper& dk){
   UeberBackend B("default");
 
   if (zname != "all") {
@@ -790,7 +790,7 @@ int listKeys(const string &zname, DNSSECKeeper& dk){
   return EXIT_SUCCESS;
 }
 
-int listZone(const DNSName &zone) {
+static int listZone(const DNSName &zone) {
   UeberBackend B;
   DomainInfo di;
 
@@ -816,7 +816,7 @@ int listZone(const DNSName &zone) {
 }
 
 // lovingly copied from http://stackoverflow.com/questions/1798511/how-to-avoid-press-enter-with-any-getchar
-int read1char(){
+static int read1char(){
     int c;
     static struct termios oldt, newt;
 
@@ -843,7 +843,7 @@ int read1char(){
     return c;
 }
 
-int clearZone(DNSSECKeeper& dk, const DNSName &zone) {
+static int clearZone(DNSSECKeeper& dk, const DNSName &zone) {
   UeberBackend B;
   DomainInfo di;
 
@@ -859,7 +859,7 @@ int clearZone(DNSSECKeeper& dk, const DNSName &zone) {
   return EXIT_SUCCESS;
 }
 
-int editZone(const DNSName &zone) {
+static int editZone(const DNSName &zone) {
   UeberBackend B;
   DomainInfo di;
   DNSSECKeeper dk(&B);
@@ -1076,7 +1076,7 @@ static int xcryptIP(const std::string& cmd, const std::string& ip, const std::st
 }
 
 
-int loadZone(DNSName zone, const string& fname) {
+static int loadZone(DNSName zone, const string& fname) {
   UeberBackend B;
   DomainInfo di;
 
@@ -1120,7 +1120,7 @@ int loadZone(DNSName zone, const string& fname) {
   return EXIT_SUCCESS;
 }
 
-int createZone(const DNSName &zone, const DNSName& nsname) {
+static int createZone(const DNSName &zone, const DNSName& nsname) {
   UeberBackend B;
   DomainInfo di;
   if (B.getDomainInfo(zone, di)) {
@@ -1162,7 +1162,7 @@ int createZone(const DNSName &zone, const DNSName& nsname) {
   return EXIT_SUCCESS;
 }
 
-int createSlaveZone(const vector<string>& cmds) {
+static int createSlaveZone(const vector<string>& cmds) {
   UeberBackend B;
   DomainInfo di;
   DNSName zone(cmds[1]);
@@ -1186,7 +1186,7 @@ int createSlaveZone(const vector<string>& cmds) {
   return EXIT_SUCCESS;
 }
 
-int changeSlaveZoneMaster(const vector<string>& cmds) {
+static int changeSlaveZoneMaster(const vector<string>& cmds) {
   UeberBackend B;
   DomainInfo di;
   DNSName zone(cmds[1]);
@@ -1211,7 +1211,7 @@ int changeSlaveZoneMaster(const vector<string>& cmds) {
 }
 
 // add-record ZONE name type [ttl] "content" ["content"]
-int addOrReplaceRecord(bool addOrReplace, const vector<string>& cmds) {
+static int addOrReplaceRecord(bool addOrReplace, const vector<string>& cmds) {
   DNSResourceRecord rr;
   vector<DNSResourceRecord> newrrs;
   DNSName zone(cmds[1]);
@@ -1302,7 +1302,7 @@ int addOrReplaceRecord(bool addOrReplace, const vector<string>& cmds) {
 }
 
 // delete-rrset zone name type
-int deleteRRSet(const std::string& zone_, const std::string& name_, const std::string& type_)
+static int deleteRRSet(const std::string& zone_, const std::string& name_, const std::string& type_)
 {
   UeberBackend B;
   DomainInfo di;
@@ -1325,7 +1325,7 @@ int deleteRRSet(const std::string& zone_, const std::string& name_, const std::s
   return EXIT_SUCCESS;
 }
 
-int listAllZones(const string &type="") {
+static int listAllZones(const string &type="") {
 
   int kindFilter = -1;
   if (type.size()) {
@@ -1364,17 +1364,17 @@ int listAllZones(const string &type="") {
   return 0;
 }
 
-bool testAlgorithm(int algo)
+static bool testAlgorithm(int algo)
 {
   return DNSCryptoKeyEngine::testOne(algo);
 }
 
-bool testAlgorithms()
+static bool testAlgorithms()
 {
   return DNSCryptoKeyEngine::testAll();
 }
 
-void testSpeed(DNSSECKeeper& dk, const DNSName& zone, const string& remote, int cores)
+static void testSpeed(DNSSECKeeper& dk, const DNSName& zone, const string& remote, int cores)
 {
   DNSResourceRecord rr;
   rr.qname=DNSName("blah")+zone;
@@ -1420,7 +1420,7 @@ void testSpeed(DNSSECKeeper& dk, const DNSName& zone, const string& remote, int
   cerr<<"Net speed: "<<csp.d_signed/ (dt.udiff()/1000000.0) << " sigs/s"<<endl;
 }
 
-void verifyCrypto(const string& zone)
+static void verifyCrypto(const string& zone)
 {
   ZoneParserTNG zpt(zone);
   zpt.setMaxGenerateSteps(::arg().asNum("max-generate-steps"));
@@ -1458,7 +1458,8 @@ void verifyCrypto(const string& zone)
     cerr<<"Original DS:   "<<apex.toString()<<" IN DS "<<dsrc.getZoneRepresentation()<<endl;
   }
 }
-bool disableDNSSECOnZone(DNSSECKeeper& dk, const DNSName& zone)
+
+static bool disableDNSSECOnZone(DNSSECKeeper& dk, const DNSName& zone)
 {
   UeberBackend B("default");
   DomainInfo di;
@@ -1476,7 +1477,7 @@ bool disableDNSSECOnZone(DNSSECKeeper& dk, const DNSName& zone)
   return ret;
 }
 
-int setZoneAccount(const DNSName& zone, const string &account)
+static int setZoneAccount(const DNSName& zone, const string &account)
 {
   UeberBackend B("default");
   DomainInfo di;
@@ -1492,7 +1493,7 @@ int setZoneAccount(const DNSName& zone, const string &account)
   return EXIT_SUCCESS;
 }
 
-int setZoneKind(const DNSName& zone, const DomainInfo::DomainKind kind)
+static int setZoneKind(const DNSName& zone, const DomainInfo::DomainKind kind)
 {
   UeberBackend B("default");
   DomainInfo di;
@@ -1508,7 +1509,7 @@ int setZoneKind(const DNSName& zone, const DomainInfo::DomainKind kind)
   return EXIT_SUCCESS;
 }
 
-bool showZone(DNSSECKeeper& dk, const DNSName& zone, bool exportDS = false)
+static bool showZone(DNSSECKeeper& dk, const DNSName& zone, bool exportDS = false)
 {
   UeberBackend B("default");
   DomainInfo di;
@@ -1718,7 +1719,7 @@ bool showZone(DNSSECKeeper& dk, const DNSName& zone, bool exportDS = false)
   return true;
 }
 
-bool secureZone(DNSSECKeeper& dk, const DNSName& zone)
+static bool secureZone(DNSSECKeeper& dk, const DNSName& zone)
 {
   // parse attribute
   int k_size;
@@ -1809,7 +1810,7 @@ bool secureZone(DNSSECKeeper& dk, const DNSName& zone)
   return true;
 }
 
-void testSchema(DNSSECKeeper& dk, const DNSName& zone)
+static void testSchema(DNSSECKeeper& dk, const DNSName& zone)
 {
   cout<<"Note: test-schema will try to create the zone, but it will not remove it."<<endl;
   cout<<"Please clean up after this."<<endl;
@@ -1933,7 +1934,7 @@ void testSchema(DNSSECKeeper& dk, const DNSName& zone)
   cout<<"End of tests, please remove "<<zone<<" from domains+records"<<endl;
 }
 
-int addOrSetMeta(const DNSName& zone, const string& kind, const vector<string>& values, bool clobber) {
+static int addOrSetMeta(const DNSName& zone, const string& kind, const vector<string>& values, bool clobber) {
   UeberBackend B("default");
   DomainInfo di;
 
index bebe2d3ecc2e416d8a0cf2e51d089bdf42f5b0f3..72e5c08060c1f0cab75325fd9c942e90905411f5 100644 (file)
@@ -310,7 +310,7 @@ static inline uint8_t hextodec(uint8_t val)
 }
 
 
-void HEXDecode(const char* begin, const char* end, string& out)
+static void HEXDecode(const char* begin, const char* end, string& out)
 {
   if(end - begin == 1 && *begin=='-') {
     out.clear();
index 6f964fda06f6368f36b0a331fa4fe680e900a22c..5ecca53444735ff388d654d31811a31380b1164b 100644 (file)
@@ -1316,7 +1316,7 @@ vector<ComboAddress>* pleaseGetTimeouts()
   return ret;
 }
 
-string doGenericTopRemotes(pleaseremotefunc_t func)
+static string doGenericTopRemotes(pleaseremotefunc_t func)
 {
   typedef map<ComboAddress, int, ComboAddress::addressOnlyLessThan> counts_t;
   counts_t counts;
@@ -1384,7 +1384,7 @@ static DNSName nopFilter(const DNSName& name)
   return name;
 }
 
-string doGenericTopQueries(pleasequeryfunc_t func, boost::function<DNSName(const DNSName&)> filter=nopFilter)
+static string doGenericTopQueries(pleasequeryfunc_t func, boost::function<DNSName(const DNSName&)> filter=nopFilter)
 {
   typedef pair<DNSName,uint16_t> query_t;
   typedef map<query_t, int> counts_t;
index 599e47fdc98ec33f22ab0ec40ea2ee23a18f3ebd..42da510c58e50019997c2473046af64c6c4cfcc1 100644 (file)
@@ -101,7 +101,7 @@ const char *funnytext=
 This file is where it all happens - main is here, as are the two pivotal threads qthread() and athread()
 */
 
-void daemonize(void)
+static void daemonize(void)
 {
   if(fork())
     exit(0); // bye bye
index 2f307b4d2a07b7317e98ed836c43e2cf668a807d..9748b55783d8d54947f88a4e2dd2788bb1a3a0de 100644 (file)
@@ -9,7 +9,7 @@ using namespace nod;
 
 BOOST_AUTO_TEST_SUITE(nod_cc)
 
-bool pdns_exception(PDNSException const& ex) { return true; }
+static bool pdns_exception(PDNSException const& ex) { return true; }
 
 BOOST_AUTO_TEST_CASE(test_basic)
 {
index 8769c6eb17ad52156155a29d1f20f0881dd606cc..16fb153b5183de526a44c89eaa03103fcb9a2d93 100644 (file)
@@ -5,6 +5,8 @@
 #endif
 
 #include "rpzloader.hh"
+#include "syncres.hh"
+
 #include <boost/test/unit_test.hpp>
 
 // Provide stubs for some symbols
index 3fd5bd2f0d64150b87f70171ca410b8be7aa21d2..b1f89dd345f6ac79f1e6b137f628d22f8cfdf95c 100644 (file)
 
 BOOST_AUTO_TEST_SUITE(test_secpoll_cc)
 
-bool checkBasicMessage1(const PDNSException& ex)
+static bool checkBasicMessage1(const PDNSException& ex)
 {
   BOOST_CHECK_EQUAL(ex.reason, "Had empty answer on NOERROR RCODE");
   return true;
 }
 
-bool checkBasicMessage2(const PDNSException& ex)
+static bool checkBasicMessage2(const PDNSException& ex)
 {
   BOOST_CHECK_EQUAL(ex.reason, "RCODE was not NOERROR but " + RCode::to_s(1));
   return true;
 }
 
-bool checkBasicMessage3(const PDNSException& ex)
+static bool checkBasicMessage3(const PDNSException& ex)
 {
   BOOST_CHECK_EQUAL(ex.reason, "No TXT record found in response");
   return true;
 }
 
-bool checkBasicMessage4(const PDNSException& ex)
+static bool checkBasicMessage4(const PDNSException& ex)
 {
   BOOST_CHECK(ex.reason.find("Could not parse status number: stoi") == 0);
   return true;
 }
 
-bool checkBasicMessage5(const PDNSException& ex)
+static bool checkBasicMessage5(const PDNSException& ex)
 {
   BOOST_CHECK(ex.reason.find("Could not parse status number: stoi") == 0);
   return true;
index dcdb0d48fb5a45365dfd66221afc45145898e5d3..f7a06bb1a4f9809c621675f5ce218483e2f88c7b 100644 (file)
@@ -22,11 +22,6 @@ ArgvMap& arg()
   return theArg;
 }
 
-int getMTaskerTID()
-{
-  return 0;
-}
-
 void primeRootNSZones(bool)
 {
 }
index 2b909b242fdeea8662863ee5db727c275620eb73..06eca8a1e6a6ff3668e27fd97e4774534a27de7d 100644 (file)
 
 extern GlobalStateHolder<LuaConfigItems> g_luaconfs;
 
-ArgvMap& arg();
-int getMTaskerTID();
-
-void primeHints(void);
-
 void initSR(bool debug = false);
 void initSR(std::unique_ptr<SyncRes>& sr, bool dnssec = false, bool debug = false, time_t fakeNow = 0);
 
index 2b60aaad076e8428a63cbb669580c284071c2030..cc804adc592d38448443357a373db8b99019d591 100644 (file)
@@ -5,7 +5,7 @@
 
 BOOST_AUTO_TEST_SUITE(syncres_cc2)
 
-void do_test_referral_depth(bool limited)
+static void do_test_referral_depth(bool limited)
 {
   std::unique_ptr<SyncRes> sr;
   initSR(sr);
index 1aff2b5a15cca8d0c9666fc55618634f2c79a3cf..0dc784936c0423dc967774e920d8cc15f956beda 100644 (file)
@@ -29,7 +29,7 @@
 #include <iostream>
 #include <dnsrecords.hh>
 
-bool init_unit_test()
+static bool init_unit_test()
 {
   reportAllTypes();
   return true;
index 64621ba7c865fc42c280b77dd6eb05a25dd449ee..5b65d121673f9c7fd07e3300588bf3c6221854ef 100644 (file)
@@ -249,7 +249,7 @@ ComboAddress parseIPAndPort(const std::string& input, uint16_t port)
 }
 
 
-void convertServersForAD(const std::string& input, SyncRes::AuthDomain& ad, const char* sepa, bool verbose=true)
+static void convertServersForAD(const std::string& input, SyncRes::AuthDomain& ad, const char* sepa, bool verbose=true)
 {
   vector<string> servers;
   stringtok(servers, input, sepa);
@@ -268,13 +268,7 @@ void convertServersForAD(const std::string& input, SyncRes::AuthDomain& ad, cons
     g_log<<endl;
 }
 
-void* pleaseWipeNegCache()
-{
-  SyncRes::clearNegCache();
-  return 0;
-}
-
-void* pleaseUseNewSDomainsMap(std::shared_ptr<SyncRes::domainmap_t> newmap)
+static void* pleaseUseNewSDomainsMap(std::shared_ptr<SyncRes::domainmap_t> newmap)
 {
   SyncRes::setDomainMap(newmap);
   return 0;
index c1baff02d662a11bcf97f8739226debf0dee1a87..560780b63bcb7a736ffe54fc3afc42686bcfddb8 100644 (file)
@@ -38,7 +38,7 @@ static void usage()
        << endl;
 }
 
-const string nameForClass(uint16_t qclass, uint16_t qtype)
+static const string nameForClass(uint16_t qclass, uint16_t qtype)
 {
   if (qtype == QType::OPT)
     return "IN";
@@ -57,7 +57,7 @@ const string nameForClass(uint16_t qclass, uint16_t qtype)
   }
 }
 
-void fillPacket(vector<uint8_t>& packet, const string& q, const string& t,
+static void fillPacket(vector<uint8_t>& packet, const string& q, const string& t,
   bool dnssec, const boost::optional<Netmask> ednsnm,
   bool recurse, uint16_t xpfcode, uint16_t xpfversion,
   uint64_t xpfproto, char* xpfsrc, char* xpfdst,
@@ -102,7 +102,7 @@ void fillPacket(vector<uint8_t>& packet, const string& q, const string& t,
   }
 }
 
-void printReply(const string& reply, bool showflags, bool hidesoadetails)
+static void printReply(const string& reply, bool showflags, bool hidesoadetails)
 {
   MOADNSParser mdp(false, reply);
   cout << "Reply to question for qname='" << mdp.d_qname.toString()
index 31299d7c0a1c9e10a3339291770ed5d39f7b8b47..77e6a08a4cf6c885dedf9867214538e89a1261df 100644 (file)
 #include "dnsrecords.hh"
 #include "pdnsexception.hh"
 #include "misc.hh"
+#include "secpoll.hh"
 
 bool isReleaseVersion(const std::string &version) {
   return std::count(version.begin(), version.end(), '.') == 2;
 }
 
-void setSecPollToUnknownOnOK(int &secPollStatus) {
+static void setSecPollToUnknownOnOK(int &secPollStatus) {
   if(secPollStatus == 1) // it was ok, now it is unknown
     secPollStatus = 0;
 }
index 0c0eb207aa0901f21fc73d99b9516f5ac258d2ca..34fc86da48dc59cdbe92c1e5d44a82dbb0414e90 100644 (file)
@@ -37,7 +37,8 @@
 *
 * copied from sqlite 3.3.6 // cmouse
 */
-int pdns_sqlite3_clear_bindings(sqlite3_stmt *pStmt){
+#if SQLITE_VERSION_NUMBER < 3003009
+static int pdns_sqlite3_clear_bindings(sqlite3_stmt *pStmt){
   int i;
   int rc = SQLITE_OK;
   for(i=1; rc==SQLITE_OK && i<=sqlite3_bind_parameter_count(pStmt); i++){
@@ -45,6 +46,7 @@ int pdns_sqlite3_clear_bindings(sqlite3_stmt *pStmt){
   }
   return rc;
 }
+#endif
 
 static string SSQLite3ErrorString(sqlite3 *db)
 {
index 1da9644a2d9b7bebac56d2eedecba2d558ad2099..27954eead18e5fcc63538d35a84beebb3daf15fe 100644 (file)
@@ -15,7 +15,7 @@ ArgvMap &arg()
   return theArg;
 }
 
-void usage() {
+static void usage() {
   cerr<<"stubquery"<<endl;
   cerr<<"Syntax: stubquery QUESTION [QUESTION-TYPE]"<<endl;
 }
index 80cf3f9f4ca9ad0f9c7db036cf3042a38a71b449..d8449eb586378faf829f8b2d6b81d88c9afd7266 100644 (file)
@@ -173,33 +173,6 @@ static void writenWithTimeout(int fd, const void *buffer, unsigned int n, unsign
   }
 }
 
-void connectWithTimeout(int fd, struct sockaddr* remote, size_t socklen)
-{
-  int err;
-  Utility::socklen_t len=sizeof(err);
-
-  if((err=connect(fd, remote, socklen))<0 && errno!=EINPROGRESS)
-    throw NetworkError("connect: "+stringerror());
-
-  if(!err)
-    goto done;
-  
-  err=waitForRWData(fd, false, 5, 0);
-  if(err == 0)
-    throw NetworkError("Timeout connecting to remote");
-  if(err < 0)
-    throw NetworkError("Error connecting to remote");
-
-  if(getsockopt(fd, SOL_SOCKET,SO_ERROR,(char *)&err,&len)<0)
-    throw NetworkError("Error connecting to remote: "+stringerror()); // Solaris
-
-  if(err)
-    throw NetworkError("Error connecting to remote: "+string(strerror(err)));
-
- done:
-  ;
-}
-
 void TCPNameserver::sendPacket(std::unique_ptr<DNSPacket>& p, int outsock)
 {
   g_rs.submitResponse(*p, false);
index b1a60c94e1fa32c20c56990b84172890e8aa4424..441f6464d0cf50384aa36251c698d1ff550ed190 100644 (file)
@@ -250,7 +250,7 @@ BOOST_AUTO_TEST_CASE(test_record_types) {
  }
 }
 
-bool test_dnsrecords_cc_predicate( std::exception const &ex ) { return true; }
+static bool test_dnsrecords_cc_predicate( std::exception const &ex ) { return true; }
 
 // these *MUST NOT* parse properly!
 BOOST_AUTO_TEST_CASE(test_record_types_bad_values) {
index 0ea154593f0acec2b56d1baba40fbffd2121d981..ea38f33a8fad6368ba996dda60bc88b24ded73e0 100644 (file)
@@ -19,7 +19,7 @@ ArgvMap &arg()
 }
 
 
-bool init_unit_test() {
+static bool init_unit_test() {
   reportAllTypes();
   return true;
 }
index 7e75731993ef27ceaf938b96e1e91409ce4764dc..40f49a9119c4216d9262f601f30899d630313825 100644 (file)
@@ -25,6 +25,7 @@
 #include "dns_random.hh"
 #include "misc.hh"
 #include "pdnsexception.hh"
+#include "tsigutils.hh"
 #include <string>
 
 /*
index 5fd0a3936e08b3b95d9d11c44f4011e76766265a..4d3e4795d6623bdbaeb212ab145339166d10271e 100644 (file)
@@ -480,7 +480,7 @@ UeberBackend::UeberBackend(const string &pname)
   backends=BackendMakers().all(pname=="key-only");
 }
 
-void del(DNSBackend* d)
+static void del(DNSBackend* d)
 {
   delete d;
 }
index 57453b03460241dc6acf9e27e33384ed354c7997..22c54dae28d9d3c65f776421960de2a0183ea68c 100644 (file)
@@ -147,7 +147,7 @@ static string htmlescape(const string &s) {
   return result;
 }
 
-void printtable(ostringstream &ret, const string &ringname, const string &title, int limit=10)
+static void printtable(ostringstream &ret, const string &ringname, const string &title, int limit=10)
 {
   int tot=0;
   int entries=0;
@@ -2253,7 +2253,7 @@ static void apiServerSearchData(HttpRequest* req, HttpResponse* resp) {
   resp->setBody(doc);
 }
 
-void apiServerCacheFlush(HttpRequest* req, HttpResponse* resp) {
+static void apiServerCacheFlush(HttpRequest* req, HttpResponse* resp) {
   if(req->method != "PUT")
     throw HttpMethodNotAllowedException();
 
index b7ebcb3c31c9fd16bc018824790fc5829fe76271..6e514a5123714a82084ee4cfd3b6d8591b4f8f66 100644 (file)
@@ -56,7 +56,7 @@ map<string, bool> g_entries;
 map<DNSName,bool> g_recorddata;
 map<DNSName, map<string, bool> > g_recordttl;
 
-std::string encode_non_ascii( const std::string &input ) {
+static std::string encode_non_ascii( const std::string &input ) {
         std::ostringstream out;
 
         for ( auto i : input ) {
index 0dc2b646701900218566b8921b7d3d670e35223e..5a4f8336f87c822c2b00120cf93302204e4dea06 100644 (file)
@@ -222,7 +222,7 @@ bool ZoneParserTNG::getTemplateLine()
   return true;
 }
 
-void chopComment(string& line)
+static void chopComment(string& line)
 {
   if(line.find(';')==string::npos)
     return;
@@ -240,7 +240,7 @@ void chopComment(string& line)
     line.resize(pos);
 }
 
-bool findAndElide(string& line, char c)
+static bool findAndElide(string& line, char c)
 {
   string::size_type pos, len = line.length();
   bool inQuote=false;