]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5033] Added exmaple json files with dhcp-ddns, fixed copyrights
authorThomas Markwalder <tmark@isc.org>
Thu, 12 Jan 2017 13:23:21 +0000 (08:23 -0500)
committerThomas Markwalder <tmark@isc.org>
Thu, 12 Jan 2017 13:23:21 +0000 (08:23 -0500)
doc/examples/kea4/with-ddns.json [new file with mode: 0644]
doc/examples/kea6/with-ddns.json [new file with mode: 0644]
src/bin/dhcp4/simple_parser4.cc
src/bin/dhcp4/simple_parser4.h
src/bin/dhcp4/tests/parser_unittest.cc
src/bin/dhcp6/simple_parser6.cc
src/bin/dhcp6/simple_parser6.h
src/bin/dhcp6/tests/parser_unittest.cc
src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
src/lib/dhcpsrv/tests/srv_config_unittest.cc

diff --git a/doc/examples/kea4/with-ddns.json b/doc/examples/kea4/with-ddns.json
new file mode 100644 (file)
index 0000000..ab6fc8c
--- /dev/null
@@ -0,0 +1,77 @@
+# This is an example configuration file for the DHCPv4 server in Kea.
+# It is a basic scenario with one IPv4 subnet configured but with DDNS
+# enabled. 
+
+{ "Dhcp4":
+
+{
+# Kea is told to listen on ethX interface only.
+  "interfaces-config": {
+    "interfaces": [ "ethX" ]
+  },
+
+# We need to specify the the database used to store leases. As of
+# September 2016, four database backends are supported: MySQL,
+# PostgreSQL, Cassandra, and the in-memory database, Memfile.
+# We'll use memfile  because it doesn't require any prior set up.
+  "lease-database": {
+      "type": "memfile",
+      "lfc-interval": 3600
+  },
+
+# Addresses will be assigned with a lifetime of 4000 seconds.
+  "valid-lifetime": 4000,
+
+# Renew and rebind timers are commented out. This implies that options
+# 58 and 59 will not be sent to the client. In this case it is up to
+# the client to pick the timer values according to RFC2131. Uncomment the
+# timers to send these options to the client.
+#  "renew-timer": 1000,
+#  "rebind-timer": 2000,
+
+# The following list defines subnets. We have only one subnet
+# here. We tell Kea that it is directly available over local interface.
+  "subnet4": [
+    {
+       "pools": [ { "pool":  "192.0.2.1 - 192.0.2.200" } ],
+       "subnet": "192.0.2.0/24",
+       "interface": "ethX"
+    }
+  ],
+
+# Enable dynamic DNS updates
+  "dhcp-ddns" : {
+        "enable-updates" : true,
+        "server-ip" : "192.0.2.0",
+        "server-port" : 3432,
+        "sender-ip" : "192.0.2.1",
+        "sender-port" : 3433,
+        "max-queue-size" : 2048,
+        "ncr-protocol" : "UDP",
+        "ncr-format" : "JSON",
+        "always-include-fqdn" : true,
+        "override-no-update" : true,
+        "override-client-update" : true,
+        "replace-client-name" : "when-present",
+        "generated-prefix" : "test.prefix",
+        "qualifying-suffix" : "test.suffix."
+    }
+},
+
+# The following configures logging. It assumes that messages with at least
+# informational level (info, warn, error and fatal) should be logged to stdout.
+"Logging": {
+    "loggers": [
+        {
+            "name": "kea-dhcp4",
+            "output_options": [
+                {
+                    "output": "stdout"
+                }
+            ],
+            "severity": "INFO"
+        }
+    ]
+}
+
+}
diff --git a/doc/examples/kea6/with-ddns.json b/doc/examples/kea6/with-ddns.json
new file mode 100644 (file)
index 0000000..5bb53cb
--- /dev/null
@@ -0,0 +1,81 @@
+# This is an example configuration file for DHCPv6 server in Kea.
+# It's a basic scenario with one IPv6 subnet configured. It is
+# assumed that one subnet (2001:db8:1::/64 is available directly
+# over ethX interface.
+
+{ "Dhcp6":
+
+{
+# Kea is told to listen on ethX interface only.
+  "interfaces-config": {
+    "interfaces": [ "ethX" ]
+  },
+
+# We need to specify the the database used to store leases. As of
+# September 2016, four database backends are supported: MySQL,
+# PostgreSQL, Cassandra, and the in-memory database, Memfile.
+# We'll use memfile  because it doesn't require any prior set up.
+  "lease-database": {
+      "type": "memfile",
+      "lfc-interval": 3600
+  },
+
+# Addresses will be assigned with preferred and valid lifetimes
+# being 3000 and 4000, respectively. Client is told to start
+# renewing after 1000 seconds. If the server does not respond
+# after 2000 seconds since the lease was granted, client is supposed
+# to start REBIND procedure (emergency renewal that allows switching
+# to a different server).
+  "preferred-lifetime": 3000,
+  "valid-lifetime": 4000,
+  "renew-timer": 1000,
+  "rebind-timer": 2000,
+
+# The following list defines subnets. Each subnet consists of at
+# least subnet and pool entries.
+  "subnet6": [
+    {
+      "pools": [ { "pool": "2001:db8:1::/80" } ],
+      "subnet": "2001:db8:1::/64",
+      "interface": "ethX"
+    }
+  ]
+
+  "dhcp-ddns" : {
+        "enable-updates" : true,
+        "server-ip" : "3001::1",
+        "server-port" : 3432,
+        "sender-ip" : "3001::2",
+        "sender-port" : 3433,
+        "max-queue-size" : 2048,
+        "ncr-protocol" : "UDP",
+        "ncr-format" : "JSON",
+        "always-include-fqdn" : true,
+        "override-no-update" : true,
+        "override-client-update" : true,
+        "replace-client-name" : "when-present",
+        "generated-prefix" : "test.prefix",
+        "qualifying-suffix" : "test.suffix."
+  },
+
+},
+
+# The following configures logging. It assumes that messages with at least
+# informational level (info, warn, error and fatal) should be logged to stdout.
+"Logging": {
+    "loggers": [
+        {
+            "name": "kea-dhcp6",
+            "output_options": [
+                {
+                    "output": "stdout"
+                }
+            ],
+            "debuglevel": 0,
+            "severity": "INFO"
+        }
+    ]
+}
+
+}
+
index 29317d03d7fd8b36c51047e854fe966a023a264c..ce80900f0bfd74056ba994331efc1c5d3bbcf24d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
index 3feea2f667c0e55074c12dba7283d7dc600c3cb1..abc842b108784e4f4748eaa48a4480274df0dd31 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
index d39652e9fdaefcd0417e35a2ddf859dfeda1ee20..0dcab6a75ea6b4a58622904a3810676724863594 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -322,7 +322,8 @@ TEST(ParserTest, file) {
                                "pgsql-reservations.json",
                                "reservations.json",
                                "several-subnets.json",
-                               "single-subnet.json" };
+                               "single-subnet.json",
+                               "with-ddns.json" };
 
     for (int i = 0; i<configs.size(); i++) {
         testFile(string(CFG_EXAMPLES) + "/" + configs[i]);
index f2cba8deef2b81c3014547b28c03bcc3e6898b16..48c5573afee3dcf5cc64b595c7663dcf048f3720 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
index 0fa456c6595aac5e73d9f23341690e3fb94ffdd5..931079f0253c11d21b58fe0934f4e61fda91a03e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
index 75bc5fdbd3af9080305cb1ef5d7618bf9c8dff25..d8faa8c0078078d6d1a1aec2255aa3fd35b1ee65 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -241,6 +241,7 @@ TEST(ParserTest, file) {
     configs.push_back("several-subnets.json");
     configs.push_back("simple.json");
     configs.push_back("stateless.json");
+    configs.push_back("with-ddns.json");
 
     for (int i = 0; i<configs.size(); i++) {
         testFile(string(CFG_EXAMPLES) + "/" + configs[i], false);
index 7681be15059b8c3804347a8ae10ad278567f24bb..c458d83d3575becc6bba8fe0cd9e98769392ae60 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
index 85533d97f6125ff9b3086068837ee5b27ba8058d..6ddc6b4e0f70acc9896779be1b0c4f75344a828c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this