Skip to content

Commit

Permalink
auth: make most startup functions static
Browse files Browse the repository at this point in the history
  • Loading branch information
zeha committed Sep 10, 2022
1 parent bee7d17 commit 8de0231
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
11 changes: 7 additions & 4 deletions pdns/auth-main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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") = "";
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -682,7 +685,7 @@ static void triggerLoadOfLibraries()
dummy.join();
}

void mainthread()
static void mainthread()
{
Utility::srandom();

Expand Down
5 changes: 0 additions & 5 deletions pdns/auth-main.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8de0231

Please sign in to comment.