]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[30-implement-control-socket-for-ddns-2] Reported doc updates
authorFrancis Dupont <fdupont@isc.org>
Thu, 27 Dec 2018 23:09:53 +0000 (00:09 +0100)
committerFrancis Dupont <fdupont@isc.org>
Thu, 3 Jan 2019 09:05:03 +0000 (04:05 -0500)
doc/examples/agent/simple.json
doc/examples/ddns/comments.json
doc/examples/ddns/sample1.json
doc/examples/ddns/template.json
doc/guide/agent.xml
doc/guide/ctrl-channel.xml
doc/guide/ddns.xml

index 15be619f690d48c2c87033f2174ee2d17cba47cd..b64a647a62f01a5e4a7acb295623e89b59f0cb88 100644 (file)
@@ -42,9 +42,7 @@
                 "socket-name": "/path/to/the/unix/socket-v6"
             },
 
-            // Currently DHCP-DDNS (nicknamed D2) does not support
-            // command channel yet, but we hope this will change in the
-            // future.
+            // Location of the D2 command channel socket.
             "d2":
             {
                 "socket-type": "unix",
index 44a28b83642769a26deea8907cd3a2bdd95dd3fb..f97005b0986a4943d6ced4141e7e39cd2cb0a661 100644 (file)
     "port": 53001,
     "dns-server-timeout" : 1000,
 
+    "control-socket":
+    {
+        "comment": "Control channel",
+        "socket-type": "unix",
+        "socket-name": "/tmp/d2-ctrl-socket"
+    },
+
     "forward-ddns":
     {
         "ddns-domains":
index a413dc6e1b0295d042b3224b4501856c5bf5fe52..890fc08adf1783ba4dee273e59cf5e91106da6a1 100644 (file)
 
     "user-context": { "version": 1 },
 
+//
+// ----------------- Control Socket -----------------
+//
+
+    "control-socket":
+    {
+        "socket-type": "unix",
+        "socket-name": "/tmp/d2-ctrl-socket"
+    },
 
 //
 // ----------------- Forward DDNS  ------------------
index c11f5b38e4f66ba126f6975d8425cd4cd079acb5..a3024bf364d527acc3c6965c1d46d0d2a26da175 100644 (file)
 //    "ncr-protocol" : "UDP"
 //    "ncr-format" : "JSON"
 
+//
+// ----------------- Control Socket -----------------
+//
+
+//    "control-socket":
+//    {
+//        "socket-type": "unix",
+//        "socket-name": "/tmp/d2-ctrl-socket"
+//    },
+
 //
 // ----------------- Forward DDNS  ------------------
 //
index 6a45c84353db49569def535581eead6a0e0c36cd..e11b8a42ec92378842d7d286626c542fc14d8cb4 100644 (file)
                 "socket-type": "unix",
                 "socket-name": "/path/to/the/unix/socket-v6",
                 "user-context": { "version": 3 }
-            }
+            },
+            "d2": {
+                "socket-type": "unix",
+                "socket-name": "/path/to/the/unix/socket-d2"
+            },
         },
 
         "hooks-libraries": [
       commands to it. Obviously, the DHCPv4 server must be configured to
       listen to connections via this same socket. In other words, the command
       socket configuration for the DHCPv4 server and CA (for this server)
-      must match. Consult the <xref linkend="dhcp4-ctrl-channel"/> and the
-      <xref linkend="dhcp6-ctrl-channel"/> to learn how the socket
-      configuration is specified for the DHCPv4 and DHCPv6 services.
+      must match. Consult the <xref linkend="dhcp4-ctrl-channel"/>, the
+      <xref linkend="dhcp6-ctrl-channel"/> and
+      <xref linkend="d2-ctrl-channel"/> to learn how the socket
+      configuration is specified for the DHCPv4, DHCPv6 and D2 services.
     </para>
 
     <warning>
index 0fdf8e83408b178ccd9aa56359f047b6fddbcaec..213d80db97503ee7e3d7cfd9752d30b5ce941847 100644 (file)
     the server may refuse to start, which will further extend the
     downtime period until the issue is resolved.</para>
 
-    <para>To avoid such problems, both the DHCPv4 and DHCPv6 servers
+    <para>To avoid such problems, the DHCPv4, DHCPv6 and D2 servers
     include support for a mechanism that allows
     on-line reconfiguration without requiring server shutdown.
     Both servers can be instructed to open control sockets, which
     is a communication channel. The server is able to receive
     commands on that channel, act on them and report back status.</para>
 
-    <para>The DHCPv4 and DHCPv6 servers receive commands over the
+    <para>The DHCPv4, DHCPv6 and D2 servers receive commands over the
     unix domain sockets. The details how to configure these sockets,
     see <xref linkend="dhcp4-ctrl-channel"/> and <xref linkend="dhcp6-ctrl-channel"/>. While it is possible control
     the servers directly using unix domain sockets it requires that
@@ -613,6 +613,36 @@ $ curl -X POST -H "Content-Type: application/json" -d '{ "command": "config-get"
 
     </section> <!-- end of commands supported by both servers -->
 
+    <section>
+      <title>Commands Supported by D2 Server</title>
+      <para>The D2 server supports only a subset of DHCPv4 / DHCPv6 server
+      commands:
+      <itemizedlist>
+        <listitem>
+          <simpara>build-report</simpara>
+        </listitem>
+        <listitem>
+          <simpara>config-get</simpara>
+        </listitem>
+        <listitem>
+          <simpara>config-test</simpara>
+        </listitem>
+        <listitem>
+          <simpara>config-write</simpara>
+        </listitem>
+        <listitem>
+          <simpara>list-commands</simpara>
+        </listitem>
+        <listitem>
+          <simpara>shutdown</simpara>
+        </listitem>
+        <listitem>
+          <simpara>version-get</simpara>
+        </listitem>
+      </itemizedlist>
+      </para>
+    </section>
+
     <section xml:id="agent-commands">
       <title>Commands Supported by Control Agent</title>
       <para>The following commands listed in <xref linkend="commands-common"/>
index 2bde0a43b506b6a4a34dd57a88cdfd2e5246caee..fd2e5bc7219f877f60a0bd80122891749b050016 100644 (file)
@@ -238,6 +238,11 @@ strings <userinput>path</userinput>/kea-dhcp-ddns | sed -n 's/;;;; //p'
         <emphasis>Global Server Parameters</emphasis> - values which control connectivity and global server behavior
             </simpara>
           </listitem>
+          <listitem>
+            <simpara>
+              <emphasis>Control Socket</emphasis> - defines the Control Socket type and name.
+            </simpara>
+          </listitem>
           <listitem>
             <simpara>
               <emphasis>TSIG Key Info</emphasis> - defines the TSIG keys used for secure traffic with DNS servers
@@ -320,6 +325,57 @@ corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
 </note>
       </section> <!-- "d2-server-parameter-config" -->
 
+      <section xml:id="d2-ctrl-channel">
+        <title>Management API for the D2 Server</title>
+        <para>
+          The management API allows the issuing of specific management
+          commands, such as configuration retrieval or shutdown.
+          For more details, see <xref linkend="ctrl-channel"/>.
+          Currently the only supported communication channel type is UNIX
+          stream socket. By default there are no sockets open. To instruct
+          Kea to open a socket, the following entry in the configuration
+          file can be used:
+<screen>
+"DhcpDdns": {
+    "control-socket": {
+        "socket-type": "unix",
+        "socket-name": <userinput>"/path/to/the/unix/socket"</userinput>
+    },
+    ...
+}
+</screen>
+        </para>
+
+        <para>
+          The length of the path specified by
+          the <command>socket-name</command> parameter is restricted by
+          the maximum length for the unix socket name on your operating
+          system, i.e. the size of the <command>sun_path</command> field
+          in the <command>sockaddr_un</command> structure, decreased by 1.
+          This value varies on different operating systems between
+          91 and 107 characters. Typical values are 107 on Linux and 103
+          on FreeBSD.
+        </para>
+
+        <para>
+          Communication over control channel is conducted using JSON
+          structures.  See the Control Channel section in the Kea
+          Developer's Guide for more details.
+        </para>
+
+        <para>The D2 server supports the following operational commands:
+          <itemizedlist>
+              <listitem>build-report</listitem>
+              <listitem>config-get</listitem>
+              <listitem>config-test</listitem>
+              <listitem>config-write</listitem>
+              <listitem>list-commands</listitem>
+              <listitem>shutdown</listitem>
+              <listitem>version-get</listitem>
+          </itemizedlist>
+        </para>
+      </section> <!-- "d2-ctrl-channel" -->
+
       <section xml:id="d2-tsig-key-list-config">
         <title>TSIG Key List</title>
         <para>