Kea 2.7.6
|
Classes | |
class | TXTLikeImpl |
rdata::TXTLikeImpl class represents the TXT-like RDATA for TXT and SPF types. More... | |
Typedefs | |
typedef std::vector< uint8_t > | CharString |
Type for DNS character string. | |
typedef std::vector< uint8_t > | CharStringData |
Type for DNS character string without the length prefix. | |
Functions | |
size_t | bufferToCharString (isc::util::InputBuffer &buffer, size_t rdata_len, CharString &target) |
Convert a buffer containing a character-string to CharString. | |
std::string | charStringDataToString (const CharStringData &char_string) |
Convert a CharStringData into a textual DNS character-string. | |
std::string | charStringToString (const CharString &char_string) |
Convert a CharString into a textual DNS character-string. | |
int | compareCharStringDatas (const CharStringData &self, const CharStringData &other) |
Compare two CharStringData objects. | |
int | compareCharStrings (const CharString &self, const CharString &other) |
Compare two CharString objects. | |
Name | createNameFromLexer (MasterLexer &lexer, const Name *origin) |
Construct a Name object using a master lexer and optional origin. | |
void | stringToCharString (const MasterToken::StringRegion &str_region, CharString &result) |
Convert a DNS character-string into corresponding binary data. | |
void | stringToCharStringData (const MasterToken::StringRegion &str_region, CharStringData &result) |
Convert a DNS character-string into corresponding binary data. | |
typedef std::vector<uint8_t> isc::dns::rdata::generic::detail::CharString |
Type for DNS character string.
A character string can contain any unsigned 8-bit value, so this cannot be the bare char basis.
Definition at line 27 of file char_string.h.
typedef std::vector<uint8_t> isc::dns::rdata::generic::detail::CharStringData |
Type for DNS character string without the length prefix.
Definition at line 30 of file char_string.h.
size_t isc::dns::rdata::generic::detail::bufferToCharString | ( | isc::util::InputBuffer & | buffer, |
size_t | rdata_len, | ||
CharString & | target ) |
Convert a buffer containing a character-string to CharString.
This method reads one character-string from the given buffer (in wire format) and places the result in the given CharString
object. Since this is expected to be used in message parsing, the exception it raises is of that type.
On success, the buffer position is advanced to the end of the char-string, and the number of bytes read is returned.
buffer | The buffer to read from. |
rdata_len | The total size of the rr's rdata currently being read (used for integrity checks in the wire data) |
target | The CharString where the result will be stored. Any existing data in the target will be overwritten. |
DNSMessageFORMERR | If the available data is not enough to read the character-string, or if the character-string length is out of bounds |
Definition at line 235 of file char_string.cc.
References isc::util::InputBuffer::getLength(), isc::util::InputBuffer::getPosition(), isc_throw, isc::util::InputBuffer::readData(), and isc::util::InputBuffer::readUint8().
std::string isc::dns::rdata::generic::detail::charStringDataToString | ( | const CharStringData & | char_string | ) |
Convert a CharStringData into a textual DNS character-string.
Reverse of stringToCharStringData()
. See stringToCharString()
vs. stringToCharStringData()
.
char_string | The CharStringData to convert. |
char_string
. Definition at line 148 of file char_string.cc.
std::string isc::dns::rdata::generic::detail::charStringToString | ( | const CharString & | char_string | ) |
Convert a CharString into a textual DNS character-string.
This method converts a binary 8-bit representation of a DNS character string into a textual string representation, escaping any special characters in the process. For example, characters like double-quotes, semi-colon and backspace are prefixed with backspace character, and characters not in the printable range of [0x20, 0x7e] (inclusive) are converted to the \xxx 3-digit decimal representation.
char_string | The CharString to convert. |
char_string
. Definition at line 121 of file char_string.cc.
Referenced by isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >::toText().
int isc::dns::rdata::generic::detail::compareCharStringDatas | ( | const CharStringData & | self, |
const CharStringData & | other ) |
Compare two CharStringData objects.
self | The CharStringData field to compare |
other | The CharStringData field to compare to |
self
would be sorted before other
1 if self
would be sorted after other
0 if self
and other
are equal Definition at line 206 of file char_string.cc.
int isc::dns::rdata::generic::detail::compareCharStrings | ( | const CharString & | self, |
const CharString & | other ) |
Compare two CharString objects.
self | The CharString field to compare |
other | The CharString field to compare to |
self
would be sorted before other
1 if self
would be sorted after other
0 if self
and other
are equal Definition at line 169 of file char_string.cc.
|
inline |
Construct a Name object using a master lexer and optional origin.
This is a convenient shortcut of commonly used code pattern that would be used to build RDATA that contain a domain name field.
Note that this function throws an exception against invalid input. The (direct or indirect) caller's responsibility needs to expect and handle exceptions appropriately.
MasterLexer::LexerError | The next token from lexer is not string. |
Other | Exceptions from the Name class constructor if the next string token from the lexer does not represent a valid name. |
lexer | A MasterLexer object. Its next token is expected to be a string that represent a domain name. |
origin | If non null, specifies the origin of the name to be constructed. |
lexer
. Definition at line 207 of file rdataclass.h.
References isc::dns::MasterToken::StringRegion::beg, isc::dns::MasterLexer::getNextToken(), isc::dns::MasterToken::getStringRegion(), isc::dns::MasterToken::StringRegion::len, and isc::dns::MasterToken::STRING.
void isc::dns::rdata::generic::detail::stringToCharString | ( | const MasterToken::StringRegion & | str_region, |
CharString & | result ) |
Convert a DNS character-string into corresponding binary data.
This helper function takes a string object that is expected to be a textual representation of a valid DNS character-string, and dumps the corresponding binary sequence in the given placeholder (passed via the result
parameter). It handles escape notations of character-strings with a backslash ('\'), and checks the length restriction.
CharStringTooLong | The resulting binary data are too large for a valid character-string. |
InvalidRdataText | Other syntax errors. |
str_region A string that represents a character-string.
result A placeholder vector where the resulting data are to be stored. Expected to be empty, but it's not checked.
Definition at line 55 of file char_string.cc.
References isc::dns::MasterToken::StringRegion::beg, isc_throw, isc::dns::MasterToken::StringRegion::len, and isc::dns::rdata::MAX_CHARSTRING_LEN.
void isc::dns::rdata::generic::detail::stringToCharStringData | ( | const MasterToken::StringRegion & | str_region, |
CharStringData & | result ) |
Convert a DNS character-string into corresponding binary data.
This method functions similar to stringToCharString()
except it does not include the 1-octet length prefix in the result
, and the result is not limited to MAX_CHARSTRING_LEN octets.
InvalidRdataText | Upon syntax errors. |
str_region A string that represents a character-string.
result A placeholder vector where the resulting data are to be stored. Expected to be empty, but it's not checked.
Definition at line 92 of file char_string.cc.
References isc::dns::MasterToken::StringRegion::beg, isc_throw, and isc::dns::MasterToken::StringRegion::len.