156 order_(order), nlabels_(nlabels), relation_(relation) {}
172 unsigned int nlabels_;
231 typedef std::vector<uint8_t> NameString;
233 typedef std::vector<uint8_t> NameOffsets;
241 Name() : length_(0), labelcount_(0) {}
253 explicit Name(
const std::string& namestr,
bool downcase =
false);
282 Name(
const char* name_data,
size_t data_len,
const Name* origin,
342 uint8_t
at(
size_t pos)
const
344 if (pos >= length_) {
347 return (ndata_[pos]);
389 std::string
toText(
bool omit_final_dot =
false)
const;
399 std::string
toRawText(
bool omit_final_dot =
false)
const;
484 bool leq(
const Name& other)
const;
499 bool geq(
const Name& other)
const;
564 Name split(
unsigned int first,
unsigned int n)
const;
728 NameOffsets offsets_;
729 unsigned int length_;
730 unsigned int labelcount_;
735 static Name root_name(
".");
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
A generic exception that is thrown if a parameter given to a method would refer to or modify out-of-r...
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
A standard DNS module exception that is thrown if the name parser fails to decode a back-slash escape...
BadEscape(const char *file, size_t line, const char *what)
A standard DNS module exception that is thrown if the name parser encounters an obsolete or incomplet...
BadLabelType(const char *file, size_t line, const char *what)
A standard DNS module exception that is thrown if the name parser encounters an empty label in the mi...
EmptyLabel(const char *file, size_t line, const char *what)
A standard DNS module exception that is thrown if the name parser finds the input (string or wire-for...
IncompleteName(const char *file, size_t line, const char *what)
Light-weight Accessor to Name data.
Thrown when origin is null and is needed.
MissingNameOrigin(const char *file, size_t line, const char *what)
This is a supplemental class used only as a return value of Name::compare() and LabelSequence::compar...
unsigned int getCommonLabels() const
Returns the number of common labels of the comparison result.
int getOrder() const
Returns the ordering of the comparison result.
NameComparisonResult(int order, unsigned int nlabels, NameRelation relation)
Constructor from a comparison tuple.
NameRelation getRelation() const
Returns the NameRelation of the comparison result.
NameRelation
The relation of two names under comparison.
Base class for name parser exceptions.
The Name class encapsulates DNS names.
static const size_t MAX_LABELLEN
Max allowable length of labels of a domain name.
bool operator>=(const Name &other) const
Same as geq()
static const uint16_t MAX_COMPRESS_POINTER
Max possible pointer value for name compression.
Name reverse() const
Reverse the labels of a name.
bool lthan(const Name &other) const
Less-than comparison for Name against other
NameComparisonResult compare(const Name &other) const
Compare two Names.
bool equals(const Name &other) const
Return true iff two names are equal.
static const uint16_t COMPRESS_POINTER_MARK16
A 16-bit masked value indicating a start of compression pointer.
bool geq(const Name &other) const
Greater-than or equal comparison for Name against other
static const size_t MAX_WIRE
Max allowable length of domain names.
Name split(unsigned int first, unsigned int n) const
Extract a specified subpart of Name.
bool nequals(const Name &other) const
Return true iff two names are not equal.
bool operator<(const Name &other) const
Same as lthan()
uint8_t at(size_t pos) const
Provides one-byte name data in wire format at the specified position.
bool operator!=(const Name &other) const
Same as nequals()
std::string toText(bool omit_final_dot=false) const
Convert the Name to a string.
void toWire(AbstractMessageRenderer &renderer) const
Render the Name in the wire format with compression.
bool operator>(const Name &other) const
Same as gthan()
unsigned int getLabelCount() const
Returns the number of labels contained in the Name.
bool operator<=(const Name &other) const
Same as leq()
static const size_t MAX_LABELS
Max allowable labels of domain names.
bool gthan(const Name &other) const
Greater-than comparison for Name against other
bool operator==(const Name &other) const
Same as equals()
static const Name & ROOT_NAME()
Root name (i.e. ".").
Name concatenate(const Name &suffix) const
Concatenate two names.
std::string toRawText(bool omit_final_dot=false) const
Convert the LabelSequence to a string without escape sequences.
size_t getLength() const
Gets the length of the Name in its wire format.
static const uint16_t COMPRESS_POINTER_MARK8
A 8-bit masked value indicating a start of compression pointer.
bool leq(const Name &other) const
Less-than or equal comparison for Name against other
Name & downcase()
Downcase all upper case alphabet characters in the name.
bool isWildcard() const
Test if this is a wildcard name.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
ostream & operator<<(std::ostream &os, const EDNS &edns)
Insert the EDNS as a string into stream.
Defines the logger used by the top-level component of kea-lfc.