BIND 10 trac3292, updated. 3cb70f65383ac942c9e2b2d5d0478698d8732d67 [3292] Updated bind10-guide with examples of DHCP options carrying bool.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Jan 20 10:18:41 UTC 2014


The branch, trac3292 has been updated
       via  3cb70f65383ac942c9e2b2d5d0478698d8732d67 (commit)
       via  82665961681e3d488183c6babdb15f04ef5f8d52 (commit)
      from  05e5cf632d5d0cd66536e10719961ace30e1096e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3cb70f65383ac942c9e2b2d5d0478698d8732d67
Author: Marcin Siodelski <marcin at isc.org>
Date:   Mon Jan 20 11:18:33 2014 +0100

    [3292] Updated bind10-guide with examples of DHCP options carrying bool.

commit 82665961681e3d488183c6babdb15f04ef5f8d52
Author: Marcin Siodelski <marcin at isc.org>
Date:   Mon Jan 20 10:45:09 2014 +0100

    [3292] Removed redundant checks in DHCP srv unit tests.

-----------------------------------------------------------------------

Summary of changes:
 doc/guide/bind10-guide.xml                    |   54 +++++++++++++++++--------
 src/bin/dhcp4/tests/config_parser_unittest.cc |    2 -
 src/bin/dhcp6/tests/config_parser_unittest.cc |    2 -
 3 files changed, 38 insertions(+), 20 deletions(-)

-----------------------------------------------------------------------
diff --git a/doc/guide/bind10-guide.xml b/doc/guide/bind10-guide.xml
index 1be98f9..88425e2 100644
--- a/doc/guide/bind10-guide.xml
+++ b/doc/guide/bind10-guide.xml
@@ -7,7 +7,7 @@
 ]>
 
 <!--
- - Copyright (C) 2010-2013  Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2010-2014  Internet Systems Consortium, Inc. ("ISC")
  -
  - Permission to use, copy, modify, and/or distribute this software for any
  - purpose with or without fee is hereby granted, provided that the above
@@ -3928,7 +3928,7 @@ Dhcp4/subnet4	[]	list	(default)
       <para>
         The following commands override the global
         DNS servers option for a particular subnet, setting a single DNS
-        server with address 2001:db8:1::3.
+        server with address 192.0.2.3.
         <screen>
 > <userinput>config add Dhcp4/subnet4[0]/option-data</userinput>
 > <userinput>config set Dhcp4/subnet4[0]/option-data[0]/name "domain-name-servers"</userinput>
@@ -4172,10 +4172,10 @@ Dhcp4/subnet4	[]	list	(default)
       primitives (uint8, string, ipv4-address etc): it is possible to
       define an option comprising a number of existing primitives.
       </para>
-      <para>Assume we
-      want to define a new option that will consist of an IPv4
-      address, followed by unsigned 16 bit integer, followed by a text
-      string. Such an option could be defined in the following way:
+      <para>Assume we want to define a new option that will consist of
+      an IPv4 address, followed by unsigned 16 bit integer, followed by
+      a boolean value, followed by a text string. Such an option could
+      be defined in the following way:
 <screen>
 > <userinput>config add Dhcp4/option-def</userinput>
 > <userinput>config set Dhcp4/option-def[0]/name "bar"</userinput>
@@ -4183,7 +4183,7 @@ Dhcp4/subnet4	[]	list	(default)
 > <userinput>config set Dhcp4/option-def[0]/space "dhcp4"</userinput>
 > <userinput>config set Dhcp4/option-def[0]/type "record"</userinput>
 > <userinput>config set Dhcp4/option-def[0]/array false</userinput>
-> <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, string"</userinput>
+> <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, boolean, string"</userinput>
 > <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
 </screen>
       The "type" is set to "record" to indicate that the option contains
@@ -4198,12 +4198,23 @@ Dhcp4/subnet4	[]	list	(default)
 > <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
 > <userinput>config set Dhcp4/option-data[0]/code 223</userinput>
 > <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
-> <userinput>config set Dhcp4/option-data[0]/data "192.0.2.100, 123, Hello World"</userinput>
+> <userinput>config set Dhcp4/option-data[0]/data "192.0.2.100, 123, true, Hello World"</userinput>
 > <userinput>config commit</userinput></screen>
-      </para>
       "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
       list of values.  The values in the "data" must correspond to the types set in
       the "record-types" field of the option definition.
+     </para>
+     <note>
+       <para>
+         It is recommended that boolean values are specified using "true" and "false"
+         strings. This helps to prevent errors when typing multiple comma separated
+         values, as it make it easier to identify the type of the value being typed,
+         and compare it with the order of data fields. Nevetheless, it is possible
+         to use integer values: "1" and "0", instead of "true" and "false"
+         accordingly. If other integer value is specified, the configuration is
+         rejected.
+       </para>
+     </note>
     </section>
 
     <section id="dhcp4-vendor-opts">
@@ -5067,10 +5078,10 @@ Dhcp6/subnet6/	list
       define an option comprising a number of existing primitives.
       </para>
       <para>
-      Assume we
-      want to define a new option that will consist of an IPv6
-      address, followed by unsigned 16 bit integer, followed by a text
-      string. Such an option could be defined in the following way:
+      Assume we want to define a new option that will consist of an IPv6
+      address, followed by an unsigned 16 bit integer, followed by a
+      boolean value, followed by a text string. Such an option could
+      be defined in the following way:
 <screen>
 > <userinput>config add Dhcp6/option-def</userinput>
 > <userinput>config set Dhcp6/option-def[0]/name "bar"</userinput>
@@ -5078,7 +5089,7 @@ Dhcp6/subnet6/	list
 > <userinput>config set Dhcp6/option-def[0]/space "dhcp6"</userinput>
 > <userinput>config set Dhcp6/option-def[0]/type "record"</userinput>
 > <userinput>config set Dhcp6/option-def[0]/array false</userinput>
-> <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, string"</userinput>
+> <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, boolean, string"</userinput>
 > <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
 </screen>
       The "type" is set to "record" to indicate that the option contains
@@ -5093,12 +5104,23 @@ Dhcp6/subnet6/	list
 > <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
 > <userinput>config set Dhcp6/option-data[0]/code 101</userinput>
 > <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
-> <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, Hello World"</userinput>
+> <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, false, Hello World"</userinput>
 > <userinput>config commit</userinput></screen>
-      </para>
       "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
       list of values.  The values in the "data" must correspond to the types set in
       the "record-types" field of the option definition.
+      </para>
+      <note>
+        <para>
+          It is recommended that boolean values are specified using "true" and "false"
+          strings. This helps to prevent errors when typing multiple comma separated
+          values, as it make it easier to identify the type of the value being typed,
+          and compare it with the order of data fields. Nevetheless, it is possible
+          to use integer values: "1" and "0", instead of "true" and "false"
+          accordingly. If other integer value is specified, the configuration is
+          rejected.
+        </para>
+      </note>
     </section>
 
     <section id="dhcp6-vendor-opts">
diff --git a/src/bin/dhcp4/tests/config_parser_unittest.cc b/src/bin/dhcp4/tests/config_parser_unittest.cc
index 6bf6bdf..167214a 100644
--- a/src/bin/dhcp4/tests/config_parser_unittest.cc
+++ b/src/bin/dhcp4/tests/config_parser_unittest.cc
@@ -1883,8 +1883,6 @@ TEST_F(Dhcp4ParserTest, optionDataBoolean) {
     uint8_t expected_option_data[] = {
         0x1
     };
-    testOption(desc, 19, expected_option_data, sizeof(expected_option_data));
-
     testConfiguration(params, 19, expected_option_data,
                       sizeof(expected_option_data));
 
diff --git a/src/bin/dhcp6/tests/config_parser_unittest.cc b/src/bin/dhcp6/tests/config_parser_unittest.cc
index fb8742a..0a47b43 100644
--- a/src/bin/dhcp6/tests/config_parser_unittest.cc
+++ b/src/bin/dhcp6/tests/config_parser_unittest.cc
@@ -2224,8 +2224,6 @@ TEST_F(Dhcp6ParserTest, optionDataBoolean) {
     uint8_t expected_option_data[] = {
         0x1
     };
-    testOption(desc, 1000, expected_option_data, sizeof(expected_option_data));
-
     testConfiguration(params, 1000, expected_option_data,
                       sizeof(expected_option_data));
 



More information about the bind10-changes mailing list