tdns
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Enumerations | Functions | Variables
dns-storage.hh File Reference

Defines DNSLabel, DNSType, DNSClass and DNSNode, which together store DNS details. More...

#include <strings.h>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <deque>
#include <iostream>
#include <cstdint>
#include <functional>
#include <memory>
#include "nenum.hh"
#include "comboaddress.hh"
Include dependency graph for dns-storage.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dnsheader
 DNS header struct. More...
 
class  DNSLabel
 Represents a DNS label, which is part of a DNS Name. More...
 
struct  DNSName
 A DNS Name with helpful methods. Inherits case insensitivity from DNSLabel. More...
 
struct  RRGen
 Represents the contents of a resource record. More...
 
struct  RRSet
 Resource records are treated as a set and have one TTL for the whole set. More...
 
struct  DNSNode
 A node in the DNS tree. More...
 
struct  DNSNode::DNSNodeCmp
 

Enumerations

enum  RCode {
  RCode::Noerror = 0, RCode::Formerr = 1, RCode::Servfail = 2, RCode::Nxdomain = 3,
  RCode::Notimp = 4, RCode::Refused = 5, RCode::Notauth = 9, RCode::Badvers =16
}
 
enum  DNSType : uint16_t {
  DNSType::A = 1, DNSType::NS = 2, DNSType::CNAME = 5, DNSType::SOA =6,
  DNSType::PTR =12, DNSType::MX =15, DNSType::TXT =16, DNSType::AAAA = 28,
  DNSType::SRV =33, DNSType::NAPTR =35, DNSType::DS =43, DNSType::RRSIG =46,
  DNSType::NSEC =47, DNSType::DNSKEY =48, DNSType::NSEC3 =50, DNSType::OPT =41,
  DNSType::IXFR = 251, DNSType::AXFR = 252, DNSType::ANY = 255, DNSType::CAA = 257
}
 Stores the type of a DNS query or resource record. More...
 
enum  DNSClass : uint16_t { DNSClass::IN =1, DNSClass::CH =3 }
 Stores the class of a DNS query or resource record. More...
 

Functions

 SMARTENUMEND (RCode)
 
 SMARTENUMEND (DNSType)
 
 SMARTENUMSTART (DNSClass) SENUM2(DNSClass
 
CH SMARTENUMEND (DNSClass) COMBOENUM4(DNSSection
 
std::ostream & operator<< (std::ostream &os, const DNSLabel &d)
 
std::ostream & operator<< (std::ostream &os, const DNSName &d)
 
DNSName operator+ (const DNSName &a, const DNSName &b)
 Append two DNSNames. More...
 
DNSName makeDNSName (const std::string &str)
 This function is plain wrong and does unescape its input XXX. More...
 
void loadZones (DNSNode &zones)
 Called by main() to load zone information. More...
 
std::unique_ptr< DNSNoderetrieveZone (const ComboAddress &remote, const DNSName &zone)
 connects to an authoritative server, retrieves a zone, returns it as a smart pointer More...
 

Variables

 IN
 
CH Question
 
CH Answer
 
CH Authority
 
CH Additional
 

Detailed Description

Defines DNSLabel, DNSType, DNSClass and DNSNode, which together store DNS details.

Enumeration Type Documentation

enum DNSClass : uint16_t
strong

Stores the class of a DNS query or resource record.

Enumerator
IN 
CH 
enum DNSType : uint16_t
strong

Stores the type of a DNS query or resource record.

Enumerator
A 
NS 
CNAME 
SOA 
PTR 
MX 
TXT 
AAAA 
SRV 
NAPTR 
DS 
RRSIG 
NSEC 
DNSKEY 
NSEC3 
OPT 
IXFR 
AXFR 
ANY 
CAA 
enum RCode
strong
Enumerator
Noerror 
Formerr 
Servfail 
Nxdomain 
Notimp 
Refused 
Notauth 
Badvers 

Function Documentation

void loadZones ( DNSNode zones)

Called by main() to load zone information.

Called by main() to load zone information.

DNSName makeDNSName ( const std::string &  str)

This function is plain wrong and does unescape its input XXX.

Here is the call graph for this function:

DNSName operator+ ( const DNSName a,
const DNSName b 
)

Append two DNSNames.

std::ostream& operator<< ( std::ostream &  os,
const DNSLabel d 
)
std::ostream& operator<< ( std::ostream &  os,
const DNSName d 
)

Here is the call graph for this function:

std::unique_ptr<DNSNode> retrieveZone ( const ComboAddress &  remote,
const DNSName zone 
)

connects to an authoritative server, retrieves a zone, returns it as a smart pointer

Here is the call graph for this function:

SMARTENUMEND ( RCode  )
SMARTENUMEND ( DNSType  )
CH SMARTENUMEND ( DNSClass  )
SMARTENUMSTART ( DNSClass  )

Variable Documentation

CH Additional
CH Answer
CH Authority
IN
CH Question