From 8de023151800de71b262e1806addc9166530fc4b Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Wed, 3 Aug 2022 21:34:31 +0200 Subject: [PATCH] auth: make most startup functions static --- pdns/auth-main.cc | 11 +++++++---- pdns/auth-main.hh | 5 ----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/pdns/auth-main.cc b/pdns/auth-main.cc index 755e8691b5..cbb6aa973d 100644 --- a/pdns/auth-main.cc +++ b/pdns/auth-main.cc @@ -130,12 +130,15 @@ static vector> 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(); diff --git a/pdns/auth-main.hh b/pdns/auth-main.hh index 709bacd741..ac2f7af8bd 100644 --- a/pdns/auth-main.hh +++ b/pdns/auth-main.hh @@ -44,11 +44,6 @@ extern std::unique_ptr DP; extern CommunicatorClass Communicator; extern std::shared_ptr N; extern std::unique_ptr 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; -- 2.47.2