]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5680] User guide updated with new params
authorThomas Markwalder <tmark@isc.org>
Tue, 10 Jul 2018 19:32:57 +0000 (15:32 -0400)
committerTomek Mrugalski <tomasz@isc.org>
Fri, 27 Jul 2018 11:54:10 +0000 (13:54 +0200)
doc/guide/dhcp4-srv.xml
    Added discussion of new params to Dhcp4/dhcp-ddns section

src/lib/dhcpsrv/d2_client_cfg.h
    fixed missing params doxygen error

doc/guide/dhcp4-srv.xml
src/lib/dhcpsrv/d2_client_cfg.h

index 6fcb4dd7c6b6d6588aaa4e5cbd979af1d45fd20c..e09b543b64a680ee8ad69f5fa1cbf126e2a3e5f5 100644 (file)
@@ -2579,9 +2579,16 @@ It is merely echoed by the server
       <listitem><simpara>
       <command>"replace-client-name": "never"</command>
       </simpara></listitem>
+
       <listitem><simpara>
       <command>"generated-prefix": "myhost"</command>
       </simpara></listitem>
+      <listitem><simpara>
+      <command>"hostname-char-set": ""</command>
+      </simpara></listitem>
+      <listitem><simpara>
+      <command>"hostname-char-replacement": ""</command>
+      </simpara></listitem>
       </itemizedlist>
       </para>
 
@@ -2908,6 +2915,50 @@ It is merely echoed by the server
         myhost-172-16-1-10.example.com.
       </para>
       </section>
+      <section xml:id="host-name-sanitization">
+        <title>Sanitizing Client host names</title>
+        It may be that some of your DHCP clients provide values in the Host Name
+        option (Option code 12), that contain undesirable characters.  It is possible
+        to configure kea-dhcp4 to sanitize these values.  The most typical use case
+        would be ensuring that only characters that are permitted by RFC 1035 be included:
+        A-Z,a-z,0-9, and '-'.
+
+        This may be accomplished with following two parameters:
+        <itemizedlist>
+        <listitem><simpara>
+        <command>hostname-char-set</command> - a regular expression describing the
+        invalid character set.  This can be any valid, regular expression using
+        POSIX extended expression syntax.  For example, "[^A-Za-z0-9-]" would
+        replace any character other then the letters A through Z, a through, digits 0
+        through 9, and '-'.  If your clients include domain names, you will need to make
+        sure that the dot, '.', is included the your expression: "[^A-Za-z0-9.-]".
+        The default value is an empty string and disables sanitization.
+        </simpara></listitem>
+        <listitem><simpara>
+        <command>hostname-char-replacement</command> - a string of zero or more characters
+        with which to replace each invalid character in the host name.  The default value
+        is an empty string and will cause invalid characters to be OMITTED rather than
+        replaced.
+        </simpara></listitem>
+        </itemizedlist>
+        The following configuration, will replace anything other than a letter, digit,
+        hyphen, or dot with the letter 'x':
+<screen>
+"Dhcp4": {
+    "dhcp-ddns": {
+        "hostname-char-set": "[^A-Za-z0-9.-]",
+        "hostname-char-replacement": "x",
+        ...
+    },
+    ...
+}
+</screen>
+        Thus, a client supplied value of "myhost-$[123.org" would become "myhost-xx123.org"
+        Note that sanitization is peformed only on the portion of the name supplied by the
+        Host Name option, and that this is done before applying the qualifying suffix (if
+        one is defined).
+      </section>
+
     </section>
 
     <section xml:id="dhcp4-next-server">
index e69015388f9a527885903379ce21e0249037e0a5..c4bb250400b1a4bc1a72df140bd535fc495b891c 100644 (file)
@@ -99,6 +99,10 @@ public:
     /// supplied by the client with a generated name.
     /// @param generated_prefix Prefix to use when generating domain-names.
     /// @param qualifying_suffix Suffix to use to qualify partial domain-names.
+    /// @param hostname_char_set regular expression string which describes invalid
+    /// characters to be scrubbed from client host names 
+    /// @param hostname_char_replacement string of zero or more characters to
+    /// replace invalid chars when sanitizing client host names
     ///
     /// @c enable_updates is mandatory, @c qualifying_suffix is mandatory
     /// when updates are enabled, other parameters are optional.