Browse Source

[2559] Added parser to list of DHCP6 parsers

Stephen Morris 12 years ago
parent
commit
c74f64796e
3 changed files with 42 additions and 0 deletions
  1. 3 0
      src/bin/dhcp6/config_parser.cc
  2. 1 0
      src/bin/dhcp6/dbaccess_parser.cc
  3. 38 0
      src/bin/dhcp6/dhcp6.spec

+ 3 - 0
src/bin/dhcp6/config_parser.cc

@@ -17,6 +17,7 @@
 #include <config/ccsession.h>
 #include <dhcp/libdhcp++.h>
 #include <dhcp6/config_parser.h>
+#include <dhcp6/dbaccess_parser.h>
 #include <dhcp6/dhcp6_log.h>
 #include <dhcpsrv/cfgmgr.h>
 #include <dhcpsrv/pool.h>
@@ -1185,6 +1186,8 @@ DhcpConfigParser* createGlobalDhcpConfigParser(const std::string& config_id) {
 
     factories.insert(pair<string, ParserFactory*>(
                          "version", StringParser::Factory));
+    factories.insert(pair<string, ParserFactory*>(
+                         "lease-database", DbAccessParser::factory));
 
     FactoryMap::iterator f = factories.find(config_id);
     if (f == factories.end()) {

+ 1 - 0
src/bin/dhcp6/dbaccess_parser.cc

@@ -86,6 +86,7 @@ DbAccessParser::build(isc::data::ConstElementPtr config_value) {
 // Commit the changes - reopen the database with the new parameters
 void
 DbAccessParser::commit() {
+    std::cout << "DB_ACCESS_PARSER_COMMIT: " << dbaccess_ << "\n";
 }
 
 };  // namespace dhcp

+ 38 - 0
src/bin/dhcp6/dhcp6.spec

@@ -71,6 +71,44 @@
         }
       },
 
+      { "item_name": "lease-database",
+        "item_type": "map",
+        "item_optional": false,
+        "item_default": {"type": "memfile"},
+        "map_item_spec": [
+            {
+                "item_name": "type",
+                "item_type": "string",
+                "item_optional": false,
+                "item_default": ""
+            },
+            {
+                "item_name": "name",
+                "item_type": "string",
+                "item_optional": true,
+                "item_default": ""
+            },
+            {
+                "item_name": "user",
+                "item_type": "string",
+                "item_optional": true,
+                "item_default": ""
+            },
+            {
+                "item_name": "host",
+                "item_type": "string",
+                "item_optional": true,
+                "item_default": ""
+            },
+            {
+                "item_name": "password",
+                "item_type": "string",
+                "item_optional": true,
+                "item_default": ""
+            }
+        ]
+      },
+
       { "item_name": "subnet6",
         "item_type": "list",
         "item_optional": false,