pdns  4.3.0
About: PowerDNS daemon - a high performance authoritative nameserver.
  Fossies Dox: pdns-4.3.0.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

common_startup.cc File Reference
#include "common_startup.hh"
#include "ws-auth.hh"
#include "secpoll-auth.hh"
#include <sys/time.h>
#include <sys/resource.h>
#include "dynhandler.hh"
#include "dnsseckeeper.hh"
#include "threadname.hh"
#include "misc.hh"
#include <thread>
Include dependency graph for common_startup.cc:

Go to the source code of this file.

Typedefs

typedef Distributor< DNSPacket, DNSPacket, PacketHandlerDNSDistributor
 

Functions

ArgvMaparg ()
 
void declareArguments ()
 
static uint64_t uptimeOfProcess (const std::string &str)
 
static uint64_t getSysUserTimeMsec (const std::string &str)
 
static uint64_t getTCPConnectionCount (const std::string &str)
 
static uint64_t getQCount (const std::string &str)
 
static uint64_t getLatency (const std::string &str)
 
void declareStats (void)
 
int isGuarded (char **argv)
 
static void sendout (std::unique_ptr< DNSPacket > &a)
 
static void qthread (unsigned int num)
 The qthread receives questions over the internet via the Nameserver class, and hands them to the Distributor for further processing. More...
 
static void * dummyThread (void *)
 
static void triggerLoadOfLibraries ()
 
void mainthread ()
 

Variables

bool g_anyToTcp
 
bool g_8bitDNS
 
ArgvMap theArg
 
StatBag S
 Statistics are gathered across PDNS via the StatBag class S. More...
 
AuthPacketCache PC
 This is the main PacketCache, shared across all threads. More...
 
AuthQueryCache QC
 
std::unique_ptr< DNSProxyDP {nullptr}
 
std::unique_ptr< DynListenerdl {nullptr}
 
CommunicatorClass Communicator
 
shared_ptr< UDPNameserverN
 
int avg_latency
 
unique_ptr< TCPNameserverTN
 
static vector< DNSDistributor * > g_distributors
 
vector< std::shared_ptr< UDPNameserver > > g_udpReceivers
 
static time_t s_start =time(0)
 

Typedef Documentation

◆ DNSDistributor

Function Documentation

◆ arg()

ArgvMap& arg ( )

Definition at line 64 of file common_startup.cc.

Referenced by declareArguments(), mainthread(), and qthread().

◆ declareArguments()

void declareArguments ( )

Definition at line 69 of file common_startup.cc.

References arg(), ArgvMap::set(), ArgvMap::setCmd(), ArgvMap::setDefaults(), and ArgvMap::setSwitch().

Referenced by main().

◆ declareStats()

◆ dummyThread()

static void* dummyThread ( void *  )
static

Definition at line 509 of file common_startup.cc.

Referenced by triggerLoadOfLibraries().

◆ getLatency()

static uint64_t getLatency ( const std::string &  str)
static

Definition at line 288 of file common_startup.cc.

References avg_latency.

Referenced by declareStats().

◆ getQCount()

static uint64_t getQCount ( const std::string &  str)
static

Definition at line 266 of file common_startup.cc.

References g_distributors.

Referenced by declareStats().

◆ getSysUserTimeMsec()

static uint64_t getSysUserTimeMsec ( const std::string &  str)
static

Definition at line 248 of file common_startup.cc.

Referenced by declareStats().

◆ getTCPConnectionCount()

static uint64_t getTCPConnectionCount ( const std::string &  str)
static

Definition at line 261 of file common_startup.cc.

References TN.

Referenced by declareStats().

◆ isGuarded()

int isGuarded ( char **  argv)

Definition at line 375 of file common_startup.cc.

Referenced by guardian(), and main().

◆ mainthread()

◆ qthread()

◆ sendout()

static void sendout ( std::unique_ptr< DNSPacket > &  a)
static

Definition at line 382 of file common_startup.cc.

References avg_latency, DNSPacket::d_dt, N, and DTime::udiff().

Referenced by qthread().

◆ triggerLoadOfLibraries()

static void triggerLoadOfLibraries ( )
static

Definition at line 515 of file common_startup.cc.

References dummyThread().

Referenced by mainthread().

◆ uptimeOfProcess()

static uint64_t uptimeOfProcess ( const std::string &  str)
static

Definition at line 243 of file common_startup.cc.

References s_start.

Referenced by declareStats().

Variable Documentation

◆ avg_latency

int avg_latency

Definition at line 59 of file common_startup.cc.

Referenced by getLatency(), qthread(), and sendout().

◆ Communicator

◆ dl

std::unique_ptr<DynListener> dl {nullptr}

Definition at line 56 of file common_startup.cc.

Referenced by Bind2Backend::Bind2Backend(), main(), and mainthread().

◆ DP

std::unique_ptr<DNSProxy> DP {nullptr}

Definition at line 55 of file common_startup.cc.

Referenced by PacketHandler::doQuestion(), and mainthread().

◆ g_8bitDNS

bool g_8bitDNS

Definition at line 42 of file common_startup.cc.

Referenced by mainthread(), and validDNSName().

◆ g_anyToTcp

bool g_anyToTcp

Definition at line 41 of file common_startup.cc.

Referenced by PacketHandler::doQuestion(), and mainthread().

◆ g_distributors

vector<DNSDistributor*> g_distributors
static

Definition at line 61 of file common_startup.cc.

Referenced by getQCount(), mainthread(), and qthread().

◆ g_udpReceivers

vector<std::shared_ptr<UDPNameserver> > g_udpReceivers

Definition at line 62 of file common_startup.cc.

Referenced by main(), and qthread().

◆ N

shared_ptr<UDPNameserver> N

Definition at line 58 of file common_startup.cc.

Referenced by main(), qthread(), and sendout().

◆ PC

This is the main PacketCache, shared across all threads.

Definition at line 53 of file common_startup.cc.

Referenced by mainthread(), and qthread().

◆ QC

Definition at line 54 of file common_startup.cc.

Referenced by mainthread().

◆ S

Statistics are gathered across PDNS via the StatBag class S.

Definition at line 52 of file common_startup.cc.

Referenced by declareStats(), and qthread().

◆ s_start

time_t s_start =time(0)
static

Definition at line 242 of file common_startup.cc.

Referenced by uptimeOfProcess().

◆ theArg

ArgvMap theArg

Definition at line 51 of file common_startup.cc.

Referenced by arg().

◆ TN

unique_ptr<TCPNameserver> TN

Definition at line 60 of file common_startup.cc.

Referenced by getTCPConnectionCount(), main(), and mainthread().