Kea 2.7.5
rdata.h File Reference
#include <dns/master_lexer.h>
#include <dns/master_loader.h>
#include <dns/master_loader_callbacks.h>
#include <dns/exceptions.h>
#include <util/buffer.h>
#include <boost/shared_ptr.hpp>
#include <memory>
#include <stdint.h>
+ Include dependency graph for rdata.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  isc::dns::rdata::CharStringTooLong
 A standard DNS module exception that is thrown if RDATA parser encounters a character-string (as defined in RFC1035) exceeding the maximum allowable length (MAX_CHARSTRING_LEN). More...
 
class  isc::dns::rdata::generic::Generic
 The generic::Generic class represents generic "unknown" RDATA. More...
 
class  isc::dns::rdata::InvalidRdataLength
 A standard DNS module exception that is thrown if RDATA parser encounters an invalid or inconsistent data length. More...
 
class  isc::dns::rdata::InvalidRdataText
 A standard DNS module exception that is thrown if RDATA parser fails to recognize a given textual representation. More...
 
class  isc::dns::rdata::Rdata
 The Rdata class is an abstract base class that provides a set of common interfaces to manipulate concrete RDATA objects. More...
 

Namespaces

namespace  isc
 Defines the logger used by the top-level component of kea-lfc.
 
namespace  isc::dns
 
namespace  isc::dns::rdata
 
namespace  isc::dns::rdata::generic
 

Typedefs

typedef boost::shared_ptr< const Rdataisc::dns::rdata::ConstRdataPtr
 

Functions

std::ostream & isc::dns::rdata::generic::operator<< (std::ostream &os, const Generic &rdata)
 Insert the name as a string into stream.
 
Parameterized Polymorphic RDATA Factories

This set of global functions provide a unified interface to create an Rdata object in a parameterized polymorphic way, that is, these functions take a pair of RRType and RRClass objects and data specific to that pair, and create an object of the corresponding concrete derived class of Rdata.

These will be useful when parsing/constructing a DNS message or parsing a master file, where information for a specific type of RDATA is given but the resulting object, once created, should better be used in a polymorphic way.

For example, if a master file parser encounters an NS RR

example.com. 3600 IN NS ns.example.com.

it stores the text fragments "IN", "NS", and "ns.example.com." in std::string objects class_txt, type_txt, and nsname_txt, respectively, then it would create a new RdataPtr object as follows:

RdataPtr rdata = createRdata(RRType(type_txt), RRClass(class_txt),
nsname_txt);
The RRClass class encapsulates DNS resource record classes.
Definition rrclass.h:89
The RRType class encapsulates DNS resource record types.
Definition rrtype.h:96
RdataPtr createRdata(const RRType &rrtype, const RRClass &rrclass, const std::string &rdata_string)
Create RDATA of a given pair of RR type and class from a string.
Definition rdata.cc:54
boost::shared_ptr< Rdata > RdataPtr
The RdataPtr type is a pointer-like type, pointing to an object of some concrete derived class of Rda...

On success, rdata will point to an object of the generic::NS class that internally holds a domain name of "ns.example.com."

Internally, these functions uses the corresponding RRParamRegistry::createRdata methods of the RRParamRegistry. See also the description on these methods for related notes.

int isc::dns::rdata::compareNames (const Name &n1, const Name &n2)
 Gives relative ordering of two names in terms of DNSSEC RDATA ordering.
 
RdataPtr isc::dns::rdata::createRdata (const RRType &rrtype, const RRClass &rrclass, const Rdata &source)
 Create RDATA of a given pair of RR type and class, copying of another RDATA of same kind.
 
RdataPtr isc::dns::rdata::createRdata (const RRType &rrtype, const RRClass &rrclass, const std::string &rdata_string)
 Create RDATA of a given pair of RR type and class from a string.
 
RdataPtr isc::dns::rdata::createRdata (const RRType &rrtype, const RRClass &rrclass, isc::util::InputBuffer &buff, size_t len)
 Create RDATA of a given pair of RR type and class from wire-format data.
 
RdataPtr isc::dns::rdata::createRdata (const RRType &rrtype, const RRClass &rrclass, MasterLexer &lexer, const Name *origin, MasterLoader::Options options, MasterLoaderCallbacks &callbacks)
 Create RDATA of a given pair of RR type and class using the master lexer.
 

Variables

const unsigned int isc::dns::rdata::MAX_CHARSTRING_LEN = 255
 The maximum allowable length of character-string containing in RDATA as defined in RFC1035, not including the 1-byte length field.
 
const size_t isc::dns::rdata::MAX_RDLENGTH = 65535
 Possible maximum length of RDATA, which is the maximum unsigned 16 bit value.