tdns
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Public Member Functions | Public Attributes | List of all members
DNSNode Struct Reference

A node in the DNS tree. More...

#include <dns-storage.hh>

Collaboration diagram for DNSNode:
[legend]

Classes

struct  DNSNodeCmp
 

Public Member Functions

 DNSNode ()
 
 DNSNode (const DNSLabel &lab, DNSNode *parent)
 
 ~DNSNode ()
 
const DNSNodefind (DNSName &name, DNSName &last, bool wildcards=false, const DNSNode **passedZonecut=0, const DNSNode **passedWcard=0) const
 This is the key function that finds names, returns where it found them and if any zonecuts were passsed. More...
 
DNSNodeadd (DNSName name)
 This is an idempotent way to add a node to a DNS tree. More...
 
const DNSNodenext () const
 
const DNSNodeprev () const
 
DNSName getName () const
 
void addRRs (std::unique_ptr< RRGen > &&a)
 add one RRGen to this node More...
 
template<typename... Types>
void addRRs (std::unique_ptr< RRGen > &&a, Types &&...args)
 add multiple RRGen to this node More...
 

Public Attributes

DNSLabel d_name
 
DNSNoded_parent {0}
 
std::set< DNSNode, DNSNodeCmpchildren
 children, found by DNSLabel More...
 
std::map< DNSType, RRSetrrsets
 
std::unique_ptr< DNSNodezone
 if this is set, this node is a zone More...
 
uint16_t namepos {0}
 for label compression, we also use DNSNodes More...
 

Detailed Description

A node in the DNS tree.

Constructor & Destructor Documentation

DNSNode::DNSNode ( )
inline
DNSNode::DNSNode ( const DNSLabel lab,
DNSNode parent 
)
inline
DNSNode::~DNSNode ( )
default

Member Function Documentation

DNSNode * DNSNode::add ( DNSName  name)

This is an idempotent way to add a node to a DNS tree.

Idempotent way of creating/accessing the DNSName in a tree.

Here is the call graph for this function:

void DNSNode::addRRs ( std::unique_ptr< RRGen > &&  a)

add one RRGen to this node

template<typename... Types>
void DNSNode::addRRs ( std::unique_ptr< RRGen > &&  a,
Types &&...  args 
)
inline

add multiple RRGen to this node

Here is the call graph for this function:

const DNSNode * DNSNode::find ( DNSName name,
DNSName last,
bool  wildcards = false,
const DNSNode **  passedZonecut = 0,
const DNSNode **  passedWcard = 0 
) const

This is the key function that finds names, returns where it found them and if any zonecuts were passsed.

The big RFC 1034-compatible find function. Will perform wildcard synth if requested & let you know about it.

Here is the call graph for this function:

DNSName DNSNode::getName ( ) const
inline

Here is the call graph for this function:

const DNSNode * DNSNode::next ( ) const
const DNSNode * DNSNode::prev ( ) const

Member Data Documentation

std::set<DNSNode, DNSNodeCmp> DNSNode::children

children, found by DNSLabel

DNSLabel DNSNode::d_name
DNSNode* DNSNode::d_parent {0}
uint16_t DNSNode::namepos {0}

for label compression, we also use DNSNodes

std::map<DNSType, RRSet > DNSNode::rrsets
std::unique_ptr<DNSNode> DNSNode::zone

if this is set, this node is a zone


The documentation for this struct was generated from the following files: