]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1451] add stub DDNSSession object and some spec data
authorJelte Jansen <jelte@isc.org>
Mon, 12 Dec 2011 13:35:14 +0000 (14:35 +0100)
committerJelte Jansen <jelte@isc.org>
Mon, 12 Dec 2011 14:28:42 +0000 (15:28 +0100)
src/bin/ddns/ddns.py.in
src/bin/ddns/ddns.spec.pre.in

index 54f108fce307aa5176886ec7f243dce38af17b3c..152d69f4f851526ac816bf24e977ae73b794df3a 100755 (executable)
@@ -59,6 +59,21 @@ class DDNSSessionError(Exception):
     '''
     pass
 
+class DDNSSession:
+    """Class to handle one DDNS update"""
+    
+    def __init__(self):
+        self._handle()
+
+    def _handle(self):
+        '''
+        Handle a DDNS update.
+        This should be called from the initializer, and should contain the
+        logic for doing the checks, handling the update, and responding with
+        the result.
+        '''
+        pass
+
 class DDNSServer:
     def __init__(self):
         self._cc = isc.config.ModuleCCSession(SPECFILE_LOCATION,
@@ -71,14 +86,8 @@ class DDNSServer:
     def config_handler(self, new_config):
         '''Update config data.'''
         answer = create_answer(0)
-        for key in new_config:
-            if key not in self._config_data:
-                answer = create_answer(1, "Unknown config data: " + str(key))
-                continue
-            self._config_data[key] = new_config[key]
         return answer
 
-
     def command_handler(self, cmd, args):
         if cmd == "shutdown":
             logger.info(DDNS_RECEIVED_SHUTDOWN_COMMAND)
index f45b2f2cc1166039a72a5e567ad582d67c4bfaad..03899e4b3ff16dae3f08b2198ca2fb6cbd884ea3 100644 (file)
@@ -1,15 +1,42 @@
 {
   "module_spec": {
-     "module_name": "DDNS",
-     "config_data": [
-      ],
-      "commands": [
-        {
-          "command_name": "shutdown",
-          "command_description": "Shut down DDNS",
-          "command_args": []
+    "module_name": "DDNS",
+    "config_data": [
+      {
+        "item_name": "zones",
+        "item_type": "named_set",
+        "item_optional": false,
+        "item_default": {},
+        "named_set_item_spec": {
+          "item_name": "entry",
+          "item_type": "map",
+          "item_optional": true,
+          "item_default": {
+            "update_acls": [{"action": "ACCEPT", "from": "127.0.0.1"},
+                            {"action": "ACCEPT", "from": "::1"}]
+          },
+          "map_item_spec": [
+            {
+              "item_name": "update_acls",
+              "item_type": "list",
+              "item_optional": false,
+              "list_item_spec": {
+                "item_name": "acl_element",
+                "item_type": "any",
+                "item_optional": true
+              }
+            }
+          ]
         }
-      ]
+      }
+    ],
+    "commands": [
+      {
+        "command_name": "shutdown",
+        "command_description": "Shut down DDNS",
+        "command_args": []
+      }
+    ]
   }
 }