Browse Source

[1866] define some special types of RRType constants like AXFR.

JINMEI Tatuya 12 years ago
parent
commit
6ad900eeff
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/lib/dns/python/pydnspp.cc

+ 10 - 0
src/lib/dns/python/pydnspp.cc

@@ -433,6 +433,7 @@ initModulePart_RRClass(PyObject* mod) {
         PyObjectContainer(po_IncompleteRRClass).installToModule(
             mod, "IncompleteRRClass");
 
+        // Incorporate auto-generated RRClass constants
 #include <dns/python/rrclass_constants_inc.cc>
     } catch (const std::exception& ex) {
         const std::string ex_what =
@@ -521,7 +522,16 @@ initModulePart_RRType(PyObject* mod) {
         PyObjectContainer(po_IncompleteRRType).installToModule(
             mod, "IncompleteRRType");
 
+        // Incorporate auto-generated RRType constants
 #include <dns/python/rrtype_constants_inc.cc>
+
+        // We still need to define some special types by hand (for now)
+        installClassVariable(rrtype_type, "IXFR",
+                                 createRRTypeObject(RRType::IXFR()));
+        installClassVariable(rrtype_type, "AXFR",
+                             createRRTypeObject(RRType::AXFR()));
+        installClassVariable(rrtype_type, "ANY",
+                             createRRTypeObject(RRType::ANY()));
     } catch (const std::exception& ex) {
         const std::string ex_what =
             "Unexpected failure in RRType initialization: " +