]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2497] Make new_rdata_factory_users[] a list of tuples
authorMukund Sivaraman <muks@isc.org>
Mon, 3 Dec 2012 05:21:18 +0000 (10:51 +0530)
committerMukund Sivaraman <muks@isc.org>
Mon, 3 Dec 2012 05:24:09 +0000 (10:54 +0530)
Also:
* document new_rdata_factory_users[] with an example
* Rename new_rdatafactory_users[] to new_rdata_factory_users[]

src/lib/dns/gen-rdatacode.py.in

index 9f2258206ad646cca8cfe98d05941c5396b56d22..a5f62776fe9ec0a72754571a512a90f170197589 100755 (executable)
@@ -24,11 +24,20 @@ from os.path import getmtime
 import re
 import sys
 
+# new_rdata_factory_users[] is a list of tuples of the form (rrtype,
+# rrclass). Items in the list use the (new) RdataFactory class, and
+# items which are not in the list use OldRdataFactory class.
+# Note: rrtype and rrclass must be specified in lowercase in
+# new_rdata_factory_users.
+#
+# Example:
+#     new_rdata_factory_users = [('a', 'in'), ('a', 'ch')]
+new_rdata_factory_users = []
+
 re_typecode = re.compile('([\da-z]+)_(\d+)')
 classcode2txt = {}
 typecode2txt = {}
 typeandclass = []
-new_rdatafactory_users = []
 generic_code = 65536            # something larger than any code value
 rdata_declarations = ''
 class_definitions = ''
@@ -275,8 +284,8 @@ def generate_rrparam(fileprefix, basemtime):
 
         # By default, we use OldRdataFactory (see bug #2497). If you
         # want to pick RdataFactory for a particular type, add it to
-        # new_rdatafactory_users.
-        if type_txt in new_rdatafactory_users:
+        # new_rdata_factory_users.
+        if (type_txt.lower(), class_txt.lower()) in new_rdata_factory_users:
             rdf_class = 'RdataFactory'
         else:
             rdf_class = 'OldRdataFactory'