pdns  4.2.0-rc1
About: PowerDNS daemon - a high performance authoritative nameserver. Release candidate.
  Fossies Dox: pdns-4.2.0-rc1.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

receiver.cc File Reference

The main loop of powerdns. More...

#include "packetcache.hh"
#include <cstdio>
#include <signal.h>
#include <cstring>
#include <cstdlib>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <iostream>
#include <string>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <errno.h>
#include <pthread.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <fstream>
#include <boost/algorithm/string.hpp>
#include "opensslsigners.hh"
#include "dns.hh"
#include "dnsbackend.hh"
#include "ueberbackend.hh"
#include "dnspacket.hh"
#include "nameserver.hh"
#include "distributor.hh"
#include "logger.hh"
#include "arguments.hh"
#include "packethandler.hh"
#include "statbag.hh"
#include "tcpreceiver.hh"
#include "misc.hh"
#include "dynlistener.hh"
#include "dynhandler.hh"
#include "communicator.hh"
#include "dnsproxy.hh"
#include "utility.hh"
#include "common_startup.hh"
#include "dnsrecords.hh"
#include "version.hh"
Include dependency graph for receiver.cc:

Go to the source code of this file.

Functions

void daemonize (void)
 
static void takedown (int i)
 
static void writePid (void)
 
static string DLCycleHandler (const vector< string > &parts, pid_t ppid)
 
static string DLRestHandler (const vector< string > &parts, pid_t ppid)
 
static int guardian (int argc, char **argv)
 
int main (int argc, char **argv)
 The main function of pdns, the pdns process. More...
 

Variables

time_t s_starttime
 
string s_programname ="pdns"
 
const char * funnytext
 
static int cpid
 
int g_fd1 [2]
 
int g_fd2 [2]
 
FILE * g_fp
 
pthread_mutex_t g_guardian_lock = PTHREAD_MUTEX_INITIALIZER
 

Detailed Description

The main loop of powerdns.

This file is where it all happens - main is here, as are the two pivotal threads qthread() and athread()

Definition in file receiver.cc.

Function Documentation

◆ daemonize()

void daemonize ( void  )

Definition at line 100 of file receiver.cc.

References Logger::Critical, g_log, and stringerror().

Referenced by main().

◆ DLCycleHandler()

static string DLCycleHandler ( const vector< string > &  parts,
pid_t  ppid 
)
static

Definition at line 156 of file receiver.cc.

References cpid.

Referenced by guardian().

◆ DLRestHandler()

static string DLRestHandler ( const vector< string > &  parts,
pid_t  ppid 
)
static

Definition at line 164 of file receiver.cc.

References g_fd1, g_fp, g_guardian_lock, PDNSException::reason, and writen2().

Referenced by guardian().

◆ guardian()

◆ main()

◆ takedown()

static void takedown ( int  i)
static

Definition at line 119 of file receiver.cc.

References cpid, Logger::Error, and g_log.

Referenced by guardian().

◆ writePid()

static void writePid ( void  )
static

Definition at line 128 of file receiver.cc.

References arg(), Logger::Error, g_log, and s_programname.

Referenced by guardian(), and main().

Variable Documentation

◆ cpid

int cpid
static

Definition at line 118 of file receiver.cc.

Referenced by DLCycleHandler(), guardian(), and takedown().

◆ funnytext

const char* funnytext
Initial value:
=
"*****************************************************************************\n"
"Ok, you just ran pdns_server through 'strings' hoping to find funny messages.\n"
"Well, you found one. \n"
"Two ions are flying through their particle accelerator, says the one to the\n"
"other 'I think I've lost an electron!' \n"
"So the other one says, 'Are you sure?'. 'YEAH! I'M POSITIVE!'\n"
" the pdns crew - pdns@powerdns.com\n"
"*****************************************************************************\n"

Definition at line 79 of file receiver.cc.

◆ g_fd1

int g_fd1[2]

Definition at line 151 of file receiver.cc.

Referenced by DLRestHandler(), and guardian().

◆ g_fd2

int g_fd2[2]

Definition at line 151 of file receiver.cc.

Referenced by guardian().

◆ g_fp

FILE* g_fp

Definition at line 152 of file receiver.cc.

Referenced by DLRestHandler(), and guardian().

◆ g_guardian_lock

pthread_mutex_t g_guardian_lock = PTHREAD_MUTEX_INITIALIZER

Definition at line 153 of file receiver.cc.

Referenced by DLRestHandler(), and guardian().

◆ s_programname

string s_programname ="pdns"

Definition at line 77 of file receiver.cc.

Referenced by guardian(), main(), and writePid().

◆ s_starttime

time_t s_starttime