summaryrefslogtreecommitdiffstats
path: root/src/lib/dns/rdata/generic/detail/char_string.h
diff options
context:
space:
mode:
authorJINMEI Tatuya <jinmei@isc.org>2012-12-05 04:52:22 +0100
committerJINMEI Tatuya <jinmei@isc.org>2012-12-05 04:52:22 +0100
commitde92f31ea5fc5991e10bc61c175373b67f78deab (patch)
tree12ebf479dee1a849fbb7da1bd378ee4f207b1b0c /src/lib/dns/rdata/generic/detail/char_string.h
parent[2442] test for escaped characters (diff)
downloadkea-de92f31ea5fc5991e10bc61c175373b67f78deab.tar.xz
kea-de92f31ea5fc5991e10bc61c175373b67f78deab.zip
[2442] documentation updates
Diffstat (limited to 'src/lib/dns/rdata/generic/detail/char_string.h')
-rw-r--r--src/lib/dns/rdata/generic/detail/char_string.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/dns/rdata/generic/detail/char_string.h b/src/lib/dns/rdata/generic/detail/char_string.h
index b5dc338e96..702af04ed5 100644
--- a/src/lib/dns/rdata/generic/detail/char_string.h
+++ b/src/lib/dns/rdata/generic/detail/char_string.h
@@ -32,6 +32,22 @@ namespace detail {
/// be the bare char basis.
typedef std::vector<uint8_t> CharString;
+/// \brief 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 \c result parameter). It handles escape notations of
+/// character-strings with a backslash ('\'), and checks the length
+/// restriction.
+///
+/// \throw CharStringTooLong The resulting binary data are too large for a
+/// valid character-string.
+/// \throw InvalidRdataText Other syntax errors.
+///
+/// \brief str_region A string that represents a character-string.
+/// \brief result A placeholder vector where the resulting data are to be
+/// stored. Expected to be empty, but it's not checked.
void strToCharString(const MasterToken::StringRegion& str_region,
CharString& result);