]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: make most startup functions static
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Wed, 3 Aug 2022 19:34:31 +0000 (21:34 +0200)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Sat, 10 Sep 2022 10:28:16 +0000 (12:28 +0200)
pdns/auth-main.cc
pdns/auth-main.hh

index 755e8691b500103c9b25326112ea8bed3eda66a7..cbb6aa973d16827776edf77ccb73b184d534a823 100644 (file)
@@ -130,12 +130,15 @@ static vector<std::shared_ptr<UDPNameserver>> g_udpReceivers;
 NetmaskGroup g_proxyProtocolACL;
 size_t g_proxyProtocolMaximumSize;
 
+// Implemented in auth-carbon.cc. Avoids having an auth-carbon.hh declaring exactly one function.
+void carbonDumpThread();
+
 ArgvMap& arg()
 {
   return theArg;
 }
 
-void declareArguments()
+static void declareArguments()
 {
   ::arg().set("config-dir", "Location of configuration directory (pdns.conf)") = SYSCONFDIR;
   ::arg().set("config-name", "Name of this virtual configuration - will rename the binary image") = "";
@@ -400,7 +403,7 @@ static uint64_t getSendLatency(const std::string& str)
   return round(send_latency);
 }
 
-void declareStats()
+static void declareStats()
 {
   S.declare("udp-queries", "Number of UDP queries received");
   S.declare("udp-do-queries", "Number of UDP queries received with DO bit");
@@ -499,7 +502,7 @@ void declareStats()
   S.declareComboRing("remotes-corrupt", "Remote hosts sending corrupt packets");
 }
 
-int isGuarded(char** argv)
+static int isGuarded(char** argv)
 {
   char* p = strstr(argv[0], "-instance");
 
@@ -682,7 +685,7 @@ static void triggerLoadOfLibraries()
   dummy.join();
 }
 
-void mainthread()
+static void mainthread()
 {
   Utility::srandom();
 
index 709bacd74174b8c8daae3dc20beb835459c3c640..ac2f7af8bd711403863d822567904278adb2faa0 100644 (file)
@@ -44,11 +44,6 @@ extern std::unique_ptr<DNSProxy> DP;
 extern CommunicatorClass Communicator;
 extern std::shared_ptr<UDPNameserver> N;
 extern std::unique_ptr<TCPNameserver> TN;
-extern void declareArguments();
-extern void declareStats();
-void mainthread();
-extern int isGuarded(char**);
-void carbonDumpThread();
 extern bool g_anyToTcp;
 extern bool g_8bitDNS;
 extern NetmaskGroup g_proxyProtocolACL;