BIND 10 trac905, updated. a1a58a7382e82256f3f6785b7bebfa4643cced67 [trac905] added more detailed documentation text, which was half automated from C++ doxygen output.

BIND 10 source code commits bind10-changes at lists.isc.org
Fri May 13 07:26:23 UTC 2011


The branch, trac905 has been updated
       via  a1a58a7382e82256f3f6785b7bebfa4643cced67 (commit)
       via  928a439496c6040392cc03615c38aa3de45bfe87 (commit)
       via  324cf344f3e0cd9e35e50076911fe7801a7d4690 (commit)
      from  9eddc07cd32918f3b8e9ebd114d9c8f8f39a359b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a1a58a7382e82256f3f6785b7bebfa4643cced67
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri May 13 00:25:40 2011 -0700

    [trac905] added more detailed documentation text, which was half automated
    from C++ doxygen output.

commit 928a439496c6040392cc03615c38aa3de45bfe87
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri May 13 00:24:27 2011 -0700

    [trac905] editorial fixes: removed a garbage text (probably due to naive
    copy-paste), and made the doxygen params consistent with actual parameter
    names in the declaration.

commit 324cf344f3e0cd9e35e50076911fe7801a7d4690
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu May 12 10:36:02 2011 -0700

    [trac905] a minor wording fix: removed a duplicate 'the'

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dns/python/tsigerror_python.cc     |   13 ++--
 src/lib/dns/python/tsigerror_python_inc.cc |   83 ++++++++++++++++++++++++++++
 src/lib/dns/tsigerror.h                    |    5 +-
 src/lib/util/python/pycppwrapper_util.h    |    2 +-
 4 files changed, 92 insertions(+), 11 deletions(-)
 create mode 100644 src/lib/dns/python/tsigerror_python_inc.cc

-----------------------------------------------------------------------
diff --git a/src/lib/dns/python/tsigerror_python.cc b/src/lib/dns/python/tsigerror_python.cc
index 057649e..2e822ad 100644
--- a/src/lib/dns/python/tsigerror_python.cc
+++ b/src/lib/dns/python/tsigerror_python.cc
@@ -44,6 +44,9 @@ using namespace isc::dns::python;
 s_TSIGError::s_TSIGError() : cppobj(NULL) {
 }
 
+// Import pydoc text
+#include "tsigerror_python_inc.cc"
+
 namespace {
 // Shortcut type which would be convenient for adding class variables safely.
 typedef CPPPyObjectContainer<s_TSIGError, TSIGError> TSIGErrorContainer;
@@ -77,12 +80,12 @@ PyObject* TSIGError_richcmp(const s_TSIGError* const self,
 PyMethodDef TSIGError_methods[] = {
     { "get_code", reinterpret_cast<PyCFunction>(TSIGError_getCode),
       METH_NOARGS,
-      "Returns the code value" },
+      TSIGError_getCode_doc },
     { "to_text", reinterpret_cast<PyCFunction>(TSIGError_toText), METH_NOARGS,
-      "Returns the text representation" },
+      TSIGError_toText_doc },
     { "to_rcode", reinterpret_cast<PyCFunction>(TSIGError_toRcode),
       METH_NOARGS,
-      "Convert the TSIGError to a Rcode" },
+      TSIGError_toRcode_doc },
     { NULL, NULL, 0, NULL }
 };
 
@@ -252,9 +255,7 @@ PyTypeObject tsigerror_type = {
     NULL,                               // tp_setattro
     NULL,                               // tp_as_buffer
     Py_TPFLAGS_DEFAULT,                 // tp_flags
-    "The TSIGError class objects represent standard errors related to "
-    "TSIG protocol operations as defined in related specifications, mainly "
-    "in RFC2845.",
+    TSIGError_doc,
     NULL,                               // tp_traverse
     NULL,                               // tp_clear
     // THIS MAY HAVE TO BE CHANGED TO NULL:
diff --git a/src/lib/dns/python/tsigerror_python_inc.cc b/src/lib/dns/python/tsigerror_python_inc.cc
new file mode 100644
index 0000000..ed3b605
--- /dev/null
+++ b/src/lib/dns/python/tsigerror_python_inc.cc
@@ -0,0 +1,83 @@
+namespace {
+const char* const TSIGError_doc = "\n\
+TSIG errors.\n\
+\n\
+\n\
+The TSIGError class objects represent standard errors related to TSIG\n\
+protocol operations as defined in related specifications, mainly in\n\
+RFC2845.\n\
+\n\
+TSIGError(error_code)\n\
+\n\
+Constructor from the code value.\n\
+\n\
+Exceptions:\n\
+  None: \n\
+\n\
+Parameters:\n\
+  error_code: The underlying 16-bit error code value of the TSIGError.\n\
+\n\
+TSIGError(rcode)\n\
+\n\
+Constructor from Rcode.\n\
+\n\
+As defined in RFC2845, error code values from 0 to 15 (inclusive) are\n\
+derived from the DNS RCODEs, which are represented via the Rcode class\n\
+in this library. This constructor works as a converter from these\n\
+RCODEs to corresponding TSIGError objects.\n\
+\n\
+Exceptions:\n\
+  ValueError: Given rcode is not convertible to TSIGErrors.\n\
+\n\
+Parameters:\n\
+  rcode: the Rcode from which the TSIGError should be derived.\n\
+\n\
+";
+const char* const TSIGError_getCode_doc = "get_code() -> integer\n\
+\n\
+Returns the TSIGCode error code value.\n\
+\n\
+Exceptions:\n\
+  None: \n\
+\n\
+Return Value(s):\n\
+  The underlying code value corresponding to the TSIGError.\n\
+";
+const char* const TSIGError_toText_doc = "to_text() -> string\n\
+\n\
+Convert the TSIGError to a string.\n\
+\n\
+For codes derived from RCODEs up to 15, this method returns the same\n\
+string as Rcode.to_text() for the corresponding code. For other pre-\n\
+defined code values (see TSIGError.CodeValue), this method returns a\n\
+string representation of the \"mnemonic' used for the enum and\n\
+constant objects as defined in RFC2845. For example, the string for\n\
+code value 16 is \"BADSIG\", etc. For other code values it returns a\n\
+string representation of the decimal number of the value, e.g. \"32\",\n\
+\"100\", etc.\n\
+\n\
+Exceptions:\n\
+  None\n\
+\n\
+Return Value(s):\n\
+  A string representation of the TSIGError.\n\
+";
+const char* const TSIGError_toRcode_doc = "to_rcode() -> Rcode\n\
+\n\
+Convert the TSIGError to a Rcode.\n\
+\n\
+This method returns an Rcode object that is corresponding to the TSIG\n\
+error. The returned Rcode is expected to be used by a verifying server\n\
+to specify the RCODE of a response when TSIG verification fails.\n\
+\n\
+Specifically, this method returns Rcode.NOTAUTH() for the TSIG\n\
+specific errors, BADSIG, BADKEY, BADTIME, as described in RFC2845. For\n\
+errors derived from the standard Rcode (code 0-15), it returns the\n\
+corresponding Rcode. For others, this method returns Rcode.SERVFAIL()\n\
+as a last resort.\n\
+\n\
+Exceptions:\n\
+  None: \n\
+\n\
+";
+}
diff --git a/src/lib/dns/tsigerror.h b/src/lib/dns/tsigerror.h
index 9794c41..0dc908c 100644
--- a/src/lib/dns/tsigerror.h
+++ b/src/lib/dns/tsigerror.h
@@ -30,9 +30,6 @@ class RRClass;
 /// The \c TSIGError class objects represent standard errors related to
 /// TSIG protocol operations as defined in related specifications, mainly
 /// in RFC2845.
-///
-/// (RCODEs) of the header section of DNS messages, and extended response
-/// codes as defined in the EDNS specification.
 class TSIGError {
 public:
     /// Constants for pre-defined TSIG error values.
@@ -58,7 +55,7 @@ public:
     ///
     /// \exception None
     ///
-    /// \param code The underlying 16-bit error code value of the \c TSIGError.
+    /// \param error_code The underlying 16-bit error code value of the \c TSIGError.
     explicit TSIGError(uint16_t error_code) : code_(error_code) {}
 
     /// Constructor from \c Rcode.
diff --git a/src/lib/util/python/pycppwrapper_util.h b/src/lib/util/python/pycppwrapper_util.h
index 20ca9e3..fd55c19 100644
--- a/src/lib/util/python/pycppwrapper_util.h
+++ b/src/lib/util/python/pycppwrapper_util.h
@@ -67,7 +67,7 @@ public:
 
 /// This helper class is similar to the standard autoptr and manages PyObject
 /// using some kind of RAII techniques.  It is, however, customized for the
-/// the python C API.
+/// python C API.
 ///
 /// A PyObjectContainer object is constructed with a pointer to PyObject,
 /// which is often just created dynamically.  The caller will eventually




More information about the bind10-changes mailing list