[svn] commit: r1456 - in /trunk/src/lib/dns: buffer.h messagerenderer.cc messagerenderer.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Mar 16 19:09:26 UTC 2010
Author: jinmei
Date: Tue Mar 16 19:09:25 2010
New Revision: 1456
Log:
added missing minimum level document
Modified:
trunk/src/lib/dns/buffer.h
trunk/src/lib/dns/messagerenderer.cc
trunk/src/lib/dns/messagerenderer.h
Modified: trunk/src/lib/dns/buffer.h
==============================================================================
--- trunk/src/lib/dns/buffer.h (original)
+++ trunk/src/lib/dns/buffer.h Tue Mar 16 19:09:25 2010
@@ -326,7 +326,14 @@
/// that is to be filled in later, e.g, by \ref writeUint16At().
/// \param len The length of the gap to be inserted in bytes.
void skip(size_t len) { data_.insert(data_.end(), len, 0); }
- /// \brief TBD
+
+ /// \brief Trim the specified length of data from the end of the buffer.
+ ///
+ /// The specified length must not exceed the current data size of the
+ /// buffer; otherwise an exception of class \c isc::OutOfRange will
+ /// be thrown.
+ ///
+ /// \param len The length of data that should be trimmed.
void trim(size_t len)
{
if (len > data_.size()) {
Modified: trunk/src/lib/dns/messagerenderer.cc
==============================================================================
--- trunk/src/lib/dns/messagerenderer.cc (original)
+++ trunk/src/lib/dns/messagerenderer.cc Tue Mar 16 19:09:25 2010
@@ -147,9 +147,11 @@
OutputBuffer nbuffer_;
/// A set of compression pointers.
std::set<NameCompressNode, NameCompare> nodeset_;
-
- /// TBD
+ /// The maximum length of rendered data that can fit without
+ /// truncation.
uint16_t msglength_limit_;
+ /// A boolean flag that indicates truncation has occurred while rendering
+ /// the data.
bool truncated_;
};
Modified: trunk/src/lib/dns/messagerenderer.h
==============================================================================
--- trunk/src/lib/dns/messagerenderer.h (original)
+++ trunk/src/lib/dns/messagerenderer.h Tue Mar 16 19:09:25 2010
@@ -99,11 +99,22 @@
const void* getData() const;
/// \brief Return the length of data written in the internal buffer.
size_t getLength() const;
-
- /// \brief TBD
+ /// \brief Return whether truncation has occurred while rendering.
+ ///
+ /// Once the return value of this method is \c true, it doesn't make sense
+ /// to try rendering more data, although this class itself doesn't reject
+ /// the attempt.
+ ///
+ /// This method never throws an exception.
+ ///
+ /// \return true if truncation has occurred; otherwise \c false.
bool isTruncated() const;
-
- /// \brief TBD
+ /// \brief Return the maximum length of rendered data that can fit in the
+ /// corresponding DNS message without truncation.
+ ///
+ /// This method never throws an exception.
+ ///
+ /// \return The maximum length in bytes.
size_t getLengthLimit() const;
//@}
@@ -111,11 +122,18 @@
/// \name Setter Methods
///
//@{
- /// \brief TBD
+ /// \brief Mark the renderer to indicate truncation has occurred while
+ /// rendering.
+ ///
+ /// This method never throws an exception.
+ void setTruncated();
+ /// \brief Set the maximum length of rendered data that can fit in the
+ /// corresponding DNS message without truncation.
+ ///
+ /// This method never throws an exception.
+ ///
+ /// \param len The maximum length in bytes.
void setLengthLimit(size_t len);
-
- /// \brief TBD
- void setTruncated();
//@}
///
@@ -130,8 +148,16 @@
///
/// \param len The length of the gap to be inserted in bytes.
void skip(size_t len);
-
- /// \brief TBD
+ /// \brief Trim the specified length of data from the end of the internal
+ /// buffer.
+ ///
+ /// This method is provided for such cases as DNS message truncation.
+ ///
+ /// The specified length must not exceed the current data size of the
+ /// buffer; otherwise an exception of class \c isc::OutOfRange will
+ /// be thrown.
+ ///
+ /// \param len The length of data that should be trimmed.
void trim(size_t len);
/// \brief Clear the internal buffer and other internal resources.
///
More information about the bind10-changes
mailing list