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)  

calidns.cc File Reference
#include <atomic>
#include <iostream>
#include <fstream>
#include <memory>
#include <poll.h>
#include <thread>
#include <boost/program_options.hpp>
#include "dns_random.hh"
#include "dnsparser.hh"
#include "dnswriter.hh"
#include "dnsrecords.hh"
#include "ednsoptions.hh"
#include "ednssubnet.hh"
#include "misc.hh"
#include "sstuff.hh"
#include "statbag.hh"
Include dependency graph for calidns.cc:

Go to the source code of this file.

Functions

static void * recvThread (const vector< std::unique_ptr< Socket >> *sockets)
 
static void setSocketBuffer (int fd, int optname, uint32_t size)
 
static void setSocketReceiveBuffer (int fd, uint32_t size)
 
static void setSocketSendBuffer (int fd, uint32_t size)
 
static ComboAddress getRandomAddressFromRange (const Netmask &ecsRange)
 
static void replaceEDNSClientSubnet (vector< uint8_t > *packet, const Netmask &ecsRange)
 
static void sendPackets (const vector< std::unique_ptr< Socket >> &sockets, const vector< vector< uint8_t > * > &packets, int qps, ComboAddress dest, const Netmask &ecsRange)
 
static void usage (po::options_description &desc)
 
int main (int argc, char **argv)
 

Variables

StatBag S
 Statistics are gathered across PDNS via the StatBag class S. More...
 
static std::atomic< unsigned int > g_recvcounter
 
static std::atomic< unsigned int > g_recvbytes
 
static volatile bool g_done
 
static po::variables_map g_vm
 
static bool g_quiet
 

Function Documentation

◆ getRandomAddressFromRange()

static ComboAddress getRandomAddressFromRange ( const Netmask ecsRange)
static

◆ main()

◆ recvThread()

static void* recvThread ( const vector< std::unique_ptr< Socket >> *  sockets)
static

Definition at line 58 of file calidns.cc.

References fillMSGHdr(), g_done, g_recvbytes, g_recvcounter, and unixDie().

Referenced by main().

◆ replaceEDNSClientSubnet()

static void replaceEDNSClientSubnet ( vector< uint8_t > *  packet,
const Netmask ecsRange 
)
static

Definition at line 159 of file calidns.cc.

References getRandomAddressFromRange(), and ComboAddress::sin4.

Referenced by sendPackets().

◆ sendPackets()

static void sendPackets ( const vector< std::unique_ptr< Socket >> &  sockets,
const vector< vector< uint8_t > * > &  packets,
int  qps,
ComboAddress  dest,
const Netmask ecsRange 
)
static

◆ setSocketBuffer()

static void setSocketBuffer ( int  fd,
int  optname,
uint32_t  size 
)
static

Definition at line 120 of file calidns.cc.

References g_quiet, and stringerror().

Referenced by setSocketReceiveBuffer(), and setSocketSendBuffer().

◆ setSocketReceiveBuffer()

static void setSocketReceiveBuffer ( int  fd,
uint32_t  size 
)
static

Definition at line 140 of file calidns.cc.

References setSocketBuffer().

Referenced by main().

◆ setSocketSendBuffer()

static void setSocketSendBuffer ( int  fd,
uint32_t  size 
)
static

Definition at line 145 of file calidns.cc.

References setSocketBuffer().

Referenced by main().

◆ usage()

static void usage ( po::options_description &  desc)
static

Definition at line 223 of file calidns.cc.

Referenced by main(), and DynListener::registerFunc().

Variable Documentation

◆ g_done

volatile bool g_done
static

Definition at line 51 of file calidns.cc.

Referenced by recvThread().

◆ g_quiet

bool g_quiet
static

Definition at line 56 of file calidns.cc.

Referenced by main(), and setSocketBuffer().

◆ g_recvbytes

std::atomic<unsigned int> g_recvbytes
static

Definition at line 50 of file calidns.cc.

Referenced by main(), and recvThread().

◆ g_recvcounter

std::atomic<unsigned int> g_recvcounter
static

Definition at line 50 of file calidns.cc.

Referenced by main(), and recvThread().

◆ g_vm

po::variables_map g_vm
static

Definition at line 54 of file calidns.cc.

Referenced by main().

◆ S

Statistics are gathered across PDNS via the StatBag class S.

Definition at line 48 of file calidns.cc.