 |
Kea
1.5.0
|
Go to the documentation of this file.
7 #ifndef LABELSEQUENCE_H
8 #define LABELSEQUENCE_H 1
65 data_(&name.ndata_[0]),
66 offsets_(&name.offsets_[0]),
127 offsets_(ls.offsets_),
128 first_label_(ls.first_label_),
129 last_label_(ls.last_label_)
145 const uint8_t*
getData(
size_t* len)
const;
228 void serialize(
void* buf,
size_t buf_len)
const;
261 bool case_sensitive =
false)
const;
289 return (last_label_ - first_label_ + 1);
306 std::string
toText()
const;
316 std::string
toRawText(
bool omit_final_dot)
const;
363 std::string
toText(
bool omit_final_dot)
const;
388 size_t getHash(
bool case_sensitive)
const;
396 const uint8_t* data_;
397 const uint8_t* offsets_;
420 operator<<(std::ostream& os,
const LabelSequence& label_sequence);
422 inline const LabelSequence&
424 static const uint8_t wildcard_buf[4] = { 0x01, 0x00, 0x01,
'*' };
std::string toRawText(bool omit_final_dot) const
Convert the LabelSequence to a string without escape sequences.
void serialize(void *buf, size_t buf_len) const
Serialize the LabelSequence object in to a buffer.
bool isAbsolute() const
Checks whether the label sequence is absolute.
std::string toText() const
Convert the LabelSequence to a string.
std::string toText(bool omit_final_dot=false) const
Convert the Name to a string.
void extend(const LabelSequence &labels, uint8_t buf[MAX_SERIALIZED_LENGTH])
Extend this LabelSequence with the given labelsequence.
LabelSequence(const LabelSequence &ls)
Copy constructor.
size_t getDataLength() const
Return the length of the wire-format data of this LabelSequence.
static const LabelSequence & WILDCARD()
Wildcard label ("*")
This is a supplemental class used only as a return value of Name::compare() and LabelSequence::compar...
Defines the logger used by the top-level component of kea-dhcp-ddns.
ostream & operator<<(std::ostream &os, const EDNS &edns)
Insert the EDNS as a string into stream.
The Name class encapsulates DNS names.
bool equals(const LabelSequence &other, bool case_sensitive=false) const
Compares two label sequences for equality.
size_t getLabelCount() const
Returns the current number of labels for this LabelSequence.
size_t getHash(bool case_sensitive) const
Calculate a simple hash for the label sequence.
static const size_t MAX_WIRE
Max allowable length of domain names.
void stripLeft(size_t i)
Remove labels from the front of this LabelSequence.
bool operator==(const LabelSequence &other) const
Compares two label sequences for equality (case ignored).
const uint8_t * getData(size_t *len) const
Return the wire-format data for this LabelSequence.
static const size_t MAX_LABELS
Max allowable labels of domain names.
size_t getSerializedLength() const
Return the size of serialized image of the LabelSequence.
LabelSequence(const Name &name)
Constructs a LabelSequence for the given name.
void stripRight(size_t i)
Remove labels from the end of this LabelSequence.
static const size_t MAX_SERIALIZED_LENGTH
Max possible size of serialized image generated by serialize.
NameComparisonResult compare(const LabelSequence &other, bool case_sensitive=false) const
Compares two label sequences.
Light-weight Accessor to Name data.