]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1455] Add NameRelation constants to pydnspp
authorJelte Jansen <jelte@isc.org>
Tue, 22 May 2012 18:42:19 +0000 (20:42 +0200)
committerJelte Jansen <jelte@isc.org>
Tue, 22 May 2012 19:20:09 +0000 (21:20 +0200)
src/lib/dns/python/pydnspp.cc

index 64e3cae5c336668adafcdc21f593415ea8a6549b..82f4e636847f8b1fd73bf3bb9b02d03d98f8b2a9 100644 (file)
@@ -221,7 +221,16 @@ initModulePart_Name(PyObject* mod) {
         NameComparisonResult::COMMONANCESTOR, "COMMONANCESTOR");
     addClassVariable(name_comparison_result_type, "NameRelation",
                      po_NameRelation);
-
+    // Add the constants themselves too
+    addClassVariable(name_comparison_result_type, "SUPERDOMAIN",
+                     Py_BuildValue("I", NameComparisonResult::SUPERDOMAIN));
+    addClassVariable(name_comparison_result_type, "SUBDOMAIN",
+                     Py_BuildValue("I", NameComparisonResult::SUBDOMAIN));
+    addClassVariable(name_comparison_result_type, "EQUAL",
+                     Py_BuildValue("I", NameComparisonResult::EQUAL));
+    addClassVariable(name_comparison_result_type, "COMMONANCESTOR",
+                     Py_BuildValue("I", NameComparisonResult::COMMONANCESTOR));
+    
     PyModule_AddObject(mod, "NameComparisonResult",
         reinterpret_cast<PyObject*>(&name_comparison_result_type));