Browse Source

added missing minimum level document

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1456 e5f2f494-b856-4b98-b285-d166d9295462
JINMEI Tatuya 15 years ago
parent
commit
1058947126
3 changed files with 48 additions and 13 deletions
  1. 8 1
      src/lib/dns/buffer.h
  2. 4 2
      src/lib/dns/messagerenderer.cc
  3. 36 10
      src/lib/dns/messagerenderer.h

+ 8 - 1
src/lib/dns/buffer.h

@@ -326,7 +326,14 @@ public:
     /// 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()) {

+ 4 - 2
src/lib/dns/messagerenderer.cc

@@ -147,9 +147,11 @@ struct MessageRendererImpl {
     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_;
 };
 

+ 36 - 10
src/lib/dns/messagerenderer.h

@@ -99,11 +99,22 @@ public:
     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 @@ public:
     /// \name Setter Methods
     ///
     //@{
-    /// \brief TBD
-    void setLengthLimit(size_t len);
-
-    /// \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);
     //@}
 
     ///
@@ -130,8 +148,16 @@ public:
     ///
     /// \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.
     ///