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)  

QType Class Reference

#include <qtype.hh>

Collaboration diagram for QType:

Classes

class  init
 

Public Types

enum  typeenum : uint16_t {
  ENT =0, A =1, NS =2, CNAME =5,
  SOA =6, MB =7, MG =8, MR =9,
  WKS =11, PTR =12, HINFO =13, MINFO =14,
  MX =15, TXT =16, RP =17, AFSDB =18,
  SIG =24, KEY =25, AAAA =28, LOC =29,
  SRV =33, NAPTR =35, KX =36, CERT =37,
  A6 =38, DNAME =39, OPT =41, DS =43,
  SSHFP =44, IPSECKEY =45, RRSIG =46, NSEC =47,
  DNSKEY =48, DHCID =49, NSEC3 =50, NSEC3PARAM =51,
  TLSA =52, SMIMEA =53, RKEY =57, CDS =59,
  CDNSKEY =60, OPENPGPKEY =61, SPF =99, EUI48 =108,
  EUI64 =109, TKEY =249, TSIG =250, IXFR =251,
  AXFR =252, MAILB =253, MAILA =254, ANY =255,
  URI =256, CAA =257, DLV =32769, ADDR =65400,
  ALIAS =65401, LUA =65402
}
 
typedef pair< string, uint16_t > namenum
 

Public Member Functions

 QType ()
 Naked constructor. More...
 
 QType (uint16_t)
 convert from an integer to a QType More...
 
 QType (const QType &orig)
 
QTypeoperator= (uint16_t)
 Assigns integers to us. More...
 
QTypeoperator= (const char *)
 Assigns strings to us. More...
 
QTypeoperator= (const string &)
 Assigns strings to us. More...
 
QTypeoperator= (const QType &rhs)
 
bool operator< (const QType &rhs) const
 
const string getName () const
 Get a string representation of this type. More...
 
uint16_t getCode () const
 Get the integer representation of this type. More...
 
bool isSupportedType ()
 
bool isMetadataType ()
 
bool operator== (const QType &comp) const
 
bool operator!= (const QType &comp) const
 
bool operator== (QType::typeenum comp) const
 
bool operator!= (QType::typeenum comp) const
 
bool operator== (uint16_t comp) const
 
bool operator!= (uint16_t comp) const
 

Static Public Member Functions

static int chartocode (const char *p)
 convert a character string to a code More...
 

Static Public Attributes

static vector< namenumnames
 

Private Attributes

uint16_t code
 

Static Private Attributes

static class QType::init initializer
 

Detailed Description

The QType class is meant to deal easily with the different kind of resource types, like 'A', 'NS', 'CNAME' etcetera. These types have both a name and a number. This class can seamlessly move between them. Use it like this:

t="CNAME";
cout<<t.getCode()<<endl; // prints '5'
t=6;
cout<<t.getName()<<endl; // prints 'SOA'

Definition at line 45 of file qtype.hh.

Member Typedef Documentation

◆ namenum

typedef pair<string,uint16_t> QType::namenum

Definition at line 134 of file qtype.hh.

Member Enumeration Documentation

◆ typeenum

enum QType::typeenum : uint16_t
Enumerator
ENT 
NS 
CNAME 
SOA 
MB 
MG 
MR 
WKS 
PTR 
HINFO 
MINFO 
MX 
TXT 
RP 
AFSDB 
SIG 
KEY 
AAAA 
LOC 
SRV 
NAPTR 
KX 
CERT 
A6 
DNAME 
OPT 
DS 
SSHFP 
IPSECKEY 
RRSIG 
NSEC 
DNSKEY 
DHCID 
NSEC3 
NSEC3PARAM 
TLSA 
SMIMEA 
RKEY 
CDS 
CDNSKEY 
OPENPGPKEY 
SPF 
EUI48 
EUI64 
TKEY 
TSIG 
IXFR 
AXFR 
MAILB 
MAILA 
ANY 
URI 
CAA 
DLV 
ADDR 
ALIAS 
LUA 

Definition at line 73 of file qtype.hh.

Constructor & Destructor Documentation

◆ QType() [1/3]

QType::QType ( )

Naked constructor.

Definition at line 37 of file qtype.cc.

References code.

◆ QType() [2/3]

QType::QType ( uint16_t  n)
explicit

convert from an integer to a QType

Definition at line 113 of file qtype.cc.

References code.

◆ QType() [3/3]

QType::QType ( const QType orig)
inline

Definition at line 50 of file qtype.hh.

Member Function Documentation

◆ chartocode()

int QType::chartocode ( const char *  p)
static

convert a character string to a code

Definition at line 81 of file qtype.cc.

References names, and toUpper().

Referenced by deleteRRSet(), and operator=().

◆ getCode()

uint16_t QType::getCode ( ) const

Get the integer representation of this type.

Definition at line 60 of file qtype.cc.

References code.

Referenced by addOrReplaceRecord(), apiServerZoneExport(), BOOST_AUTO_TEST_CASE(), checkHostnameCorrectness(), PacketHandler::checkUpdatePrerequisites(), PacketHandler::checkUpdatePrescan(), DNSProxy::completePacket(), DNSRecord::DNSRecord(), PacketHandler::doAdditionalProcessingAndDropAA(), PacketHandler::doChaosRequest(), PacketHandler::doQuestion(), editZone(), LMDBBackend::feedRecord(), Bind2Backend::feedRecord(), fillZone(), gatherRecords(), gatherRecordsFromZone(), ZoneParserTNG::get(), MyDNSBackend::get(), AuthPacketCache::get(), PipeBackend::get(), TinyDNSBackend::get(), DNSBackend::get(), LMDBBackend::get_list(), LMDBBackend::get_lookup(), Bind2Backend::handle::get_normal(), TinyDNSBackend::getAllDomains(), LMDBBackend::getBeforeAndAfterNames(), PacketHandler::getBestWildcard(), AuthQueryCache::getEntry(), DNSSECKeeper::getPreRRSIGs(), DNSResourceRecord::getZoneRepresentation(), AuthQueryCache::insert(), AuthPacketCache::insert(), Bind2Backend::insertRecord(), listZone(), loadZoneFromDisk(), MyDNSBackend::lookup(), RandomBackend::lookup(), LMDBBackend::lookup(), OracleBackend::lookup(), OdbxBackend::lookup(), GSQLBackend::lookup(), LdapBackend::lookup_simple(), LdapBackend::lookup_strict(), LdapBackend::lookup_tree(), main(), makePtr(), makeRecordContent(), LMDBBackend::compoundOrdername::operator()(), parseZone(), Bind2Backend::parseZoneFile(), patchZone(), PacketHandler::performUpdate(), processRecordForZS(), PacketHandler::processUpdate(), DNSSECKeeper::rectifyZone(), LMDBBackend::replaceRRSet(), boost::serialization::save(), DNSResourceRecord::setContent(), ResponseStats::submitResponse(), validateGatheredRRType(), verifyCrypto(), and DNSPacket::wrapup().

◆ getName()

const string QType::getName ( ) const

◆ isMetadataType()

bool QType::isMetadataType ( )

Definition at line 49 of file qtype.cc.

References AXFR, code, IXFR, MAILA, MAILB, and TSIG.

Referenced by PacketHandler::checkUpdatePrescan().

◆ isSupportedType()

bool QType::isSupportedType ( )

Definition at line 42 of file qtype.cc.

References code, and names.

Referenced by PacketHandler::checkUpdatePrescan().

◆ operator!=() [1/3]

bool QType::operator!= ( const QType comp) const
inline

Definition at line 141 of file qtype.hh.

References code.

◆ operator!=() [2/3]

bool QType::operator!= ( QType::typeenum  comp) const
inline

Definition at line 149 of file qtype.hh.

References code.

◆ operator!=() [3/3]

bool QType::operator!= ( uint16_t  comp) const
inline

Definition at line 157 of file qtype.hh.

References code.

◆ operator<()

bool QType::operator< ( const QType rhs) const
inline

Definition at line 62 of file qtype.hh.

References code.

◆ operator=() [1/4]

QType & QType::operator= ( const char *  p)

Assigns strings to us.

Definition at line 100 of file qtype.cc.

References chartocode(), and code.

◆ operator=() [2/4]

QType& QType::operator= ( const QType rhs)
inline
Parameters
rhsAssigns strings to us

Definition at line 56 of file qtype.hh.

References code.

◆ operator=() [3/4]

QType & QType::operator= ( const string &  s)

Assigns strings to us.

Definition at line 106 of file qtype.cc.

References chartocode(), and code.

◆ operator=() [4/4]

QType & QType::operator= ( uint16_t  n)

Assigns integers to us.

Definition at line 75 of file qtype.cc.

References code.

◆ operator==() [1/3]

bool QType::operator== ( const QType comp) const
inline

Definition at line 137 of file qtype.hh.

References code.

◆ operator==() [2/3]

bool QType::operator== ( QType::typeenum  comp) const
inline

Definition at line 145 of file qtype.hh.

References code.

◆ operator==() [3/3]

bool QType::operator== ( uint16_t  comp) const
inline

Definition at line 153 of file qtype.hh.

References code.

Member Data Documentation

◆ code

uint16_t QType::code
private

◆ initializer

QType::init QType::initializer
staticprivate

Definition at line 35 of file qtype.cc.

◆ names

vector< QType::namenum > QType::names
static

The documentation for this class was generated from the following files:
QType::getCode
uint16_t getCode() const
Get the integer representation of this type.
Definition: qtype.cc:60
QType
Definition: qtype.hh:45
QType::getName
const string getName() const
Get a string representation of this type.
Definition: qtype.cc:65