Browse Source

[master] Replaced underscores with hyphens in D2 config and NCRs

    Merged in branch 'trac4202'
Thomas Markwalder 9 years ago
parent
commit
91bf527662

+ 17 - 17
doc/examples/ddns/sample1.json

@@ -14,9 +14,9 @@
 #   on port 53001.  Maximum time to we will  wait for a DNS server to
 #   respond to us is 1000 ms.
 
-    "ip_address": "172.16.1.10",
+    "ip-address": "172.16.1.10",
     "port": 53001,
-    "dns_server_timeout" : 1000,
+    "dns-server-timeout" : 1000,
 
 #
 # ----------------- Forward DDNS  ------------------
@@ -30,18 +30,18 @@
 #      It does not use TSIG.
 #      It is server by one DNS server at "2001:db8:1::10" on port 7802
 
-    "forward_ddns":
+    "forward-ddns":
     {
-        "ddns_domains":
+        "ddns-domains":
         [
 #           DdnsDomain for zone "four.example.com."
             {
                 "name": "four.example.com.",
-                "key_name": "d2.md5.key",
-                "dns_servers":
+                "key-name": "d2.md5.key",
+                "dns-servers":
                 [
                     {
-                        "ip_address": "172.16.1.1"
+                        "ip-address": "172.16.1.1"
                     }
                 ]
             },
@@ -49,10 +49,10 @@
 #           DdnsDomain for zone "six.example.com."
             {
                 "name": "six.example.com.",
-                "dns_servers":
+                "dns-servers":
                 [
                     {
-                        "ip_address": "2001:db8:1::10",
+                        "ip-address": "2001:db8:1::10",
                         "port": 7802
                     }
                 ]
@@ -67,21 +67,21 @@
 # uses TSIG with key "d2.sha1.key" and is served by two DNS servers:
 # one listening at "172.16.1.1" on 53001 and the other at "192.168.2.10".
 #
-    "reverse_ddns":
+    "reverse-ddns":
     {
-        "ddns_domains":
+        "ddns-domains":
         [
             {
                 "name": "2.0.192.in-addr.arpa.",
-                "key_name": "d2.sha1.key",
-                "dns_servers":
+                "key-name": "d2.sha1.key",
+                "dns-servers":
                 [
                     {
-                        "ip_address": "172.16.1.1",
+                        "ip-address": "172.16.1.1",
                         "port": 53001
                     },
                     {
-                        "ip_address": "192.168.2.10"
+                        "ip-address": "192.168.2.10"
                     }
                 ]
             }
@@ -94,7 +94,7 @@
 #   Each key has a name, an algorithm (HMAC-MD5, HMAC-SHA1, HMAC-SHA224...)
 #   and a base-64 encoded shared secret.
 #
-    "tsig_keys":
+    "tsig-keys":
     [
         {
             "name": "d2.md5.key",
@@ -109,7 +109,7 @@
         {
             "name": "d2.sha512.key",
             "algorithm": "HMAC-SHA512",
-            "digest_bits": 256,
+            "digest-bits": 256,
             "secret": "/4wklkm04jeH4anx2MKGJLcya+ZLHldL5d6mK+4q6UXQP7KJ9mS2QG29hh0SJR4LA0ikxNJTUMvir42gLx6fGQ=="
         }
     ]

+ 16 - 16
doc/examples/ddns/template.json

@@ -14,26 +14,26 @@
 #    All of the global parameters have default values as shown.  If these
 #    are satisfactory you may omit them.
 #
-#    "ip_address" : "127.0.0.1",
+#    "ip-address" : "127.0.0.1",
 #    "port" : 53001,
-#    "dns_server_timeout" : 100,
-#    "ncr_protocol" : "UDP"
-#    "ncr_format" : "JSON"
+#    "dns-server-timeout" : 100,
+#    "ncr-protocol" : "UDP"
+#    "ncr-format" : "JSON"
 
 #
 # ----------------- Forward DDNS  ------------------
 #
-    "forward_ddns" :
+    "forward-ddns" :
     {
-        "ddns_domains" :
+        "ddns-domains" :
         [
             {
                 "name" : "<zone name 1>",
-#                "key_name" : "<key name>",
-                "dns_servers" :
+#                "key-name" : "<key name>",
+                "dns-servers" :
                 [
                     {
-                        "ip_address" : "<ip address>"
+                        "ip-address" : "<ip address>"
 #                       ,"port" : 53
                     }
 #                   ,
@@ -54,17 +54,17 @@
 #
 # ----------------- Reverse DDNS  ------------------
 #
-    "reverse_ddns" :
+    "reverse-ddns" :
     {
-        "ddns_domains" :
+        "ddns-domains" :
         [
             {
                 "name" : "<reverse zone name 1>",
-#                "key_name" : "<key name>",
-                "dns_servers" :
+#                "key-name" : "<key name>",
+                "dns-servers" :
                 [
                     {
-                        "ip_address" : "<ip address>"
+                        "ip-address" : "<ip address>"
 #                        ,"port" : 53
                     }
 #                   ,
@@ -84,7 +84,7 @@
 #
 # ------------------ TSIG keys ---------------------
 #
-    "tsig_keys" :
+    "tsig-keys" :
     [
         {
             "name" : "<key name>",
@@ -92,7 +92,7 @@
 #            Valid values for algorithm are:    HMAC-MD5, HMAC-SHA1,
 #                                               HMAC-SHA224, HMAC-SHA256,
 #                                               HMAC-SHA384, HMAC-SHA512
-#           "digest_bits" : 256,
+#           "digest-bits" : 256,
 #           Minimum truncated length in bits.
 #           Default 0 (means truncation is forbidden).
             "secret" : "<shared secret value>"

+ 73 - 73
doc/guide/ddns.xml

@@ -166,17 +166,17 @@ strings <userinput>path</userinput>/kea-dhcp-ddns | sed -n 's/;;;; //p'
 	configuration is a template that can be customised to your requirements.
 <screen>
 <userinput>"DhcpDdns": {
-    "ip_address": "127.0.0.1",
+    "ip-address": "127.0.0.1",
     "port": 53001,
-    "dns_server_timeout": 100,
-    "ncr_protocol": "UDP",
-    "ncr_format": "JSON",
-    "tsig_keys": [ ],
-    "forward_ddns": {
-	"ddns_domains": [ ]
+    "dns-server-timeout": 100,
+    "ncr-protocol": "UDP",
+    "ncr-format": "JSON",
+    "tsig-keys": [ ],
+    "forward-ddns": {
+	"ddns-domains": [ ]
     },
-    "reverse_ddns": {
-	"ddns_domains": [ ]
+    "reverse-ddns": {
+	"ddns-domains": [ ]
     }
 }</userinput>
 </screen>
@@ -216,7 +216,7 @@ strings <userinput>path</userinput>/kea-dhcp-ddns | sed -n 's/;;;; //p'
       <itemizedlist>
 
       <listitem><simpara>
-      <command>ip_address</command> - IP address on which D2
+      <command>ip-address</command> - IP address on which D2
       listens for requests. The default is the local loopback interface at
       address 127.0.0.1. You may specify either an IPv4 or IPv6 address.
       </simpara></listitem>
@@ -227,19 +227,19 @@ strings <userinput>path</userinput>/kea-dhcp-ddns | sed -n 's/;;;; //p'
       </simpara></listitem>
 
       <listitem><simpara>
-      <command>dns_server_timeout</command> - The maximum amount
+      <command>dns-server-timeout</command> - The maximum amount
       of time in milliseconds, that D2 will wait for a response from a
       DNS server to a single DNS update message.
       </simpara></listitem>
 
       <listitem><simpara>
-      <command>ncr_protocol</command> - Socket protocol to use when sending requests to D2.
+      <command>ncr-protocol</command> - Socket protocol to use when sending requests to D2.
       Currently only UDP is supported.  TCP may be available in an upcoming
       release.
       </simpara></listitem>
 
       <listitem><simpara>
-      <command>ncr_format</command> - Packet format to use when sending requests to D2.
+      <command>ncr-format</command> - Packet format to use when sending requests to D2.
       Currently only JSON format is supported.  Other formats may be available
       in future releases.
       </simpara></listitem>
@@ -252,7 +252,7 @@ strings <userinput>path</userinput>/kea-dhcp-ddns | sed -n 's/;;;; //p'
 	at 192.168.1.10 port 900:
 <screen>
 "DhcpDdns": {
-    <userinput>"ip_address": "192.168.1.10",
+    <userinput>"ip-address": "192.168.1.10",
     "port": 900,</userinput>
     ...
     }
@@ -272,7 +272,7 @@ strings <userinput>path</userinput>/kea-dhcp-ddns | sed -n 's/;;;; //p'
 	</warning>
 <note>
 <simpara>
-If the ip_address and port are changed, it will be necessary to change the
+If the ip-address and port are changed, it will be necessary to change the
 corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 </simpara>
 </note>
@@ -298,7 +298,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	corresponding TSIG key in the TSIG Key list.</para>
 
 	<para>
-	As one might gather from the name, the tsig_key section of the
+	As one might gather from the name, the tsig-key section of the
 	D2 configuration lists the TSIG keys.  Each entry describes a
 	TSIG key used by one or more DNS servers to authenticate requests
 	and sign responses.  Every entry in the list has three parameters:
@@ -345,7 +345,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	  </listitem>
 	  <listitem>
 	    <simpara>
-	      <command>digest_bits</command> -
+	      <command>digest-bits</command> -
 	      is used to specify the minimum truncated length in bits.
 	      The default value 0 means truncation is forbidden, not 0
 	      values must be an integral number of octets, be greater
@@ -380,7 +380,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	By default, the TSIG Key list is empty:
 <screen>
 "DhcpDdns": {
-   <userinput>"tsig_keys": [ ]</userinput>,
+   <userinput>"tsig-keys": [ ]</userinput>,
    ...
 }
 </screen>
@@ -388,7 +388,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	We must extend the list with a new key:
 <screen>
 "DhcpDdns": {
-    "tsig_keys": [
+    "tsig-keys": [
     <userinput>    {
 	    "name": "key.four.example.com.",
 	    "algorithm": "HMAC-SHA224",
@@ -413,8 +413,8 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	forward DDNS Domains, which is a list of structures.
 <screen>
 "DhcpDdns": {
-    <userinput>"forward_ddns": {
-	"ddns_domains": [ ]
+    <userinput>"forward-ddns": {
+	"ddns-domains": [ ]
     }</userinput>,
     ...
 }
@@ -451,7 +451,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	    </listitem>
 	    <listitem>
 	      <simpara>
-	      <command>key_name</command> -
+	      <command>key-name</command> -
 	      If TSIG is used with this domain's servers, this
 	      value should be the name of the key from within the TSIG Key List
 	      to use.  If the value is blank (the default), TSIG will not be
@@ -460,7 +460,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	    </listitem>
 	    <listitem>
 	      <simpara>
-	      <command>dns_servers</command> -
+	      <command>dns-servers</command> -
 	      A list of one or more DNS servers which can conduct the server
 	      side of the DDNS protocol for this domain.  The servers
 	      are used in a first to last preference. In other words, when D2
@@ -475,12 +475,12 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	element and set its parameters:
 <screen>
 "DhcpDdns": {
-    "forward_ddns": {
-	"ddns_domains": [
+    "forward-ddns": {
+	"ddns-domains": [
 	    <userinput>{
 		"name": "other.example.com.",
-		"key_name": "",
-		"dns_servers": [
+		"key-name": "",
+		"dns-servers": [
 		]
 	    }</userinput>
 	]
@@ -514,7 +514,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	    </listitem>
 	    <listitem>
 	      <simpara>
-	      <command>ip_address</command> -
+	      <command>ip-address</command> -
 	      The IP address at which the server listens for DDNS requests.
 	      This may be either an IPv4 or an IPv6 address.
 	      </simpara>
@@ -533,15 +533,15 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	follows:
 <screen>
 "DhcpDdns": {
-    "forward_ddns": {
-	"ddns_domains": [
+    "forward-ddns": {
+	"ddns-domains": [
 	    {
 		"name": "other.example.com.",
-		"key_name": "",
-		"dns_servers": [
+		"key-name": "",
+		"dns-servers": [
 		    <userinput>{
 			"hostname": "",
-			"ip_address": "172.88.99.10",
+			"ip-address": "172.88.99.10",
 			"port": 53
 		    }</userinput>
 		]
@@ -554,7 +554,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 
     <note><simpara>
 	As stated earlier, "hostname" is not yet supported so, the parameter
-	"ip_address" must be set to the address of the DNS server.
+	"ip-address" must be set to the address of the DNS server.
     </simpara></note>
 
 	</section> <!-- "add-forward-dns-servers" -->
@@ -572,8 +572,8 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	reverse DDNS Domains, which is a list of structures.
 <screen>
 "DhcpDdns": {
-    <userinput>"reverse_ddns": {
-	"ddns_domains": [ ]
+    <userinput>"reverse-ddns": {
+	"ddns-domains": [ ]
     }</userinput>
     ...
 }
@@ -615,7 +615,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	    </listitem>
 	    <listitem>
 	      <simpara>
-	      <command>key_name</command> -
+	      <command>key-name</command> -
 	      If TSIG should be used with this domain's servers, then this
 	      value should be the name of that key from the TSIG Key List.
 	      If the value is blank (the default), TSIG will not be
@@ -625,7 +625,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	    </listitem>
 	    <listitem>
 	      <simpara>
-	      <command>dns_servers</command> -
+	      <command>dns-servers</command> -
 	      a list of one or more DNS servers which can conduct the server
 	      side of the DDNS protocol for this domain.  Currently the servers
 	      are used in a first to last preference. In other words, when D2
@@ -641,12 +641,12 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	the following configuration could be used:
 <screen>
 "DhcpDdns": {
-    "reverse_ddns": {
-	"ddns_domains": [
+    "reverse-ddns": {
+	"ddns-domains": [
 	    <userinput>{
 		"name": "1.0.0.0.8.B.D.0.1.0.0.2.ip6.arpa.",
-		"key_name": "",
-		"dns_servers": [
+		"key-name": "",
+		"dns-servers": [
 		]
 	    }</userinput>
 	]
@@ -680,7 +680,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	    </listitem>
 	    <listitem>
 	      <simpara>
-	      <command>ip_address</command> -
+	      <command>ip-address</command> -
 	      The IP address at which the server listens for DDNS requests.
 	      </simpara>
 	    </listitem>
@@ -698,15 +698,15 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	follows:
 <screen>
 "DhcpDdns": {
-    "reverse_ddns": {
-	"ddns_domains": [
+    "reverse-ddns": {
+	"ddns-domains": [
 	    {
 		"name": "1.0.0.0.8.B.D.0.1.0.0.2.ip6.arpa.",
-		"key_name": "",
-		"dns_servers": [
+		"key-name": "",
+		"dns-servers": [
 		    <userinput>{
 			"hostname": "",
-			"ip_address": "172.88.99.10",
+			"ip-address": "172.88.99.10",
 			"port": 53
 		    }</userinput>
 		]
@@ -720,7 +720,7 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
     <note>
     <simpara>
     As stated earlier, "hostname" is not yet supported so, the parameter
-    "ip_address" must be set to the address of the DNS server.
+    "ip-address" must be set to the address of the DNS server.
     </simpara>
     </note>
 
@@ -820,28 +820,28 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 	The following example configuration specified the Forward DDNS Domains.
 <screen><userinput>
 "DhcpDdns": {
-    "forward_ddns": {
-	"ddns_domains": [
+    "forward-ddns": {
+	"ddns-domains": [
 	    {
 		"name": "four.example.com.",
-		"key_name": "",
-		"dns_servers": [
-		    { "ip_address": "172.16.1.5" },
-		    { "ip_address": "172.16.2.5" }
+		"key-name": "",
+		"dns-servers": [
+		    { "ip-address": "172.16.1.5" },
+		    { "ip-address": "172.16.2.5" }
 		]
 	    },
 	    {
 		"name": "six.example.com.",
-		"key_name": "",
-		"dns_servers": [
-		    { "ip_address": "2001:db8::1" }
+		"key-name": "",
+		"dns-servers": [
+		    { "ip-address": "2001:db8::1" }
 		]
 	    },
 	    {
 		"name": "example.com.",
-		"key_name": "",
-		"dns_servers": [
-		    { "ip_address": "172.16.2.5" }
+		"key-name": "",
+		"dns-servers": [
+		    { "ip-address": "172.16.2.5" }
 		]
 	    },
 
@@ -894,28 +894,28 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 
 <screen><userinput>
 "DhcpDdns": {
-    "reverse_ddns": {
-	"ddns_domains": [
+    "reverse-ddns": {
+	"ddns-domains": [
 	    {
 		"name": "2.0.192.in-addr.arpa.",
-		"key_name": "",
-		"dns_servers": [
-		    { "ip_address": "172.16.1.5" },
-		    { "ip_address": "172.16.2.5" }
+		"key-name": "",
+		"dns-servers": [
+		    { "ip-address": "172.16.1.5" },
+		    { "ip-address": "172.16.2.5" }
 		]
 	    }
 	    {
 		"name": "1.0.0.0.8.B.D.0.1.0.0.2.ip6.arpa.",
-		"key_name": "",
-		"dns_servers": [
-		    { "ip_address": "2001:db8::1" }
+		"key-name": "",
+		"dns-servers": [
+		    { "ip-address": "2001:db8::1" }
 		]
 	    }
 	    {
 		"name": "0.192.in-addr.arpa.",
-		"key_name": "",
-		"dns_servers": [
-		    { "ip_address": "172.16.2.5" }
+		"key-name": "",
+		"dns-servers": [
+		    { "ip-address": "172.16.2.5" }
 		]
 	    }
 	]

+ 29 - 29
src/bin/d2/d2_cfg_mgr.cc

@@ -33,8 +33,8 @@ typedef std::vector<uint8_t> ByteAddress;
 
 D2CfgContext::D2CfgContext()
     : d2_params_(new D2Params()),
-      forward_mgr_(new DdnsDomainListMgr("forward_mgr")),
-      reverse_mgr_(new DdnsDomainListMgr("reverse_mgr")),
+      forward_mgr_(new DdnsDomainListMgr("forward-ddns")),
+      reverse_mgr_(new DdnsDomainListMgr("reverse-ddns")),
       keys_(new TSIGKeyInfoMap()) {
 }
 
@@ -65,9 +65,9 @@ const char* D2CfgMgr::IPV6_REV_ZONE_SUFFIX = "ip6.arpa.";
 D2CfgMgr::D2CfgMgr() : DCfgMgrBase(DCfgContextBasePtr(new D2CfgContext())) {
     // TSIG keys need to parse before the Domains, so we can catch Domains
     // that specify undefined keys. Create the necessary parsing order now.
-    addToParseOrder("tsig_keys");
-    addToParseOrder("forward_ddns");
-    addToParseOrder("reverse_ddns");
+    addToParseOrder("tsig-keys");
+    addToParseOrder("forward-ddns");
+    addToParseOrder("reverse-ddns");
 }
 
 D2CfgMgr::~D2CfgMgr() {
@@ -218,7 +218,7 @@ D2CfgMgr::buildParams(isc::data::ConstElementPtr params_config) {
     isc::dhcp::StringStoragePtr strings = context->getStringStorage();
     asiolink::IOAddress ip_address(D2Params::DFT_IP_ADDRESS);
 
-    std::string ip_address_str = strings->getOptionalParam("ip_address",
+    std::string ip_address_str = strings->getOptionalParam("ip-address",
                                                             D2Params::
                                                             DFT_IP_ADDRESS);
     try {
@@ -226,12 +226,12 @@ D2CfgMgr::buildParams(isc::data::ConstElementPtr params_config) {
     } catch (const std::exception& ex) {
         isc_throw(D2CfgError, "IP address invalid : \""
                   << ip_address_str << "\" ("
-                  << strings->getPosition("ip_address") << ")");
+                  << strings->getPosition("ip-address") << ")");
     }
 
     if ((ip_address.toText() == "0.0.0.0") || (ip_address.toText() == "::")) {
         isc_throw(D2CfgError, "IP address cannot be \"" << ip_address << "\" ("
-                   << strings->getPosition("ip_address") << ")");
+                   << strings->getPosition("ip-address") << ")");
     }
 
     // Fetch and validate port.
@@ -245,12 +245,12 @@ D2CfgMgr::buildParams(isc::data::ConstElementPtr params_config) {
 
     // Fetch and validate dns_server_timeout.
     uint32_t dns_server_timeout
-        = ints->getOptionalParam("dns_server_timeout",
+        = ints->getOptionalParam("dns-server-timeout",
                                  D2Params::DFT_DNS_SERVER_TIMEOUT);
 
     if (dns_server_timeout < 1) {
         isc_throw(D2CfgError, "DNS server timeout must be larger than 0 ("
-                  << ints->getPosition("dns_server_timeout") << ")");
+                  << ints->getPosition("dns-server-timeout") << ")");
     }
 
     // Fetch and validate ncr_protocol.
@@ -258,20 +258,20 @@ D2CfgMgr::buildParams(isc::data::ConstElementPtr params_config) {
     try {
         ncr_protocol = dhcp_ddns::
                        stringToNcrProtocol(strings->
-                                           getOptionalParam("ncr_protocol",
+                                           getOptionalParam("ncr-protocol",
                                                             D2Params::
                                                             DFT_NCR_PROTOCOL));
     } catch (const std::exception& ex) {
-        isc_throw(D2CfgError, "ncr_protocol : "
+        isc_throw(D2CfgError, "ncr-protocol : "
                   << ex.what() << " ("
-                  << strings->getPosition("ncr_protocol") << ")");
+                  << strings->getPosition("ncr-protocol") << ")");
     }
 
     if (ncr_protocol != dhcp_ddns::NCR_UDP) {
-        isc_throw(D2CfgError, "ncr_protocol : "
+        isc_throw(D2CfgError, "ncr-protocol : "
                   << dhcp_ddns::ncrProtocolToString(ncr_protocol)
                   << " is not yet supported ("
-                  << strings->getPosition("ncr_protocol") << ")");
+                  << strings->getPosition("ncr-protocol") << ")");
     }
 
     // Fetch and validate ncr_format.
@@ -279,20 +279,20 @@ D2CfgMgr::buildParams(isc::data::ConstElementPtr params_config) {
     try {
         ncr_format = dhcp_ddns::
                      stringToNcrFormat(strings->
-                                       getOptionalParam("ncr_format",
+                                       getOptionalParam("ncr-format",
                                                         D2Params::
                                                         DFT_NCR_FORMAT));
     } catch (const std::exception& ex) {
-        isc_throw(D2CfgError, "ncr_format : "
+        isc_throw(D2CfgError, "ncr-format : "
                   << ex.what() << " ("
-                  << strings->getPosition("ncr_format") << ")");
+                  << strings->getPosition("ncr-format") << ")");
     }
 
     if (ncr_format != dhcp_ddns::FMT_JSON) {
         isc_throw(D2CfgError, "NCR Format:"
                   << dhcp_ddns::ncrFormatToString(ncr_format)
                   << " is not yet supported ("
-                  << strings->getPosition("ncr_format") << ")");
+                  << strings->getPosition("ncr-format") << ")");
     }
 
     // Attempt to create the new client config. This ought to fly as
@@ -312,24 +312,24 @@ D2CfgMgr::createConfigParser(const std::string& config_id,
     // Create parser instance based on element_id.
     isc::dhcp::ParserPtr parser;
     if ((config_id.compare("port") == 0) ||
-        (config_id.compare("dns_server_timeout") == 0)) {
+        (config_id.compare("dns-server-timeout") == 0)) {
         parser.reset(new isc::dhcp::Uint32Parser(config_id,
                                                  context->getUint32Storage()));
-    } else if ((config_id.compare("ip_address") == 0) ||
-        (config_id.compare("ncr_protocol") == 0) ||
-        (config_id.compare("ncr_format") == 0)) {
+    } else if ((config_id.compare("ip-address") == 0) ||
+        (config_id.compare("ncr-protocol") == 0) ||
+        (config_id.compare("ncr-format") == 0)) {
         parser.reset(new isc::dhcp::StringParser(config_id,
                                                  context->getStringStorage()));
-    } else if (config_id ==  "forward_ddns") {
-        parser.reset(new DdnsDomainListMgrParser("forward_mgr",
+    } else if (config_id ==  "forward-ddns") {
+        parser.reset(new DdnsDomainListMgrParser("forward-ddns",
                                                  context->getForwardMgr(),
                                                  context->getKeys()));
-    } else if (config_id ==  "reverse_ddns") {
-        parser.reset(new DdnsDomainListMgrParser("reverse_mgr",
+    } else if (config_id ==  "reverse-ddns") {
+        parser.reset(new DdnsDomainListMgrParser("reverse-ddns",
                                                  context->getReverseMgr(),
                                                  context->getKeys()));
-    } else if (config_id ==  "tsig_keys") {
-        parser.reset(new TSIGKeyInfoListParser("tsig_key_list",
+    } else if (config_id ==  "tsig-keys") {
+        parser.reset(new TSIGKeyInfoListParser("tsig-key-list",
                                                context->getKeys()));
     } else {
         isc_throw(NotImplemented,

+ 20 - 20
src/bin/d2/d2_config.cc

@@ -118,12 +118,12 @@ std::string
 D2Params::toText() const {
     std::ostringstream stream;
 
-    stream << ", ip_address: " << ip_address_.toText()
+    stream << ", ip-address: " << ip_address_.toText()
            << ", port: " << port_
-           << ", dns_server_timeout_: " << dns_server_timeout_
-           << ", ncr_protocol: "
+           << ", dns-server-timeout_: " << dns_server_timeout_
+           << ", ncr-protocol: "
            << dhcp_ddns::ncrProtocolToString(ncr_protocol_)
-           << ", ncr_format: " << ncr_format_
+           << ", ncr-format: " << ncr_format_
            << dhcp_ddns::ncrFormatToString(ncr_format_);
 
     return (stream.str());
@@ -382,7 +382,7 @@ TSIGKeyInfoParser::build(isc::data::ConstElementPtr key_config) {
     try {
         pos["name"] = local_scalars_.getParam("name", name);
         pos["algorithm"] = local_scalars_.getParam("algorithm", algorithm);
-        pos["digest_bits"] = local_scalars_.getParam("digest_bits", digestbits,
+        pos["digest-bits"] = local_scalars_.getParam("digest-bits", digestbits,
                                                      DCfgContextBase::OPTIONAL);
         pos["secret"] = local_scalars_.getParam("secret", secret);
     } catch (const std::exception& ex) {
@@ -415,34 +415,34 @@ TSIGKeyInfoParser::build(isc::data::ConstElementPtr key_config) {
     if (digestbits > 0) {
       if ((digestbits % 8) != 0) {
           isc_throw(D2CfgError, "Invalid TSIG key digest_bits specified : " <<
-                                digestbits << " (" << pos["digest_bits"] << ")");
+                                digestbits << " (" << pos["digest-bits"] << ")");
       }
       if (digestbits < 80) {
           isc_throw(D2CfgError, "TSIG key digest_bits too small : " <<
-                                digestbits << " (" << pos["digest_bits"] << ")");
+                                digestbits << " (" << pos["digest-bits"] << ")");
       }
       if (boost::iequals(algorithm, TSIGKeyInfo::HMAC_SHA224_STR)) {
           if (digestbits < 112) {
               isc_throw(D2CfgError, "TSIG key digest_bits too small : " <<
-                                    digestbits << " (" << pos["digest_bits"]
+                                    digestbits << " (" << pos["digest-bits"]
                                     << ")");
           }
       } else if (boost::iequals(algorithm, TSIGKeyInfo::HMAC_SHA256_STR)) {
           if (digestbits < 128) {
               isc_throw(D2CfgError, "TSIG key digest_bits too small : " <<
-                                    digestbits << " (" << pos["digest_bits"]
+                                    digestbits << " (" << pos["digest-bits"]
                                     << ")");
           }
       } else if (boost::iequals(algorithm, TSIGKeyInfo::HMAC_SHA384_STR)) {
           if (digestbits < 192) {
               isc_throw(D2CfgError, "TSIG key digest_bits too small : " <<
-                                    digestbits << " (" << pos["digest_bits"]
+                                    digestbits << " (" << pos["digest-bits"]
                                     << ")");
           }
       } else if (boost::iequals(algorithm, TSIGKeyInfo::HMAC_SHA512_STR)) {
           if (digestbits < 256) {
               isc_throw(D2CfgError, "TSIG key digest_bits too small : " <<
-                                    digestbits << " (" << pos["digest_bits"]
+                                    digestbits << " (" << pos["digest-bits"]
                                     << ")");
           }
       }
@@ -483,7 +483,7 @@ TSIGKeyInfoParser::createConfigParser(const std::string& config_id,
         (config_id == "secret")) {
         parser = new isc::dhcp::StringParser(config_id,
                                              local_scalars_.getStringStorage());
-    } else if (config_id == "digest_bits") {
+    } else if (config_id == "digest-bits") {
         parser = new isc::dhcp::Uint32Parser(config_id,
                                              local_scalars_.getUint32Storage());
     } else {
@@ -588,7 +588,7 @@ DnsServerInfoParser::build(isc::data::ConstElementPtr server_config) {
     // local storage.  They're all optional, so no try-catch here.
     pos["hostname"] = local_scalars_.getParam("hostname", hostname,
                                               DCfgContextBase::OPTIONAL);
-    pos["ip_address"] = local_scalars_.getParam("ip_address", ip_address,
+    pos["ip-address"] = local_scalars_.getParam("ip-address", ip_address,
                                                 DCfgContextBase::OPTIONAL);
     pos["port"] =  local_scalars_.getParam("port", port,
                                            DCfgContextBase::OPTIONAL);
@@ -632,7 +632,7 @@ DnsServerInfoParser::build(isc::data::ConstElementPtr server_config) {
             serverInfo.reset(new DnsServerInfo(hostname, io_addr, port));
         } catch (const isc::asiolink::IOError& ex) {
             isc_throw(D2CfgError, "Dns Server : invalid IP address : "
-                      << ip_address << " (" << pos["ip_address"] << ")");
+                      << ip_address << " (" << pos["ip-address"] << ")");
         }
     }
 
@@ -648,7 +648,7 @@ DnsServerInfoParser::createConfigParser(const std::string& config_id,
     // Based on the configuration id of the element, create the appropriate
     // parser. Scalars are set to use the parser's local scalar storage.
     if ((config_id == "hostname")  ||
-        (config_id == "ip_address")) {
+        (config_id == "ip-address")) {
         parser = new isc::dhcp::StringParser(config_id,
                                              local_scalars_.getStringStorage());
     } else if (config_id == "port") {
@@ -760,7 +760,7 @@ DdnsDomainParser::build(isc::data::ConstElementPtr domain_config) {
     // Any required that are missing will throw.
     try {
         pos["name"] = local_scalars_.getParam("name", name);
-        pos["key_name"] = local_scalars_.getParam("key_name", key_name,
+        pos["key-name"] = local_scalars_.getParam("key-name", key_name,
                                                   DCfgContextBase::OPTIONAL);
     } catch (const std::exception& ex) {
         isc_throw(D2CfgError, "DdnsDomain incomplete : " << ex.what()
@@ -796,7 +796,7 @@ DdnsDomainParser::build(isc::data::ConstElementPtr domain_config) {
         if (!tsig_key_info) {
             isc_throw(D2CfgError, "DdnsDomain : " << name
                       << " specifies an undefined key: " << key_name
-                      << " (" << pos["key_name"] << ")");
+                      << " (" << pos["key-name"] << ")");
         }
     }
 
@@ -814,10 +814,10 @@ DdnsDomainParser::createConfigParser(const std::string& config_id,
     // Based on the configuration id of the element, create the appropriate
     // parser. Scalars are set to use the parser's local scalar storage.
     if ((config_id == "name")  ||
-        (config_id == "key_name")) {
+        (config_id == "key-name")) {
         parser = new isc::dhcp::StringParser(config_id,
                                              local_scalars_.getStringStorage());
-    } else if (config_id == "dns_servers") {
+    } else if (config_id == "dns-servers") {
        // Server list parser is given in our local server storage. It will pass
        // this down to its server parsers and is where they will write their
        // server instances upon commit.
@@ -918,7 +918,7 @@ DdnsDomainListMgrParser::createConfigParser(const std::string& config_id,
                                             const isc::data::Element::
                                             Position& pos) {
     DhcpConfigParser* parser = NULL;
-    if (config_id == "ddns_domains") {
+    if (config_id == "ddns-domains") {
        // Domain list parser is given our local domain storage. It will pass
        // this down to its domain parsers and is where they will write their
        // domain instances upon commit.

+ 39 - 39
src/bin/d2/d2_config.h

@@ -87,9 +87,9 @@ namespace d2 {
 /// @code
 /// {
 ///  "interface" : "eth1" ,
-///  "ip_address" : "192.168.1.33" ,
+///  "ip-address" : "192.168.1.33" ,
 ///  "port" : 88 ,
-///  "tsig_keys":
+///  "tsig-keys":
 //// [
 ///    {
 ///     "name": "d2_key.tmark.org" ,
@@ -97,14 +97,14 @@ namespace d2 {
 ///     "secret": "0123456989"
 ///    }
 ///  ],
-///  "forward_ddns" :
+///  "forward-ddns" :
 ///  {
-///    "ddns_domains":
+///    "ddns-domains":
 ///    [
 ///      {
 ///        "name": "tmark.org." ,
-///        "key_name": "d2_key.tmark.org" ,
-///        "dns_servers" :
+///        "key-name": "d2_key.tmark.org" ,
+///        "dns-servers" :
 ///        [
 ///          { "hostname": "fserver.tmark.org" },
 ///          { "hostname": "f2server.tmark.org" }
@@ -112,24 +112,24 @@ namespace d2 {
 ///      },
 ///      {
 ///        "name": "pub.tmark.org." ,
-///        "key_name": "d2_key.tmark.org" ,
-///        "dns_servers" :
+///        "key-name": "d2_key.tmark.org" ,
+///        "dns-servers" :
 ///        [
 ///          { "hostname": "f3server.tmark.org" }
 ///        ]
 ///      }
 ///    ]
 ///  },
-///  "reverse_ddns" :
+///  "reverse-ddns" :
 ///  {
-///    "ddns_domains":
+///    "ddns-domains":
 ///    [
 ///      {
 ///        "name": " 0.168.192.in.addr.arpa." ,
-///        "key_name": "d2_key.tmark.org" ,
-///        "dns_servers" :
+///        "key-name": "d2_key.tmark.org" ,
+///        "dns-servers" :
 ///        [
-///          { "ip_address": "127.0.0.101" , "port": 100 }
+///          { "ip-address": "127.0.0.101" , "port": 100 }
 ///        ]
 ///      }
 ///    ]
@@ -742,7 +742,7 @@ typedef boost::shared_ptr<DScalarContext> DScalarContextPtr;
 
 /// @brief Parser for  TSIGKeyInfo
 ///
-/// This class parses the configuration element "tsig_key" defined in
+/// This class parses the configuration element "tsig-key" defined in
 /// src/bin/d2/dhcp-ddns.spec and creates an instance of a TSIGKeyInfo.
 class TSIGKeyInfoParser : public  isc::dhcp::DhcpConfigParser {
 public:
@@ -758,16 +758,16 @@ public:
     /// @brief Destructor
     virtual ~TSIGKeyInfoParser();
 
-    /// @brief Performs the actual parsing of the given  "tsig_key" element.
+    /// @brief Performs the actual parsing of the given  "tsig-key" element.
     ///
     /// Parses a configuration for the elements needed to instantiate a
     /// TSIGKeyInfo, validates those entries, creates a TSIGKeyInfo instance
     /// then attempts to add to a list of keys
     ///
-    /// @param key_config is the "tsig_key" configuration to parse
+    /// @param key_config is the "tsig-key" configuration to parse
     virtual void build(isc::data::ConstElementPtr key_config);
 
-    /// @brief Creates a parser for the given "tsig_key" member element id.
+    /// @brief Creates a parser for the given "tsig-key" member element id.
     ///
     /// The key elements currently supported are(see dhcp-ddns.spec):
     ///   1. name
@@ -776,7 +776,7 @@ public:
     ///   4. secret
     ///
     /// @param config_id is the "item_name" for a specific member element of
-    /// the "tsig_key" specification.
+    /// the "tsig-key" specification.
     /// @param pos position within the configuration text (or file) of element
     /// to be parsed.  This is passed for error messaging.
     ///
@@ -811,7 +811,7 @@ private:
 
 /// @brief Parser for a list of TSIGKeyInfos
 ///
-/// This class parses a list of "tsig_key" configuration elements.
+/// This class parses a list of "tsig-key" configuration elements.
 /// (see src/bin/d2/dhcp-ddns.spec). The TSIGKeyInfo instances are added
 /// to the given storage upon commit.
 class TSIGKeyInfoListParser : public isc::dhcp::DhcpConfigParser {
@@ -827,7 +827,7 @@ public:
     /// @brief Destructor
     virtual ~TSIGKeyInfoListParser();
 
-    /// @brief Performs the parsing of the given list "tsig_key" elements.
+    /// @brief Performs the parsing of the given list "tsig-key" elements.
     ///
     /// It iterates over each key entry in the list:
     ///   1. Instantiate a TSIGKeyInfoParser for the entry
@@ -865,7 +865,7 @@ private:
 
 /// @brief Parser for  DnsServerInfo
 ///
-/// This class parses the configuration element "dns_server" defined in
+/// This class parses the configuration element "dns-server" defined in
 /// src/bin/d2/dhcp-ddns.spec and creates an instance of a DnsServerInfo.
 class DnsServerInfoParser : public  isc::dhcp::DhcpConfigParser {
 public:
@@ -882,13 +882,13 @@ public:
     /// @brief Destructor
     virtual ~DnsServerInfoParser();
 
-    /// @brief Performs the actual parsing of the given  "dns_server" element.
+    /// @brief Performs the actual parsing of the given  "dns-server" element.
     ///
     /// Parses a configuration for the elements needed to instantiate a
     /// DnsServerInfo, validates those entries, creates a DnsServerInfo instance
     /// then attempts to add to a list of  servers.
     ///
-    /// @param server_config is the "dns_server" configuration to parse
+    /// @param server_config is the "dns-server" configuration to parse
     ///
     /// @throw D2CfgError if:
     /// -# hostname is not blank, hostname is not yet supported
@@ -896,7 +896,7 @@ public:
     /// -# port is 0
     virtual void build(isc::data::ConstElementPtr server_config);
 
-    /// @brief Creates a parser for the given "dns_server" member element id.
+    /// @brief Creates a parser for the given "dns-server" member element id.
     ///
     /// The server elements currently supported are(see dhcp-ddns.spec):
     ///   1. hostname
@@ -904,7 +904,7 @@ public:
     ///   3. port
     ///
     /// @param config_id is the "item_name" for a specific member element of
-    /// the "dns_server" specification.
+    /// the "dns-server" specification.
     /// @param pos position within the configuration text (or file) of element
     /// to be parsed.  This is passed for error messaging.
     ///
@@ -939,7 +939,7 @@ private:
 
 /// @brief Parser for a list of DnsServerInfos
 ///
-/// This class parses a list of "dns_server" configuration elements.
+/// This class parses a list of "dns-server" configuration elements.
 /// (see src/bin/d2/dhcp-ddns.spec). The DnsServerInfo instances are added
 /// to the given storage upon commit.
 class DnsServerInfoListParser : public isc::dhcp::DhcpConfigParser {
@@ -956,7 +956,7 @@ public:
     /// @brief Destructor
     virtual ~DnsServerInfoListParser();
 
-    /// @brief Performs the actual parsing of the given list "dns_server"
+    /// @brief Performs the actual parsing of the given list "dns-server"
     /// elements.
     /// It iterates over each server entry in the list:
     ///   1. Instantiate a DnsServerInfoParser for the entry
@@ -966,7 +966,7 @@ public:
     /// The net effect is to parse all of the server entries in the list
     /// prepping them for commit.
     ///
-    /// @param server_list_config is the list of "dns_server" elements to parse.
+    /// @param server_list_config is the list of "dns-server" elements to parse.
     virtual void build(isc::data::ConstElementPtr server_list_config);
 
     /// @brief Commits the list of DnsServerInfos
@@ -990,7 +990,7 @@ private:
 
 /// @brief Parser for  DdnsDomain
 ///
-/// This class parses the configuration element "ddns_domain" defined in
+/// This class parses the configuration element "ddns-domain" defined in
 /// src/bin/d2/dhcp-ddns.spec and creates an instance of a DdnsDomain.
 class DdnsDomainParser : public isc::dhcp::DhcpConfigParser {
 public:
@@ -998,7 +998,7 @@ public:
     ///
     /// @param entry_name is an arbitrary label assigned to this configuration
     /// definition. Since domains are specified in a list this value is likely
-    /// be something akin to "forward_ddns:0", set during parsing.
+    /// be something akin to "forward-ddns:0", set during parsing.
     /// @param domains is a pointer to the storage area to which the parser
     /// @param keys is a pointer to a map of the defined TSIG keys.
     /// should commit the newly created DdnsDomain instance.
@@ -1008,16 +1008,16 @@ public:
     /// @brief Destructor
     virtual ~DdnsDomainParser();
 
-    /// @brief Performs the actual parsing of the given  "ddns_domain" element.
+    /// @brief Performs the actual parsing of the given  "ddns-domain" element.
     ///
     /// Parses a configuration for the elements needed to instantiate a
     /// DdnsDomain, validates those entries, creates a DdnsDomain instance
     /// then attempts to add it to a list of domains.
     ///
-    /// @param domain_config is the "ddns_domain" configuration to parse
+    /// @param domain_config is the "ddns-domain" configuration to parse
     virtual void build(isc::data::ConstElementPtr domain_config);
 
-    /// @brief Creates a parser for the given "ddns_domain" member element id.
+    /// @brief Creates a parser for the given "ddns-domain" member element id.
     ///
     /// The domain elements currently supported are(see dhcp-ddns.spec):
     ///   1. name
@@ -1025,7 +1025,7 @@ public:
     ///   3. dns_servers
     ///
     /// @param config_id is the "item_name" for a specific member element of
-    /// the "ddns_domain" specification.
+    /// the "ddns-domain" specification.
     /// @param pos position within the configuration text (or file) of element
     /// to be parsed.  This is passed for error messaging.
     ///
@@ -1071,7 +1071,7 @@ private:
 
 /// @brief Parser for a list of DdnsDomains
 ///
-/// This class parses a list of "ddns_domain" configuration elements.
+/// This class parses a list of "ddns-domain" configuration elements.
 /// (see src/bin/d2/dhcp-ddns.spec). The DdnsDomain instances are added
 /// to the given storage upon commit.
 class DdnsDomainListParser : public isc::dhcp::DhcpConfigParser {
@@ -1089,7 +1089,7 @@ public:
     /// @brief Destructor
     virtual ~DdnsDomainListParser();
 
-    /// @brief Performs the actual parsing of the given list "ddns_domain"
+    /// @brief Performs the actual parsing of the given list "ddns-domain"
     /// elements.
     /// It iterates over each domain entry in the list:
     ///   1. Instantiate a DdnsDomainParser for the entry
@@ -1099,7 +1099,7 @@ public:
     /// The net effect is to parse all of the domain entries in the list
     /// prepping them for commit.
     ///
-    /// @param domain_list_config is the list of "ddns_domain" elements to
+    /// @param domain_list_config is the list of "ddns-domain" elements to
     /// parse.
     virtual void build(isc::data::ConstElementPtr domain_list_config);
 
@@ -1130,8 +1130,8 @@ private:
 
 /// @brief Parser for DdnsDomainListMgr
 ///
-/// This class parses the configuration elements "forward_ddns" and
-/// "reverse_ddns" as defined in src/bin/d2/dhcp-ddns.spec.  It populates the
+/// This class parses the configuration elements "forward-ddns" and
+/// "reverse-ddns" as defined in src/bin/d2/dhcp-ddns.spec.  It populates the
 /// given DdnsDomainListMgr with parsed information upon commit.  Note that
 /// unlike other parsers, this parser does NOT instantiate the final object
 /// during the commit phase, it populates it.  It must pre-exist.

+ 21 - 21
src/bin/d2/dhcp-ddns.spec

@@ -5,7 +5,7 @@
     "module_description": "DHPC-DDNS Service",
     "config_data": [
     { 
-        "item_name": "ip_address",
+        "item_name": "ip-address",
         "item_type": "string",
         "item_optional": false,
         "item_default": "127.0.0.1" 
@@ -17,31 +17,31 @@
         "item_default": 53001 
     },
     {
-        "item_name": "dns_server_timeout",
+        "item_name": "dns-server-timeout",
         "item_type": "integer",
         "item_optional": true,
         "item_default": 100
     },
     {
-        "item_name": "ncr_protocol",
+        "item_name": "ncr-protocol",
         "item_type": "string",
         "item_optional": true,
         "item_default": "UDP"
     },
     {
-        "item_name": "ncr_format",
+        "item_name": "ncr-format",
         "item_type": "string",
         "item_optional": true,
         "item_default": "JSON"
     },
     {
-        "item_name": "tsig_keys",
+        "item_name": "tsig-keys",
         "item_type": "list",
         "item_optional": true, 
         "item_default": [],
         "list_item_spec":
         {
-            "item_name": "tsig_key",
+            "item_name": "tsig-key",
             "item_type": "map",
             "item_optional": false,
             "item_default": {"algorithm" : "HMAC-MD5"},
@@ -59,7 +59,7 @@
                 "item_default": ""
             },
             {
-                "item_name": "digest_bits",
+                "item_name": "digest-bits",
                 "item_type": "integer",
                 "item_optional": true,
                 "item_default": 0
@@ -73,19 +73,19 @@
         }
     },
     {
-        "item_name": "forward_ddns",
+        "item_name": "forward-ddns",
         "item_type": "map",
         "item_optional": true,
          "item_default": {},
          "map_item_spec": [ 
          {
-            "item_name": "ddns_domains",
+            "item_name": "ddns-domains",
             "item_type": "list",
             "item_optional": false, 
             "item_default": [],
             "list_item_spec":
             {
-                "item_name": "ddns_domain",
+                "item_name": "ddns-domain",
                 "item_type": "map",
                 "item_optional": false,
                 "item_default": {},
@@ -98,20 +98,20 @@
                 },
 
                 { 
-                    "item_name": "key_name",
+                    "item_name": "key-name",
                     "item_type": "string",
                     "item_optional": true,
                     "item_default": "" 
                 },
     
                 {
-                    "item_name": "dns_servers",
+                    "item_name": "dns-servers",
                     "item_type": "list",
                     "item_optional": false, 
                     "item_default": [],
                     "list_item_spec":
                     {
-                        "item_name": "dns_server",
+                        "item_name": "dns-server",
                         "item_type": "map",
                         "item_optional": false, 
                         "item_default": {},
@@ -123,7 +123,7 @@
                             "item_default": ""
                         },
                         { 
-                            "item_name": "ip_address",
+                            "item_name": "ip-address",
                             "item_type": "string",
                             "item_optional": true,
                             "item_default": ""
@@ -141,19 +141,19 @@
     },
 
     {
-        "item_name": "reverse_ddns",
+        "item_name": "reverse-ddns",
         "item_type": "map",
         "item_optional": true,
          "item_default": {},
          "map_item_spec": [ 
          { 
-            "item_name": "ddns_domains",
+            "item_name": "ddns-domains",
             "item_type": "list",
             "item_optional": false, 
             "item_default": [],
             "list_item_spec":
             {
-                "item_name": "ddns_domain",
+                "item_name": "ddns-domain",
                 "item_type": "map",
                 "item_optional": false,
                 "item_default": {},
@@ -166,20 +166,20 @@
                 },
 
                 { 
-                    "item_name": "key_name",
+                    "item_name": "key-name",
                     "item_type": "string",
                     "item_optional": true,
                     "item_default": "" 
                 },
     
                 {
-                    "item_name": "dns_servers",
+                    "item_name": "dns-servers",
                     "item_type": "list",
                     "item_optional": false, 
                     "item_default": [],
                     "list_item_spec":
                     {
-                        "item_name": "dns_server",
+                        "item_name": "dns-server",
                         "item_type": "map",
                         "item_optional": false, 
                         "item_default": {},
@@ -191,7 +191,7 @@
                             "item_default": ""
                         },
                         { 
-                            "item_name": "ip_address",
+                            "item_name": "ip-address",
                             "item_type": "string",
                             "item_optional": true,
                             "item_default": ""

+ 188 - 187
src/bin/d2/tests/d2_cfg_mgr_unittests.cc

@@ -89,14 +89,14 @@ public:
         std::ostringstream config;
         config <<
             "{"
-            " \"ip_address\": \"" << ip_address << "\" , "
+            " \"ip-address\": \"" << ip_address << "\" , "
             " \"port\": " << port << " , "
-            " \"dns_server_timeout\": " << dns_server_timeout << " , "
-            " \"ncr_protocol\": \"" << ncr_protocol << "\" , "
-            " \"ncr_format\": \"" << ncr_format << "\", "
-            "\"tsig_keys\": [], "
-            "\"forward_ddns\" : {}, "
-            "\"reverse_ddns\" : {} "
+            " \"dns-server-timeout\": " << dns_server_timeout << " , "
+            " \"ncr-protocol\": \"" << ncr_protocol << "\" , "
+            " \"ncr-format\": \"" << ncr_format << "\", "
+            "\"tsig-keys\": [], "
+            "\"forward-ddns\" : {}, "
+            "\"reverse-ddns\" : {} "
             "}";
 
         return (config.str());
@@ -396,12 +396,12 @@ TEST_F(D2CfgMgrTest, defaultValues) {
     std::string config =
             "{"
             " \"port\": 777 , "
-            " \"dns_server_timeout\": 333 , "
-            " \"ncr_protocol\": \"UDP\" , "
-            " \"ncr_format\": \"JSON\", "
-            "\"tsig_keys\": [], "
-            "\"forward_ddns\" : {}, "
-            "\"reverse_ddns\" : {} "
+            " \"dns-server-timeout\": 333 , "
+            " \"ncr-protocol\": \"UDP\" , "
+            " \"ncr-format\": \"JSON\", "
+            "\"tsig-keys\": [], "
+            "\"forward-ddns\" : {}, "
+            "\"reverse-ddns\" : {} "
             "}";
 
     runConfig(config);
@@ -411,13 +411,13 @@ TEST_F(D2CfgMgrTest, defaultValues) {
     // Check that omitting port gets you its default
     config =
             "{"
-            " \"ip_address\": \"192.0.0.1\" , "
-            " \"dns_server_timeout\": 333 , "
-            " \"ncr_protocol\": \"UDP\" , "
-            " \"ncr_format\": \"JSON\", "
-            "\"tsig_keys\": [], "
-            "\"forward_ddns\" : {}, "
-            "\"reverse_ddns\" : {} "
+            " \"ip-address\": \"192.0.0.1\" , "
+            " \"dns-server-timeout\": 333 , "
+            " \"ncr-protocol\": \"UDP\" , "
+            " \"ncr-format\": \"JSON\", "
+            "\"tsig-keys\": [], "
+            "\"forward-ddns\" : {}, "
+            "\"reverse-ddns\" : {} "
             "}";
 
     runConfig(config);
@@ -426,13 +426,13 @@ TEST_F(D2CfgMgrTest, defaultValues) {
     // Check that omitting timeout gets you its default
     config =
             "{"
-            " \"ip_address\": \"192.0.0.1\" , "
+            " \"ip-address\": \"192.0.0.1\" , "
             " \"port\": 777 , "
-            " \"ncr_protocol\": \"UDP\" , "
-            " \"ncr_format\": \"JSON\", "
-            "\"tsig_keys\": [], "
-            "\"forward_ddns\" : {}, "
-            "\"reverse_ddns\" : {} "
+            " \"ncr-protocol\": \"UDP\" , "
+            " \"ncr-format\": \"JSON\", "
+            "\"tsig-keys\": [], "
+            "\"forward-ddns\" : {}, "
+            "\"reverse-ddns\" : {} "
             "}";
 
     runConfig(config);
@@ -442,13 +442,13 @@ TEST_F(D2CfgMgrTest, defaultValues) {
     // Check that protocol timeout gets you its default
     config =
             "{"
-            " \"ip_address\": \"192.0.0.1\" , "
+            " \"ip-address\": \"192.0.0.1\" , "
             " \"port\": 777 , "
-            " \"dns_server_timeout\": 333 , "
-            " \"ncr_format\": \"JSON\", "
-            "\"tsig_keys\": [], "
-            "\"forward_ddns\" : {}, "
-            "\"reverse_ddns\" : {} "
+            " \"dns-server-timeout\": 333 , "
+            " \"ncr-format\": \"JSON\", "
+            "\"tsig-keys\": [], "
+            "\"forward-ddns\" : {}, "
+            "\"reverse-ddns\" : {} "
             "}";
 
     runConfig(config);
@@ -458,13 +458,13 @@ TEST_F(D2CfgMgrTest, defaultValues) {
     // Check that format timeout gets you its default
     config =
             "{"
-            " \"ip_address\": \"192.0.0.1\" , "
+            " \"ip-address\": \"192.0.0.1\" , "
             " \"port\": 777 , "
-            " \"dns_server_timeout\": 333 , "
-            " \"ncr_protocol\": \"UDP\", "
-            "\"tsig_keys\": [], "
-            "\"forward_ddns\" : {}, "
-            "\"reverse_ddns\" : {} "
+            " \"dns-server-timeout\": 333 , "
+            " \"ncr-protocol\": \"UDP\", "
+            "\"tsig-keys\": [], "
+            "\"forward-ddns\" : {}, "
+            "\"reverse-ddns\" : {} "
             "}";
 
     runConfig(config);
@@ -477,15 +477,15 @@ TEST_F(D2CfgMgrTest, unsupportedTopLevelItems) {
     // Check that an unsupported top level parameter fails.
     std::string config =
             "{"
-            " \"ip_address\": \"127.0.0.1\", "
+            " \"ip-address\": \"127.0.0.1\", "
             " \"port\": 777 , "
-            " \"dns_server_timeout\": 333 , "
-            " \"ncr_protocol\": \"UDP\" , "
-            " \"ncr_format\": \"JSON\", "
-            "\"tsig_keys\": [], "
-            "\"forward_ddns\" : {}, "
-            "\"reverse_ddns\" : {}, "
-            "\"bogus_param\" : true "
+            " \"dns-server-timeout\": 333 , "
+            " \"ncr-protocol\": \"UDP\" , "
+            " \"ncr-format\": \"JSON\", "
+            "\"tsig-keys\": [], "
+            "\"forward-ddns\" : {}, "
+            "\"reverse-ddns\" : {}, "
+            "\"bogus-param\" : true "
             "}";
 
     runConfig(config, SHOULD_FAIL);
@@ -494,16 +494,16 @@ TEST_F(D2CfgMgrTest, unsupportedTopLevelItems) {
     // D2 these fail as they are not in the parse order.
     config =
             "{"
-            " \"ip_address\": \"127.0.0.1\", "
+            " \"ip-address\": \"127.0.0.1\", "
             " \"port\": 777 , "
-            " \"dns_server_timeout\": 333 , "
-            " \"ncr_protocol\": \"UDP\" , "
-            " \"ncr_format\": \"JSON\", "
-            "\"tsig_keys\": [], "
-            "\"bogus_object_one\" : {}, "
-            "\"forward_ddns\" : {}, "
-            "\"reverse_ddns\" : {}, "
-            "\"bogus_object_two\" : {} "
+            " \"dns-server-timeout\": 333 , "
+            " \"ncr-protocol\": \"UDP\" , "
+            " \"ncr-format\": \"JSON\", "
+            "\"tsig-keys\": [], "
+            "\"bogus-object-one\" : {}, "
+            "\"forward-ddns\" : {}, "
+            "\"reverse-ddns\" : {}, "
+            "\"bogus-object-two\" : {} "
             "}";
 
     runConfig(config, SHOULD_FAIL);
@@ -622,7 +622,7 @@ TEST_F(TSIGKeyInfoTest, validEntry) {
     std::string config = "{"
                          " \"name\": \"d2_key_one\" , "
                          " \"algorithm\": \"HMAC-MD5\" , "
-                         " \"digest_bits\": 120 , "
+                         " \"digest-bits\": 120 , "
                          " \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
                          "}";
     ASSERT_TRUE(fromJSON(config));
@@ -654,13 +654,13 @@ TEST_F(TSIGKeyInfoTest, invalidTSIGKeyList) {
 
                          " { \"name\": \"key1\" , "
                          "   \"algorithm\": \"HMAC-MD5\" ,"
-                         " \"digest_bits\": 120 , "
+                         " \"digest-bits\": 120 , "
                          "   \"secret\": \"GWG/Xfbju4O2iXGqkSu4PQ==\" "
                          " },"
                          // this entry has an invalid algorithm
                          " { \"name\": \"key2\" , "
                          "   \"algorithm\": \"\" ,"
-                         " \"digest_bits\": 120 , "
+                         " \"digest-bits\": 120 , "
                          "   \"secret\": \"GWG/Xfbju4O2iXGqkSu4PQ==\" "
                          " },"
                          " { \"name\": \"key3\" , "
@@ -687,12 +687,12 @@ TEST_F(TSIGKeyInfoTest, duplicateTSIGKey) {
 
                          " { \"name\": \"key1\" , "
                          "   \"algorithm\": \"HMAC-MD5\" ,"
-                         " \"digest_bits\": 120 , "
+                         " \"digest-bits\": 120 , "
                          "   \"secret\": \"GWG/Xfbju4O2iXGqkSu4PQ==\" "
                          " },"
                          " { \"name\": \"key2\" , "
                          "   \"algorithm\": \"HMAC-MD5\" ,"
-                         " \"digest_bits\": 120 , "
+                         " \"digest-bits\": 120 , "
                          "   \"secret\": \"GWG/Xfbju4O2iXGqkSu4PQ==\" "
                          " },"
                          " { \"name\": \"key1\" , "
@@ -719,32 +719,32 @@ TEST_F(TSIGKeyInfoTest, validTSIGKeyList) {
 
                          " { \"name\": \"key1\" , "
                          "   \"algorithm\": \"HMAC-MD5\" ,"
-                         " \"digest_bits\": 80 , "
+                         " \"digest-bits\": 80 , "
                          "  \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
                          " },"
                          " { \"name\": \"key2\" , "
                          "   \"algorithm\": \"HMAC-SHA1\" ,"
-                         " \"digest_bits\": 80 , "
+                         " \"digest-bits\": 80 , "
                          "  \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
                          " },"
                          " { \"name\": \"key3\" , "
                          "   \"algorithm\": \"HMAC-SHA256\" ,"
-                         " \"digest_bits\": 128 , "
+                         " \"digest-bits\": 128 , "
                          "  \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
                          " },"
                          " { \"name\": \"key4\" , "
                          "   \"algorithm\": \"HMAC-SHA224\" ,"
-                         " \"digest_bits\": 112 , "
+                         " \"digest-bits\": 112 , "
                          "  \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
                          " },"
                          " { \"name\": \"key5\" , "
                          "   \"algorithm\": \"HMAC-SHA384\" ,"
-                         " \"digest_bits\": 192 , "
+                         " \"digest-bits\": 192 , "
                          "  \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
                          " },"
                          " { \"name\": \"key6\" , "
                          "   \"algorithm\": \"HMAC-SHA512\" ,"
-                         " \"digest_bits\": 256 , "
+                         " \"digest-bits\": 256 , "
                          "   \"secret\": \"dGhpcyBrZXkgd2lsbCBtYXRjaA==\" "
                          " }"
                          " ]";
@@ -827,20 +827,20 @@ TEST_F(DnsServerInfoTest, invalidEntry) {
     // Create a config in which both host and ip address are supplied.
     // Verify that build fails.
     std::string config = "{ \"hostname\": \"pegasus.tmark\", "
-                         "  \"ip_address\": \"127.0.0.1\" } ";
+                         "  \"ip-address\": \"127.0.0.1\" } ";
     ASSERT_TRUE(fromJSON(config));
     EXPECT_THROW(parser_->build(config_set_), D2CfgError);
 
     // Neither host nor ip address supplied
     // Verify that builds fails.
     config = "{ \"hostname\": \"\", "
-             "  \"ip_address\": \"\" } ";
+             "  \"ip-address\": \"\" } ";
     ASSERT_TRUE(fromJSON(config));
     EXPECT_THROW(parser_->build(config_set_), D2CfgError);
 
     // Create a config with a negative port number.
     // Verify that build fails.
-    config = "{ \"ip_address\": \"192.168.5.6\" ,"
+    config = "{ \"ip-address\": \"192.168.5.6\" ,"
              "  \"port\": -100 }";
     ASSERT_TRUE(fromJSON(config));
     EXPECT_THROW (parser_->build(config_set_), isc::BadValue);
@@ -877,7 +877,7 @@ TEST_F(DnsServerInfoTest, validEntry) {
     /// reset();
 
     // Valid entries for static ip
-    std::string config = " { \"ip_address\": \"127.0.0.1\" , "
+    std::string config = " { \"ip-address\": \"127.0.0.1\" , "
                          "  \"port\": 100 }";
     ASSERT_TRUE(fromJSON(config));
 
@@ -897,7 +897,7 @@ TEST_F(DnsServerInfoTest, validEntry) {
     reset();
 
     // Valid entries for static ip, no port
-    config = " { \"ip_address\": \"192.168.2.5\" }";
+    config = " { \"ip-address\": \"192.168.2.5\" }";
     ASSERT_TRUE(fromJSON(config));
 
     // Verify that it builds and commits without throwing.
@@ -918,9 +918,9 @@ TEST_F(DnsServerInfoTest, validEntry) {
 /// entries is detected.
 TEST_F(ConfigParseTest, invalidServerList) {
     // Construct a list of servers with an invalid server entry.
-    std::string config = "[ { \"ip_address\": \"127.0.0.1\" }, "
-                        "{ \"ip_address\": \"\" }, "
-                        "{ \"ip_address\": \"127.0.0.2\" } ]";
+    std::string config = "[ { \"ip-address\": \"127.0.0.1\" }, "
+                        "{ \"ip-address\": \"\" }, "
+                        "{ \"ip-address\": \"127.0.0.2\" } ]";
     ASSERT_TRUE(fromJSON(config));
 
     // Create the server storage and list parser.
@@ -936,9 +936,9 @@ TEST_F(ConfigParseTest, invalidServerList) {
 /// a valid configuration.
 TEST_F(ConfigParseTest, validServerList) {
     // Create a valid list of servers.
-    std::string config = "[ { \"ip_address\": \"127.0.0.1\" }, "
-                        "{ \"ip_address\": \"127.0.0.2\" }, "
-                        "{ \"ip_address\": \"127.0.0.3\" } ]";
+    std::string config = "[ { \"ip-address\": \"127.0.0.1\" }, "
+                        "{ \"ip-address\": \"127.0.0.2\" }, "
+                        "{ \"ip-address\": \"127.0.0.3\" } ]";
     ASSERT_TRUE(fromJSON(config));
 
     // Create the server storage and list parser.
@@ -984,13 +984,13 @@ TEST_F(DdnsDomainTest, invalidDdnsDomainEntry) {
                  new DdnsDomainParser("test", domains, keys_)), D2CfgError);
 
     // Create a domain configuration without a name
-    std::string config = "{  \"key_name\": \"d2_key.tmark.org\" , "
-                         "  \"dns_servers\" : [ "
-                         "  {  \"ip_address\": \"127.0.0.1\" , "
+    std::string config = "{  \"key-name\": \"d2_key.tmark.org\" , "
+                         "  \"dns-servers\" : [ "
+                         "  {  \"ip-address\": \"127.0.0.1\" , "
                          "    \"port\": 100 },"
-                         "  { \"ip_address\": \"127.0.0.2\" , "
+                         "  { \"ip-address\": \"127.0.0.2\" , "
                          "    \"port\": 200 },"
-                         "  {  \"ip_address\": \"127.0.0.3\" , "
+                         "  {  \"ip-address\": \"127.0.0.3\" , "
                          "    \"port\": 300 } ] } ";
     ASSERT_TRUE(fromJSON(config));
 
@@ -999,8 +999,8 @@ TEST_F(DdnsDomainTest, invalidDdnsDomainEntry) {
 
     // Create a domain configuration with an empty server list.
     config = "{ \"name\": \"tmark.org\" , "
-             "  \"key_name\": \"d2_key.tmark.org\" , "
-             "  \"dns_servers\" : [ "
+             "  \"key-name\": \"d2_key.tmark.org\" , "
+             "  \"dns-servers\" : [ "
              "   ] } ";
     ASSERT_TRUE(fromJSON(config));
 
@@ -1009,9 +1009,9 @@ TEST_F(DdnsDomainTest, invalidDdnsDomainEntry) {
 
     // Create a domain configuration with a mal-formed server entry.
     config = "{ \"name\": \"tmark.org\" , "
-             "  \"key_name\": \"d2_key.tmark.org\" , "
-             "  \"dns_servers\" : [ "
-             "  {  \"ip_address\": \"127.0.0.3\" , "
+             "  \"key-name\": \"d2_key.tmark.org\" , "
+             "  \"dns-servers\" : [ "
+             "  {  \"ip-address\": \"127.0.0.3\" , "
              "    \"port\": -1 } ] } ";
     ASSERT_TRUE(fromJSON(config));
 
@@ -1020,9 +1020,9 @@ TEST_F(DdnsDomainTest, invalidDdnsDomainEntry) {
 
     // Create a domain configuration without an defined key name
     config = "{ \"name\": \"tmark.org\" , "
-             "  \"key_name\": \"d2_key.tmark.org\" , "
-             "  \"dns_servers\" : [ "
-             "  {  \"ip_address\": \"127.0.0.3\" , "
+             "  \"key-name\": \"d2_key.tmark.org\" , "
+             "  \"dns-servers\" : [ "
+             "  {  \"ip-address\": \"127.0.0.3\" , "
              "    \"port\": 300 } ] } ";
     ASSERT_TRUE(fromJSON(config));
 
@@ -1041,13 +1041,13 @@ TEST_F(DdnsDomainTest, ddnsDomainParsing) {
     // servers.
     std::string config =
                         "{ \"name\": \"tmark.org\" , "
-                        "  \"key_name\": \"d2_key.tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  {  \"ip_address\": \"127.0.0.1\" , "
+                        "  \"key-name\": \"d2_key.tmark.org\" , "
+                        "  \"dns-servers\" : [ "
+                        "  {  \"ip-address\": \"127.0.0.1\" , "
                         "    \"port\": 100 },"
-                        "  { \"ip_address\": \"127.0.0.2\" , "
+                        "  { \"ip-address\": \"127.0.0.2\" , "
                         "    \"port\": 200 },"
-                        "  {  \"ip_address\": \"127.0.0.3\" , "
+                        "  {  \"ip-address\": \"127.0.0.3\" , "
                         "    \"port\": 300 } ] } ";
     ASSERT_TRUE(fromJSON(config));
 
@@ -1107,23 +1107,23 @@ TEST_F(DdnsDomainTest, DdnsDomainListParsing) {
     std::string config =
                         "[ "
                         "{ \"name\": \"tmark.org\" , "
-                        "  \"key_name\": \"d2_key.tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.1\" , "
+                        "  \"key-name\": \"d2_key.tmark.org\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.1\" , "
                         "    \"port\": 100 },"
-                        "  { \"ip_address\": \"127.0.0.2\" , "
+                        "  { \"ip-address\": \"127.0.0.2\" , "
                         "    \"port\": 200 },"
-                        "  { \"ip_address\": \"127.0.0.3\" , "
+                        "  { \"ip-address\": \"127.0.0.3\" , "
                         "    \"port\": 300 } ] } "
                         ", "
                         "{ \"name\": \"billcat.net\" , "
-                        "  \"key_name\": \"d2_key.billcat.net\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.4\" , "
+                        "  \"key-name\": \"d2_key.billcat.net\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.4\" , "
                         "    \"port\": 400 },"
-                        "  { \"ip_address\": \"127.0.0.5\" , "
+                        "  { \"ip-address\": \"127.0.0.5\" , "
                         "    \"port\": 500 },"
-                        "  { \"ip_address\": \"127.0.0.6\" , "
+                        "  { \"ip-address\": \"127.0.0.6\" , "
                         "    \"port\": 600 } ] } "
                         "] ";
 
@@ -1212,13 +1212,13 @@ TEST_F(DdnsDomainTest, duplicateDomain) {
     std::string config =
                         "[ "
                         "{ \"name\": \"tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.3\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.3\" , "
                         "    \"port\": 300 } ] } "
                         ", "
                         "{ \"name\": \"tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.3\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.3\" , "
                         "    \"port\": 300 } ] } "
                         "] ";
     ASSERT_TRUE(fromJSON(config));
@@ -1264,12 +1264,12 @@ TEST_F(D2CfgMgrTest, fullConfig) {
     // both the forward and reverse ddns managers.  Both managers have two
     // domains with three servers per domain.
     std::string config = "{ "
-                        "\"ip_address\" : \"192.168.1.33\" , "
+                        "\"ip-address\" : \"192.168.1.33\" , "
                         "\"port\" : 88 , "
-                        " \"dns_server_timeout\": 333 , "
-                        " \"ncr_protocol\": \"UDP\" , "
-                        " \"ncr_format\": \"JSON\", "
-                        "\"tsig_keys\": ["
+                        " \"dns-server-timeout\": 333 , "
+                        " \"ncr-protocol\": \"UDP\" , "
+                        " \"ncr-format\": \"JSON\", "
+                        "\"tsig-keys\": ["
                         "{"
                         "  \"name\": \"d2_key.tmark.org\" , "
                         "  \"algorithm\": \"hmac-md5\" , "
@@ -1278,44 +1278,44 @@ TEST_F(D2CfgMgrTest, fullConfig) {
                         "{"
                         "  \"name\": \"d2_key.billcat.net\" , "
                         "  \"algorithm\": \"hmac-md5\" , "
-                        " \"digest_bits\": 120 , "
+                        " \"digest-bits\": 120 , "
                         "   \"secret\": \"LSWXnfkKZjdPJI5QxlpnfQ==\" "
                         "}"
                         "],"
-                        "\"forward_ddns\" : {"
-                        "\"ddns_domains\": [ "
+                        "\"forward-ddns\" : {"
+                        "\"ddns-domains\": [ "
                         "{ \"name\": \"tmark.org\" , "
-                        "  \"key_name\": \"d2_key.tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.1\" } , "
-                        "  { \"ip_address\": \"127.0.0.2\" } , "
-                        "  { \"ip_address\": \"127.0.0.3\"} "
+                        "  \"key-name\": \"d2_key.tmark.org\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.1\" } , "
+                        "  { \"ip-address\": \"127.0.0.2\" } , "
+                        "  { \"ip-address\": \"127.0.0.3\"} "
                         "  ] } "
                         ", "
                         "{ \"name\": \"billcat.net\" , "
-                        "  \"key_name\": \"d2_key.billcat.net\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.4\" } , "
-                        "  { \"ip_address\": \"127.0.0.5\" } , "
-                        "  { \"ip_address\": \"127.0.0.6\" } "
+                        "  \"key-name\": \"d2_key.billcat.net\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.4\" } , "
+                        "  { \"ip-address\": \"127.0.0.5\" } , "
+                        "  { \"ip-address\": \"127.0.0.6\" } "
                         "  ] } "
                         "] },"
-                        "\"reverse_ddns\" : {"
-                        "\"ddns_domains\": [ "
+                        "\"reverse-ddns\" : {"
+                        "\"ddns-domains\": [ "
                         "{ \"name\": \" 0.168.192.in.addr.arpa.\" , "
-                        "  \"key_name\": \"d2_key.tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.1.1\" } , "
-                        "  { \"ip_address\": \"127.0.2.1\" } , "
-                        "  { \"ip_address\": \"127.0.3.1\" } "
+                        "  \"key-name\": \"d2_key.tmark.org\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.1.1\" } , "
+                        "  { \"ip-address\": \"127.0.2.1\" } , "
+                        "  { \"ip-address\": \"127.0.3.1\" } "
                         "  ] } "
                         ", "
                         "{ \"name\": \" 0.247.106.in.addr.arpa.\" , "
-                        "  \"key_name\": \"d2_key.billcat.net\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.4.1\" }, "
-                        "  { \"ip_address\": \"127.0.5.1\" } , "
-                        "  { \"ip_address\": \"127.0.6.1\" } "
+                        "  \"key-name\": \"d2_key.billcat.net\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.4.1\" }, "
+                        "  { \"ip-address\": \"127.0.5.1\" } , "
+                        "  { \"ip-address\": \"127.0.6.1\" } "
                         "  ] } "
                         "] } }";
 
@@ -1407,27 +1407,27 @@ TEST_F(D2CfgMgrTest, forwardMatch) {
     // Create  configuration with one domain, one sub domain, and the wild
     // card.
     std::string config = "{ "
-                        "\"ip_address\" : \"192.168.1.33\" , "
+                        "\"ip-address\" : \"192.168.1.33\" , "
                         "\"port\" : 88 , "
-                        "\"tsig_keys\": [] ,"
-                        "\"forward_ddns\" : {"
-                        "\"ddns_domains\": [ "
+                        "\"tsig-keys\": [] ,"
+                        "\"forward-ddns\" : {"
+                        "\"ddns-domains\": [ "
                         "{ \"name\": \"tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.1\" } "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.1\" } "
                         "  ] } "
                         ", "
                         "{ \"name\": \"one.tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.2\" } "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.2\" } "
                         "  ] } "
                         ", "
                         "{ \"name\": \"*\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.3\" } "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.3\" } "
                         "  ] } "
                         "] }, "
-                        "\"reverse_ddns\" : {} "
+                        "\"reverse-ddns\" : {} "
                         "}";
 
 
@@ -1480,22 +1480,22 @@ TEST_F(D2CfgMgrTest, forwardMatch) {
 TEST_F(D2CfgMgrTest, matchNoWildcard) {
     // Create a configuration with one domain, one sub-domain, and NO wild card.
     std::string config = "{ "
-                        "\"ip_address\" : \"192.168.1.33\" , "
+                        "\"ip-address\" : \"192.168.1.33\" , "
                         "\"port\" : 88 , "
-                        "\"tsig_keys\": [] ,"
-                        "\"forward_ddns\" : {"
-                        "\"ddns_domains\": [ "
+                        "\"tsig-keys\": [] ,"
+                        "\"forward-ddns\" : {"
+                        "\"ddns-domains\": [ "
                         "{ \"name\": \"tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.1\" } "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.1\" } "
                         "  ] } "
                         ", "
                         "{ \"name\": \"one.tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.2\" } "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.2\" } "
                         "  ] } "
                         "] }, "
-                        "\"reverse_ddns\" : {} "
+                        "\"reverse-ddns\" : {} "
                         " }";
 
     ASSERT_TRUE(fromJSON(config));
@@ -1527,17 +1527,17 @@ TEST_F(D2CfgMgrTest, matchNoWildcard) {
 /// This test verifies that any FQDN matches the wild card.
 TEST_F(D2CfgMgrTest, matchAll) {
     std::string config = "{ "
-                        "\"ip_address\" : \"192.168.1.33\" , "
+                        "\"ip-address\" : \"192.168.1.33\" , "
                         "\"port\" : 88 , "
-                        "\"tsig_keys\": [] ,"
-                        "\"forward_ddns\" : {"
-                        "\"ddns_domains\": [ "
+                        "\"tsig-keys\": [] ,"
+                        "\"forward-ddns\" : {"
+                        "\"ddns-domains\": [ "
                         "{ \"name\": \"*\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.1\" } "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.1\" } "
                         "  ] } "
                         "] }, "
-                        "\"reverse_ddns\" : {} "
+                        "\"reverse-ddns\" : {} "
                         "}";
 
     ASSERT_TRUE(fromJSON(config));
@@ -1573,32 +1573,32 @@ TEST_F(D2CfgMgrTest, matchAll) {
 /// as a match.
 TEST_F(D2CfgMgrTest, matchReverse) {
     std::string config = "{ "
-                        "\"ip_address\" : \"192.168.1.33\" , "
+                        "\"ip-address\" : \"192.168.1.33\" , "
                         "\"port\" : 88 , "
-                        "\"tsig_keys\": [] ,"
-                        "\"forward_ddns\" : {}, "
-                        "\"reverse_ddns\" : {"
-                        "\"ddns_domains\": [ "
+                        "\"tsig-keys\": [] ,"
+                        "\"forward-ddns\" : {}, "
+                        "\"reverse-ddns\" : {"
+                        "\"ddns-domains\": [ "
                         "{ \"name\": \"5.100.168.192.in-addr.arpa.\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.1\" } "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.1\" } "
                         "  ] }, "
                         "{ \"name\": \"100.200.192.in-addr.arpa.\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.1\" } "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.1\" } "
                         "  ] }, "
                         "{ \"name\": \"170.192.in-addr.arpa.\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.1\" } "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.1\" } "
                         "  ] }, "
                         // Note mixed case to test case insensitivity.
                         "{ \"name\": \"2.0.3.0.8.b.d.0.1.0.0.2.IP6.ARPA.\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.1\" } "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.1\" } "
                         "  ] },"
                         "{ \"name\": \"*\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.1\" } "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.1\" } "
                         "  ] } "
                         "] } }";
 
@@ -1662,7 +1662,7 @@ TEST_F(D2CfgMgrTest, matchReverse) {
 ///
 /// #    Each test has:
 /// #      1. description - optional text description
-/// #      2. should_fail - bool indicator if parsing is expected to file
+/// #      2. should-fail - bool indicator if parsing is expected to file
 /// #         (defaults to false)
 /// #       3. data - configuration text to parse
 /// #
@@ -1702,15 +1702,16 @@ TEST_F(D2CfgMgrTest, configPermutations) {
 
     // Read in each test For each test, read:
     //  1. description - optional text description
-    //  2. should_fail - bool indicator if parsing is expected to file (defaults
+    //  2. should-fail - bool indicator if parsing is expected to file (defaults
     //     to false
     //  3. data - configuration text to parse
     //
     // Next attempt to parse the configuration by passing it into
     // D2CfgMgr::parseConfig().  Then check the parsing outcome against the
-    // expected outcome as given by should_fail.
+    // expected outcome as given by should-fail.
     isc::data::ConstElementPtr test;
-    BOOST_FOREACH(test, tests->get("test_list")->listValue()) {
+    ASSERT_TRUE(tests->get("test-list"));
+    BOOST_FOREACH(test, tests->get("test-list")->listValue()) {
 
         // Grab the description.
         std::string description = "<no desc>";
@@ -1719,10 +1720,10 @@ TEST_F(D2CfgMgrTest, configPermutations) {
             elem->getValue(description);
         }
 
-        // Grab the outcome flag, should_fail, defaults to false if it's
+        // Grab the outcome flag, should-fail, defaults to false if it's
         // not specified.
         bool should_fail = false;
-        elem = test->get("should_fail");
+        elem = test->get("should-fail");
         if (elem)  {
             elem->getValue(should_fail);
         }

+ 4 - 4
src/bin/d2/tests/d2_controller_unittests.cc

@@ -259,11 +259,11 @@ TEST_F(D2ControllerTest, validConfigReload) {
     // Define a replacement config.
     const char* second_cfg =
             "{"
-            " \"ip_address\": \"192.168.77.1\" , "
+            " \"ip-address\": \"192.168.77.1\" , "
             " \"port\": 777 , "
-            "\"tsig_keys\": [], "
-            "\"forward_ddns\" : {}, "
-            "\"reverse_ddns\" : {} "
+            "\"tsig-keys\": [], "
+            "\"forward-ddns\" : {}, "
+            "\"reverse-ddns\" : {} "
             "}";
 
     // Schedule to replace the configuration file after launch. This way the

+ 8 - 8
src/bin/d2/tests/d2_process_tests.sh.in

@@ -22,11 +22,11 @@ EXPECTED_VERSION="@PACKAGE_VERSION@"
 CONFIG="{
     \"DhcpDdns\":
     {
-        \"ip_address\": \"127.0.0.1\",
+        \"ip-address\": \"127.0.0.1\",
         \"port\": 53001,
-        \"tsig_keys\": [],
-        \"forward_ddns\" : {},
-        \"reverse_ddns\" : {}
+        \"tsig-keys\": [],
+        \"forward-ddns\" : {},
+        \"reverse-ddns\" : {}
     },
     \"Logging\":
     {
@@ -49,11 +49,11 @@ CONFIG="{
 CONFIG_INVALID="{
     \"DhcpDdns\":
     {
-        \"ip_address\": \"127.0.0.1\",
+        \"ip-address\": \"127.0.0.1\",
         \"port\": BOGUS,
-        \"tsig_keys\": [],
-        \"forward_ddns\" : {},
-        \"reverse_ddns\" : {}
+        \"tsig-keys\": [],
+        \"forward-ddns\" : {},
+        \"reverse-ddns\" : {}
     },
     \"Logging\":
     {

+ 36 - 36
src/bin/d2/tests/d2_process_unittests.cc

@@ -36,26 +36,26 @@ namespace {
 
 /// @brief Valid configuration containing an unavailable IP address.
 const char* bad_ip_d2_config = "{ "
-                        "\"ip_address\" : \"1.1.1.1\" , "
+                        "\"ip-address\" : \"1.1.1.1\" , "
                         "\"port\" : 5031, "
-                        "\"tsig_keys\": ["
+                        "\"tsig-keys\": ["
                         "{ \"name\": \"d2_key.tmark.org\" , "
                         "   \"algorithm\": \"HMAC-MD5\" ,"
                         "   \"secret\": \"LSWXnfkKZjdPJI5QxlpnfQ==\" "
                         "} ],"
-                        "\"forward_ddns\" : {"
-                        "\"ddns_domains\": [ "
+                        "\"forward-ddns\" : {"
+                        "\"ddns-domains\": [ "
                         "{ \"name\": \"tmark.org\" , "
-                        "  \"key_name\": \"d2_key.tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.101\" } "
+                        "  \"key-name\": \"d2_key.tmark.org\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.101\" } "
                         "] } ] }, "
-                        "\"reverse_ddns\" : {"
-                        "\"ddns_domains\": [ "
+                        "\"reverse-ddns\" : {"
+                        "\"ddns-domains\": [ "
                         "{ \"name\": \" 0.168.192.in.addr.arpa.\" , "
-                        "  \"key_name\": \"d2_key.tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.101\" , "
+                        "  \"key-name\": \"d2_key.tmark.org\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.101\" , "
                         "    \"port\": 100 } ] } "
                         "] } }";
 
@@ -274,14 +274,14 @@ TEST_F(D2ProcessTest, queueFullRecovery) {
     // Valid test message, contents are unimportant.
     const char* test_msg =
         "{"
-        " \"change_type\" : 0 , "
-        " \"forward_change\" : true , "
-        " \"reverse_change\" : false , "
+        " \"change-type\" : 0 , "
+        " \"forward-change\" : true , "
+        " \"reverse-change\" : false , "
         " \"fqdn\" : \"walah.walah.com\" , "
-        " \"ip_address\" : \"192.168.2.1\" , "
+        " \"ip-address\" : \"192.168.2.1\" , "
         " \"dhcid\" : \"010203040A7F8E3D\" , "
-        " \"lease_expires_on\" : \"20130121132405\" , "
-        " \"lease_length\" : 1300 "
+        " \"lease-expires-on\" : \"20130121132405\" , "
+        " \"lease-length\" : 1300 "
         "}";
 
     // Start queue manager with known good config.
@@ -515,14 +515,14 @@ TEST_F(D2ProcessTest, canShutdown) {
 
     const char* test_msg =
         "{"
-        " \"change_type\" : 0 , "
-        " \"forward_change\" : true , "
-        " \"reverse_change\" : false , "
+        " \"change-type\" : 0 , "
+        " \"forward-change\" : true , "
+        " \"reverse-change\" : false , "
         " \"fqdn\" : \"fish.tmark.org\" , "
-        " \"ip_address\" : \"192.168.2.1\" , "
+        " \"ip-address\" : \"192.168.2.1\" , "
         " \"dhcid\" : \"010203040A7F8E3D\" , "
-        " \"lease_expires_on\" : \"20130121132405\" , "
-        " \"lease_length\" : 1300 "
+        " \"lease-expires-on\" : \"20130121132405\" , "
+        " \"lease-length\" : 1300 "
         "}";
 
     // Manually enqueue a request.  This lets us test logic with queue
@@ -608,11 +608,11 @@ TEST_F(D2ProcessTest, fatalErrorShutdown) {
 /// loopback.
 TEST_F(D2ProcessTest, notLoopbackTest) {
     const char* config = "{ "
-                        "\"ip_address\" : \"0.0.0.0\" , "
+                        "\"ip-address\" : \"0.0.0.0\" , "
                         "\"port\" : 53001, "
-                        "\"tsig_keys\": [],"
-                        "\"forward_ddns\" : {},"
-                        "\"reverse_ddns\" : {}"
+                        "\"tsig-keys\": [],"
+                        "\"forward-ddns\" : {},"
+                        "\"reverse-ddns\" : {}"
                         "}";
 
     // Note we don't care nor can we predict if this
@@ -626,11 +626,11 @@ TEST_F(D2ProcessTest, notLoopbackTest) {
 /// DHCP_DDNS_NOT_ON_LOOPBACK is not issued.
 TEST_F(D2ProcessTest, v4LoopbackTest) {
     const char* config = "{ "
-                        "\"ip_address\" : \"127.0.0.1\" , "
+                        "\"ip-address\" : \"127.0.0.1\" , "
                         "\"port\" : 53001, "
-                        "\"tsig_keys\": [],"
-                        "\"forward_ddns\" : {},"
-                        "\"reverse_ddns\" : {}"
+                        "\"tsig-keys\": [],"
+                        "\"forward-ddns\" : {},"
+                        "\"reverse-ddns\" : {}"
                         "}";
     ASSERT_TRUE(runWithConfig(config));
 }
@@ -639,11 +639,11 @@ TEST_F(D2ProcessTest, v4LoopbackTest) {
 /// DHCP_DDNS_NOT_ON_LOOPBACK is not issued.
 TEST_F(D2ProcessTest, v6LoopbackTest) {
     const char* config = "{ "
-                        "\"ip_address\" : \"::1\" , "
+                        "\"ip-address\" : \"::1\" , "
                         "\"port\" : 53001, "
-                        "\"tsig_keys\": [],"
-                        "\"forward_ddns\" : {},"
-                        "\"reverse_ddns\" : {}"
+                        "\"tsig-keys\": [],"
+                        "\"forward-ddns\" : {},"
+                        "\"reverse-ddns\" : {}"
                         "}";
     ASSERT_TRUE(runWithConfig(config));
 }

+ 18 - 18
src/bin/d2/tests/d2_queue_mgr_unittests.cc

@@ -39,36 +39,36 @@ const char *valid_msgs[] =
 {
     // Valid Add.
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Valid Remove.
      "{"
-     " \"change_type\" : 1 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 1 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
      // Valid Add with IPv6 address
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"fe80::2acf:e9ff:fe12:e56f\" , "
+     " \"ip-address\" : \"fe80::2acf:e9ff:fe12:e56f\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}"
 };
 

+ 20 - 20
src/bin/d2/tests/d2_update_mgr_unittests.cc

@@ -96,14 +96,14 @@ public:
     void makeCannedNcrs() {
         const char* msg_str =
         "{"
-        " \"change_type\" : 0 , "
-        " \"forward_change\" : true , "
-        " \"reverse_change\" : false , "
+        " \"change-type\" : 0 , "
+        " \"forward-change\" : true , "
+        " \"reverse-change\" : false , "
         " \"fqdn\" : \"my.example.com.\" , "
-        " \"ip_address\" : \"192.168.1.2\" , "
+        " \"ip-address\" : \"192.168.1.2\" , "
         " \"dhcid\" : \"0102030405060708\" , "
-        " \"lease_expires_on\" : \"20130121132405\" , "
-        " \"lease_length\" : 1300 "
+        " \"lease-expires-on\" : \"20130121132405\" , "
+        " \"lease-length\" : 1300 "
         "}";
 
         const char* dhcids[] = { "111111", "222222", "333333", "444444"};
@@ -122,29 +122,29 @@ public:
     void makeCannedConfig() {
         std::string canned_config_ =
                  "{ "
-                  "\"ip_address\" : \"192.168.1.33\" , "
+                  "\"ip-address\" : \"192.168.1.33\" , "
                   "\"port\" : 88 , "
-                  "\"tsig_keys\": [] ,"
-                  "\"forward_ddns\" : {"
-                  "\"ddns_domains\": [ "
+                  "\"tsig-keys\": [] ,"
+                  "\"forward-ddns\" : {"
+                  "\"ddns-domains\": [ "
                   "{ \"name\": \"example.com.\" , "
-                  "  \"dns_servers\" : [ "
-                  "  { \"ip_address\": \"127.0.0.1\", \"port\" : 5301  } "
+                  "  \"dns-servers\" : [ "
+                  "  { \"ip-address\": \"127.0.0.1\", \"port\" : 5301  } "
                   "  ] },"
                   "{ \"name\": \"org.\" , "
-                  "  \"dns_servers\" : [ "
-                  "  { \"ip_address\": \"127.0.0.1\" } "
+                  "  \"dns-servers\" : [ "
+                  "  { \"ip-address\": \"127.0.0.1\" } "
                   "  ] }, "
                   "] }, "
-                  "\"reverse_ddns\" : { "
-                  "\"ddns_domains\": [ "
+                  "\"reverse-ddns\" : { "
+                  "\"ddns-domains\": [ "
                   "{ \"name\": \"1.168.192.in-addr.arpa.\" , "
-                  "  \"dns_servers\" : [ "
-                  "  { \"ip_address\": \"127.0.0.1\", \"port\" : 5301 } "
+                  "  \"dns-servers\" : [ "
+                  "  { \"ip-address\": \"127.0.0.1\", \"port\" : 5301 } "
                   "  ] }, "
                   "{ \"name\": \"2.0.3.0.8.B.D.0.1.0.0.2.ip6.arpa.\" , "
-                  "  \"dns_servers\" : [ "
-                  "  { \"ip_address\": \"127.0.0.1\" } "
+                  "  \"dns-servers\" : [ "
+                  "  { \"ip-address\": \"127.0.0.1\" } "
                   "  ] } "
                   "] } }";
 

+ 12 - 12
src/bin/d2/tests/d_test_stubs.cc

@@ -24,26 +24,26 @@ namespace isc {
 namespace d2 {
 
 const char* valid_d2_config = "{ "
-                        "\"ip_address\" : \"127.0.0.1\" , "
+                        "\"ip-address\" : \"127.0.0.1\" , "
                         "\"port\" : 5031, "
-                        "\"tsig_keys\": ["
+                        "\"tsig-keys\": ["
                         "{ \"name\": \"d2_key.tmark.org\" , "
                         "   \"algorithm\": \"HMAC-MD5\" ,"
                         "   \"secret\": \"LSWXnfkKZjdPJI5QxlpnfQ==\" "
                         "} ],"
-                        "\"forward_ddns\" : {"
-                        "\"ddns_domains\": [ "
+                        "\"forward-ddns\" : {"
+                        "\"ddns-domains\": [ "
                         "{ \"name\": \"tmark.org.\" , "
-                        "  \"key_name\": \"d2_key.tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.101\" } "
+                        "  \"key-name\": \"d2_key.tmark.org\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.101\" } "
                         "] } ] }, "
-                        "\"reverse_ddns\" : {"
-                        "\"ddns_domains\": [ "
+                        "\"reverse-ddns\" : {"
+                        "\"ddns-domains\": [ "
                         "{ \"name\": \" 0.168.192.in.addr.arpa.\" , "
-                        "  \"key_name\": \"d2_key.tmark.org\" , "
-                        "  \"dns_servers\" : [ "
-                        "  { \"ip_address\": \"127.0.0.101\" , "
+                        "  \"key-name\": \"d2_key.tmark.org\" , "
+                        "  \"dns-servers\" : [ "
+                        "  { \"ip-address\": \"127.0.0.101\" , "
                         "    \"port\": 100 } ] } "
                         "] } }";
 

+ 6 - 6
src/bin/d2/tests/nc_add_unittests.cc

@@ -274,14 +274,14 @@ TEST(NameAddTransaction, construction) {
 
     const char* msg_str =
         "{"
-        " \"change_type\" : 1 , "
-        " \"forward_change\" : true , "
-        " \"reverse_change\" : true , "
+        " \"change-type\" : 1 , "
+        " \"forward-change\" : true , "
+        " \"reverse-change\" : true , "
         " \"fqdn\" : \"example.com.\" , "
-        " \"ip_address\" : \"192.168.2.1\" , "
+        " \"ip-address\" : \"192.168.2.1\" , "
         " \"dhcid\" : \"0102030405060708\" , "
-        " \"lease_expires_on\" : \"20130121132405\" , "
-        " \"lease_length\" : 1300 "
+        " \"lease-expires-on\" : \"20130121132405\" , "
+        " \"lease-length\" : 1300 "
         "}";
 
     dhcp_ddns::NameChangeRequestPtr ncr;

+ 6 - 6
src/bin/d2/tests/nc_remove_unittests.cc

@@ -276,14 +276,14 @@ TEST(NameRemoveTransaction, construction) {
 
     const char* msg_str =
         "{"
-        " \"change_type\" : 0 , "
-        " \"forward_change\" : true , "
-        " \"reverse_change\" : true , "
+        " \"change-type\" : 0 , "
+        " \"forward-change\" : true , "
+        " \"reverse-change\" : true , "
         " \"fqdn\" : \"example.com.\" , "
-        " \"ip_address\" : \"192.168.2.1\" , "
+        " \"ip-address\" : \"192.168.2.1\" , "
         " \"dhcid\" : \"0102030405060708\" , "
-        " \"lease_expires_on\" : \"20130121132405\" , "
-        " \"lease_length\" : 1300 "
+        " \"lease-expires-on\" : \"20130121132405\" , "
+        " \"lease-length\" : 1300 "
         "}";
 
     dhcp_ddns::NameChangeRequestPtr ncr;

+ 12 - 12
src/bin/d2/tests/nc_test_utils.cc

@@ -242,14 +242,14 @@ TransactionTest::setupForIPv4Transaction(dhcp_ddns::NameChangeType chg_type,
                                          const TSIGKeyInfoPtr& tsig_key_info) {
     const char* msg_str =
         "{"
-        " \"change_type\" : 0 , "
-        " \"forward_change\" : true , "
-        " \"reverse_change\" : true , "
+        " \"change-type\" : 0 , "
+        " \"forward-change\" : true , "
+        " \"reverse-change\" : true , "
         " \"fqdn\" : \"my.forward.example.com.\" , "
-        " \"ip_address\" : \"192.168.2.1\" , "
+        " \"ip-address\" : \"192.168.2.1\" , "
         " \"dhcid\" : \"0102030405060708\" , "
-        " \"lease_expires_on\" : \"20130121132405\" , "
-        " \"lease_length\" : 1300 "
+        " \"lease-expires-on\" : \"20130121132405\" , "
+        " \"lease-length\" : 1300 "
         "}";
 
     // Create NameChangeRequest from JSON string.
@@ -300,14 +300,14 @@ TransactionTest::setupForIPv6Transaction(dhcp_ddns::NameChangeType chg_type,
                                          const TSIGKeyInfoPtr& tsig_key_info) {
     const char* msg_str =
         "{"
-        " \"change_type\" : 0 , "
-        " \"forward_change\" : true , "
-        " \"reverse_change\" : true , "
+        " \"change-type\" : 0 , "
+        " \"forward-change\" : true , "
+        " \"reverse-change\" : true , "
         " \"fqdn\" : \"my6.forward.example.com.\" , "
-        " \"ip_address\" : \"2001:1::100\" , "
+        " \"ip-address\" : \"2001:1::100\" , "
         " \"dhcid\" : \"0102030405060708\" , "
-        " \"lease_expires_on\" : \"20130121132405\" , "
-        " \"lease_length\" : 1300 "
+        " \"lease-expires-on\" : \"20130121132405\" , "
+        " \"lease-length\" : 1300 "
         "}";
 
     // Create NameChangeRequest from JSON string.

+ 6 - 6
src/bin/d2/tests/nc_test_utils.h

@@ -319,14 +319,14 @@ extern dns::RRsetPtr getRRFromSection(const D2UpdateMessagePtr& request,
 /// @code
 ///        const char* msg_str =
 ///            "{"
-///            " \"change_type\" : 0 , "
-///            " \"forward_change\" : true , "
-///            " \"reverse_change\" : true , "
+///            " \"change-type\" : 0 , "
+///            " \"forward-change\" : true , "
+///            " \"reverse-change\" : true , "
 ///            " \"fqdn\" : \"my.example.com.\" , "
-///            " \"ip_address\" : \"192.168.2.1\" , "
+///            " \"ip-address\" : \"192.168.2.1\" , "
 ///            " \"dhcid\" : \"0102030405060708\" , "
-///            " \"lease_expires_on\" : \"20130121132405\" , "
-///            " \"lease_length\" : 1300 "
+///            " \"lease-expires-on\" : \"20130121132405\" , "
+///            " \"lease-length\" : 1300 "
 ///            "}";
 ///
 /// @endcode

+ 6 - 6
src/bin/d2/tests/nc_trans_unittests.cc

@@ -374,14 +374,14 @@ TEST(NameChangeTransaction, construction) {
 
     const char* msg_str =
         "{"
-        " \"change_type\" : 0 , "
-        " \"forward_change\" : true , "
-        " \"reverse_change\" : true , "
+        " \"change-type\" : 0 , "
+        " \"forward-change\" : true , "
+        " \"reverse-change\" : true , "
         " \"fqdn\" : \"example.com.\" , "
-        " \"ip_address\" : \"192.168.2.1\" , "
+        " \"ip-address\" : \"192.168.2.1\" , "
         " \"dhcid\" : \"0102030405060708\" , "
-        " \"lease_expires_on\" : \"20130121132405\" , "
-        " \"lease_length\" : 1300 "
+        " \"lease-expires-on\" : \"20130121132405\" , "
+        " \"lease-length\" : 1300 "
         "}";
 
     dhcp_ddns::NameChangeRequestPtr ncr;

File diff suppressed because it is too large
+ 458 - 458
src/bin/d2/tests/testdata/d2_cfg_tests.json


+ 6 - 6
src/bin/dhcp4/tests/d2_unittest.cc

@@ -57,18 +57,18 @@ Dhcp4SrvD2Test::buildTestNcr(uint32_t dhcid_id_num) {
 
     stream <<
         "{"
-        " \"change_type\" : 0 , "
-        " \"forward_change\" : true , "
-        " \"reverse_change\" : false , "
+        " \"change-type\" : 0 , "
+        " \"forward-change\" : true , "
+        " \"reverse-change\" : false , "
         " \"fqdn\" : \"myhost.example.com.\" , "
-        " \"ip_address\" : \"192.168.2.1\" , "
+        " \"ip-address\" : \"192.168.2.1\" , "
         " \"dhcid\" : \""
 
         << std::hex << std::setfill('0') << std::setw(16)
         << dhcid_id_num << "\" , "
 
-        " \"lease_expires_on\" : \"20140121132405\" , "
-        " \"lease_length\" : 1300 "
+        " \"lease-expires-on\" : \"20140121132405\" , "
+        " \"lease-length\" : 1300 "
         "}";
 
     return (dhcp_ddns::NameChangeRequest::fromJSON(stream.str()));

+ 6 - 6
src/bin/dhcp6/tests/d2_unittest.cc

@@ -59,18 +59,18 @@ Dhcp6SrvD2Test::buildTestNcr(uint32_t dhcid_id_num) {
 
     stream <<
         "{"
-        " \"change_type\" : 0 , "
-        " \"forward_change\" : true , "
-        " \"reverse_change\" : false , "
+        " \"change-type\" : 0 , "
+        " \"forward-change\" : true , "
+        " \"reverse-change\" : false , "
         " \"fqdn\" : \"myhost.example.com.\" , "
-        " \"ip_address\" : \"192.168.2.1\" , "
+        " \"ip-address\" : \"192.168.2.1\" , "
         " \"dhcid\" : \""
 
         << std::hex << std::setfill('0') << std::setw(16)
         << dhcid_id_num << "\" , "
 
-        " \"lease_expires_on\" : \"20140121132405\" , "
-        " \"lease_length\" : 1300 "
+        " \"lease-expires-on\" : \"20140121132405\" , "
+        " \"lease-length\" : 1300 "
         "}";
 
     return (dhcp_ddns::NameChangeRequest::fromJSON(stream.str()));

+ 4 - 4
src/bin/keactrl/kea.conf.pre

@@ -105,11 +105,11 @@
 # DHCP DDNS configuration starts here.
 "DhcpDdns":
 {
-  "ip_address": "127.0.0.1",
+  "ip-address": "127.0.0.1",
   "port": 53001,
-  "tsig_keys": [],
-  "forward_ddns" : {},
-  "reverse_ddns" : {}
+  "tsig-keys": [],
+  "forward-ddns" : {},
+  "reverse-ddns" : {}
 },
 
 # Logging configuration starts here. It tells Kea servers to store

+ 4 - 4
src/bin/keactrl/tests/keactrl_tests.sh.in

@@ -74,11 +74,11 @@ config="{
     },
     \"DhcpDdns\":
     {
-        \"ip_address\": \"127.0.0.1\",
+        \"ip-address\": \"127.0.0.1\",
         \"port\": 53001,
-        \"tsig_keys\": [],
-        \"forward_ddns\" : {},
-        \"reverse_ddns\" : {}
+        \"tsig-keys\": [],
+        \"forward-ddns\" : {},
+        \"reverse-ddns\" : {}
     },
 
     \"Logging\":

+ 6 - 6
src/lib/dhcp_ddns/libdhcp_ddns.dox

@@ -21,18 +21,18 @@ This is a library of classes (in the isc::dhcp_ddns namespace) for sending
 and receiving requests used by ISC's DHCP-DDNS (aka D2) service to carry
 out DHCP-driven DNS updates.  Each request contains the following information:
 
-    - change_type -  indicates if this is a request to add or remove DNS entries
-    - forward_change - indicates if the forward DNS zone (the one that
+    - change-type -  indicates if this is a request to add or remove DNS entries
+    - forward-change - indicates if the forward DNS zone (the one that
       contains name to address mappings) should be updated
-    - reverse_change - indicates if reverse DNS zone (which contains the
+    - reverse-change - indicates if reverse DNS zone (which contains the
       address to name mappings) should be updated
     - fqdn - the fully qualified domain name whose DNS entries should be updated
-    - ip_address - IP address (v4 or v6) leased to the client with the
+    - ip-address - IP address (v4 or v6) leased to the client with the
       given FQDN
     - dhcid - DHCID (a form of identification) of the client to whom the IP
       address is leased
-    - lease_expires_on - timestamp containing the date/time the lease expires
-    - lease_length - duration in seconds for which the lease is valid.
+    - lease-expires-on - timestamp containing the date/time the lease expires
+    - lease-length - duration in seconds for which the lease is valid.
 
 These requests are implemented in this library by the class,
 isc::dhcp_ddns::NameChangeRequest.  This class provides services for

+ 13 - 13
src/lib/dhcp_ddns/ncr_msg.cc

@@ -323,28 +323,28 @@ NameChangeRequest::fromJSON(const std::string& json) {
     // content is lexically invalid.   If the element is NOT found in the
     // map, getElement will throw NcrMessageError indicating the missing
     // member. Currently there are no optional values.
-    element = ncr->getElement("change_type", element_map);
+    element = ncr->getElement("change-type", element_map);
     ncr->setChangeType(element);
 
-    element = ncr->getElement("forward_change", element_map);
+    element = ncr->getElement("forward-change", element_map);
     ncr->setForwardChange(element);
 
-    element = ncr->getElement("reverse_change", element_map);
+    element = ncr->getElement("reverse-change", element_map);
     ncr->setReverseChange(element);
 
     element = ncr->getElement("fqdn", element_map);
     ncr->setFqdn(element);
 
-    element = ncr->getElement("ip_address", element_map);
+    element = ncr->getElement("ip-address", element_map);
     ncr->setIpAddress(element);
 
     element = ncr->getElement("dhcid", element_map);
     ncr->setDhcid(element);
 
-    element = ncr->getElement("lease_expires_on", element_map);
+    element = ncr->getElement("lease-expires-on", element_map);
     ncr->setLeaseExpiresOn(element);
 
-    element = ncr->getElement("lease_length", element_map);
+    element = ncr->getElement("lease-length", element_map);
     ncr->setLeaseLength(element);
 
     // All members were in the Element set and were correct lexically. Now
@@ -363,16 +363,16 @@ NameChangeRequest::toJSON() const  {
     // forward.
     std::ostringstream stream;
 
-    stream << "{\"change_type\":" << getChangeType() << ","
-        << "\"forward_change\":"
+    stream << "{\"change-type\":" << getChangeType() << ","
+        << "\"forward-change\":"
         << (isForwardChange() ? "true" : "false") << ","
-        << "\"reverse_change\":"
+        << "\"reverse-change\":"
         << (isReverseChange() ? "true" : "false") << ","
         << "\"fqdn\":\"" << getFqdn() << "\","
-        << "\"ip_address\":\"" << getIpAddress() << "\","
+        << "\"ip-address\":\"" << getIpAddress() << "\","
         << "\"dhcid\":\"" << getDhcid().toStr() << "\","
-        << "\"lease_expires_on\":\""  << getLeaseExpiresOnStr() << "\","
-        << "\"lease_length\":" << getLeaseLength() << "}";
+        << "\"lease-expires-on\":\""  << getLeaseExpiresOnStr() << "\","
+        << "\"lease-length\":" << getLeaseLength() << "}";
 
     return (stream.str());
 }
@@ -456,7 +456,7 @@ NameChangeRequest::setForwardChange(isc::data::ConstElementPtr element) {
     } catch (isc::data::TypeError& ex) {
         // We expect a boolean Element type, don't have one.
         isc_throw(NcrMessageError,
-                  "Wrong data type for forward_change: " << ex.what());
+                  "Wrong data type for forward-change: " << ex.what());
     }
 
     // Good to go, make the assignment.

+ 24 - 24
src/lib/dhcp_ddns/ncr_msg.h

@@ -323,40 +323,40 @@ public:
     ///
     /// @code
     ///     {
-    ///      "change_type" : <integer>,
-    ///      "forward_change" : <boolean>,
-    ///      "reverse_change" : <boolean>,
+    ///      "change-type" : <integer>,
+    ///      "forward-change" : <boolean>,
+    ///      "reverse-change" : <boolean>,
     ///      "fqdn" : "<fqdn>",
-    ///      "ip_address" : "<address>",
+    ///      "ip-address" : "<address>",
     ///      "dhcid" : "<hex_string>",
-    ///      "lease_expires_on" : "<yyyymmddHHMMSS>",
-    ///      "lease_length" : <secs>
+    ///      "lease-expires-on" : "<yyyymmddHHMMSS>",
+    ///      "lease-length" : <secs>
     ///     }
     /// @endcode
     ///
-    /// - change_type - indicates whether this request is to add or update
+    /// - change-type - indicates whether this request is to add or update
     ///   DNS entries or to remove them.  The value is an integer and is
     ///   0 for add/update and 1 for remove.
-    /// - forward_change - indicates whether the the forward (name to
+    /// - forward-change - indicates whether the the forward (name to
     ///   address) DNS zone should be updated.  The value is a string
     ///   representing a boolean.  It is "true" if the zone should be updated
     ///   and "false" if not. (Unlike the keyword, the boolean value is
     ///   case-insensitive.)
-    /// - reverse_change - indicates whether the the reverse (address to
+    /// - reverse-change - indicates whether the the reverse (address to
     ///   name) DNS zone should be updated.  The value is a string
     ///   representing a boolean.  It is "true" if the zone should be updated
     ///   and "false" if not. (Unlike the keyword, the boolean value is
     ///   case-insensitive.)
     /// - fqdn - fully qualified domain name such as "myhost.example.com.".
     ///   (Note that a trailing dot will be appended if not supplied.)
-    /// - ip_address - the IPv4 or IPv6 address of the client.  The value
+    /// - ip-address - the IPv4 or IPv6 address of the client.  The value
     ///   is a string representing the IP address (e.g. "192.168.0.1" or
     ///   "2001:db8:1::2").
     /// - dhcid - identification of the DHCP client to whom the IP address has
     ///   been leased.  The value is a string containing an even number of
     ///   hexadecimal digits without delimiters such as "2C010203040A7F8E3D"
     ///   (case insensitive).
-    /// - lease_expires_on - the date and time on which the lease expires.
+    /// - lease-expires-on - the date and time on which the lease expires.
     ///   The value is a string of the form "yyyymmddHHMMSS" where:
     ///     - yyyy - four digit year
     ///     - mm - month of year (1-12),
@@ -364,7 +364,7 @@ public:
     ///     - HH - hour of the day (0-23)
     ///     - MM - minutes of the hour (0-59)
     ///     - SS - seconds of the minute (0-59)
-    /// - lease_length - the length of the lease in seconds.  This is an
+    /// - lease-length - the length of the lease in seconds.  This is an
     ///   integer and may range between 1 and 4294967295 (2^32 - 1) inclusive.
     ///
     /// Examples:
@@ -373,14 +373,14 @@ public:
     ///
     /// @code
     ///  {
-    ///     "change_type" : 1,
-    ///     "forward_change" : true,
-    ///     "reverse_change" : false,
+    ///     "change-type" : 1,
+    ///     "forward-change" : true,
+    ///     "reverse-change" : false,
     ///     "fqdn" : "myhost.example.com.",
-    ///     "ip_address" : "192.168.2.1" ,
+    ///     "ip-address" : "192.168.2.1" ,
     ///     "dhcid" : "010203040A7F8E3D" ,
-    ///     "lease_expires_on" : "20130121132405",
-    ///     "lease_length" : 1300
+    ///     "lease-expires-on" : "20130121132405",
+    ///     "lease-length" : 1300
     ///  }
     /// @endcode
     ///
@@ -388,14 +388,14 @@ public:
     ///
     /// @code
     ///  {
-    ///     "change_type" : 0,
-    ///     "forward_change" : true,
-    ///     "reverse_change" : true,
+    ///     "change-type" : 0,
+    ///     "forward-change" : true,
+    ///     "reverse-change" : true,
     ///     "fqdn" : "someother.example.com.",
-    ///     "ip_address" : "2001::db8:1::2",
+    ///     "ip-address" : "2001::db8:1::2",
     ///     "dhcid" : "010203040A7F8E3D" , "
-    ///     "lease_expires_on" : "20130121132405",
-    ///     "lease_length" : 27400
+    ///     "lease-expires-on" : "20130121132405",
+    ///     "lease-length" : 27400
     ///   }
     /// @endcode
     ///

+ 18 - 18
src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc

@@ -39,36 +39,36 @@ const char *valid_msgs[] =
 {
     // Valid Add.
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Valid Remove.
      "{"
-     " \"change_type\" : 1 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 1 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
      // Valid Add with IPv6 address
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"fe80::2acf:e9ff:fe12:e56f\" , "
+     " \"ip-address\" : \"fe80::2acf:e9ff:fe12:e56f\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}"
 };
 

+ 102 - 102
src/lib/dhcp_ddns/tests/ncr_unittests.cc

@@ -33,36 +33,36 @@ const char *valid_msgs[] =
 {
     // Valid Add.
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Valid Remove.
      "{"
-     " \"change_type\" : 1 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 1 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
      // Valid Add with IPv6 address
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"fe80::2acf:e9ff:fe12:e56f\" , "
+     " \"ip-address\" : \"fe80::2acf:e9ff:fe12:e56f\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}"
 };
 
@@ -72,135 +72,135 @@ const char *invalid_msgs[] =
 {
     // Invalid change type.
      "{"
-     " \"change_type\" : 7 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 7 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Invalid forward change.
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : \"bogus\" , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : \"bogus\" , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Invalid reverse change.
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : 500 , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : 500 , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Forward and reverse change both false.
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : false , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : false , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Blank FQDN
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Malformed FQDN
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \".bad_name\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Bad IP address
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"xxxxxx\" , "
+     " \"ip-address\" : \"xxxxxx\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Blank DHCID
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Odd number of digits in DHCID
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Text in DHCID
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"THIS IS BOGUS!!!\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Invalid lease expiration string
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"Wed Jun 26 13:46:46 EDT 2013\" , "
-     " \"lease_length\" : 1300 "
+     " \"lease-expires-on\" : \"Wed Jun 26 13:46:46 EDT 2013\" , "
+     " \"lease-length\" : 1300 "
      "}",
     // Non-integer for lease length.
      "{"
-     " \"change_type\" : 0 , "
-     " \"forward_change\" : true , "
-     " \"reverse_change\" : false , "
+     " \"change-type\" : 0 , "
+     " \"forward-change\" : true , "
+     " \"reverse-change\" : false , "
      " \"fqdn\" : \"walah.walah.com\" , "
-     " \"ip_address\" : \"192.168.2.1\" , "
+     " \"ip-address\" : \"192.168.2.1\" , "
      " \"dhcid\" : \"010203040A7F8E3D\" , "
-     " \"lease_expires_on\" : \"20130121132405\" , "
-     " \"lease_length\" : \"BOGUS\" "
+     " \"lease-expires-on\" : \"20130121132405\" , "
+     " \"lease-length\" : \"BOGUS\" "
      "}"
 
 };
@@ -470,14 +470,14 @@ TEST(NameChangeRequestTest, leftShiftOperation) {
 TEST(NameChangeRequestTest, basicJsonTest) {
     // Define valid JSON rendition of a request.
     std::string msg_str = "{"
-                            "\"change_type\":1,"
-                            "\"forward_change\":true,"
-                            "\"reverse_change\":false,"
+                            "\"change-type\":1,"
+                            "\"forward-change\":true,"
+                            "\"reverse-change\":false,"
                             "\"fqdn\":\"walah.walah.com.\","
-                            "\"ip_address\":\"192.168.2.1\","
+                            "\"ip-address\":\"192.168.2.1\","
                             "\"dhcid\":\"010203040A7F8E3D\","
-                            "\"lease_expires_on\":\"20130121132405\","
-                            "\"lease_length\":1300"
+                            "\"lease-expires-on\":\"20130121132405\","
+                            "\"lease-length\":1300"
                           "}";
 
     // Verify that a NameChangeRequests can be instantiated from the
@@ -555,14 +555,14 @@ TEST(NameChangeRequestTest, validMsgChecks) {
 TEST(NameChangeRequestTest, toFromBufferTest) {
     // Define a string containing a valid JSON NameChangeRequest rendition.
     std::string msg_str = "{"
-                            "\"change_type\":1,"
-                            "\"forward_change\":true,"
-                            "\"reverse_change\":false,"
+                            "\"change-type\":1,"
+                            "\"forward-change\":true,"
+                            "\"reverse-change\":false,"
                             "\"fqdn\":\"walah.walah.com.\","
-                            "\"ip_address\":\"192.168.2.1\","
+                            "\"ip-address\":\"192.168.2.1\","
                             "\"dhcid\":\"010203040A7F8E3D\","
-                            "\"lease_expires_on\":\"20130121132405\","
-                            "\"lease_length\":1300"
+                            "\"lease-expires-on\":\"20130121132405\","
+                            "\"lease-length\":1300"
                           "}";
 
     // Create a request from JSON directly.

+ 6 - 6
src/lib/dhcpsrv/tests/d2_udp_unittest.cc

@@ -184,14 +184,14 @@ public:
         // Build an NCR from json string.
         const char* ncr_str =
             "{"
-            " \"change_type\" : 0 , "
-            " \"forward_change\" : true , "
-            " \"reverse_change\" : false , "
+            " \"change-type\" : 0 , "
+            " \"forward-change\" : true , "
+            " \"reverse-change\" : false , "
             " \"fqdn\" : \"myhost.example.com.\" , "
-            " \"ip_address\" : \"192.168.2.1\" , "
+            " \"ip-address\" : \"192.168.2.1\" , "
             " \"dhcid\" : \"010203040A7F8E3D\" , "
-            " \"lease_expires_on\" : \"20140121132405\" , "
-            " \"lease_length\" : 1300 "
+            " \"lease-expires-on\" : \"20140121132405\" , "
+            " \"lease-length\" : 1300 "
             "}";
 
         return (dhcp_ddns::NameChangeRequest::fromJSON(ncr_str));