<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
               "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
	       [<!ENTITY mdash "&#8212;">]>
<!--
 - Copyright (C) 2010-2012  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
 - copyright notice and this permission notice appear in all copies.
 -
 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 - PERFORMANCE OF THIS SOFTWARE.
-->

<refentry>

  <refentryinfo>
    <date>February 28, 2012</date>
  </refentryinfo>

  <refmeta>
    <refentrytitle>b10-cmdctl</refentrytitle>
    <manvolnum>8</manvolnum>
    <refmiscinfo>BIND10</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname>b10-cmdctl</refname>
    <refpurpose>BIND 10 remote control daemon</refpurpose>
<!-- TODO: is that okay? -->
  </refnamediv>

  <docinfo>
    <copyright>
      <year>2010-2012</year>
      <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
    </copyright>
  </docinfo>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>b10-cmdctl</command>

      <arg><option>-a <replaceable>string</replaceable></option></arg>
      <arg><option>-h</option></arg>
      <arg><option>-i <replaceable>number</replaceable></option></arg>
      <arg><option>-p <replaceable>number</replaceable></option></arg>
      <arg><option>-v</option></arg>
      <arg><option>--address <replaceable>string</replaceable></option></arg>
      <arg><option>--help</option></arg>
      <arg><option>--idle-timeout <replaceable>number</replaceable></option></arg>
      <arg><option>--port <replaceable>number</replaceable></option></arg>
      <arg><option>--verbose</option></arg>
      <arg><option>--version</option></arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>DESCRIPTION</title>
    <para>The <command>b10-cmdctl</command> daemon provides an entry
      for commands sent to the BIND 10 services.
      For example, the <command>bindctl</command> user interface
      communicates via <command>b10-cmdctl</command>.
    </para>

    <para>
      It is a lightweight HTTPS server with HTTP Digest Authentication
      (username and password validation).
      It offers a RESTful style interface.
<!-- TODO: document the RESTful APIs -->
    </para>
  </refsect1>

  <refsect1>
    <title>OPTIONS</title>
    
    <para>The arguments are as follows:</para>

    <variablelist>

      <varlistentry>
        <term><option>-a <replaceable>string</replaceable></option>,
          <option>--address <replaceable>string</replaceable></option></term>
        <listitem><para>
          The IP address that <command>b10-cmdctl</command> will listen on.
          The default is 127.0.0.1.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-h</option>,
          <option>--help</option></term>
        <listitem><para>
          Display command usage.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-i <replaceable>number</replaceable></option>,
          <option>--idle-timeout <replaceable>number</replaceable></option></term>
        <listitem><para>
          The socket idle timeout for the HTTPS connection in seconds.
          The default is 1200 seconds.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-p <replaceable>number</replaceable></option>,
          <option>--port <replaceable>number</replaceable></option></term>
        <listitem><para>
          The port number <command>b10-cmdctl</command> will listen on.
          The default is 8080.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-v</option></term>
        <term><option>--verbose</option></term>
        <listitem><para>
          Enable verbose mode.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>
          <option>--version</option></term>
        <listitem><para>
          Display the version number and exit.</para>
        </listitem>
      </varlistentry>
    </variablelist>

  </refsect1>

  <refsect1>
    <title>CONFIGURATION AND COMMANDS</title>
    <para>
      The configurable settings are:
    </para>

    <para>
      <varname>accounts_file</varname> defines the path to the
      user accounts database.
      The default is
      <filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>.
    </para>

    <para>
      <varname>cert_file</varname> defines the path to the
      PEM certificate file.
      The default is
      <filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>.
    </para>

    <para>
      <varname>key_file</varname> defines the path to the PEM private key
      file.
      The default is
      <filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>.
    </para>

<!-- TODO: formating -->
    <para>
      The configuration command is:
    </para>

<!-- NOTE: print_settings is not documented since I think will be removed -->

    <para>
      <command>shutdown</command> exits <command>b10-cmdctl</command>.
      This has an optional <varname>pid</varname> argument to
      select the process ID to stop.
      (Note that the BIND 10 boss process may restart this service
      if configured.)
    </para>

  </refsect1>

  <refsect1>
    <title>FILES</title>
<!-- TODO: replace /usr/local -->
<!-- TODO: permissions -->
<!-- TODO: what about multiple accounts? -->
<!-- TODO: shouldn't the password file name say cmdctl in it? -->
    <para><filename>/usr/local/etc/bind10-devel/cmdctl-accounts.csv</filename>
      &mdash; account database containing the name, hashed password,
      and the salt.
    </para>
<!-- TODO: replace /usr/local -->
<!-- TODO: permissions -->
<!-- TODO: shouldn't have both in same file, will be configurable -->
    <para><filename>/usr/local/etc/bind10-devel/cmdctl-keyfile.pem</filename>
      &mdash; contains the Private key.
    </para>
    <para><filename>/usr/local/etc/bind10-devel/cmdctl-certfile.pem</filename>
      &mdash; contains the Certificate.
    </para>
  </refsect1>

  <refsect1>
    <title>SEE ALSO</title>
    <para>
      <citerefentry>
        <refentrytitle>b10-cfgmgr</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
        <refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
        <refentrytitle>bindctl</refentrytitle><manvolnum>1</manvolnum>
      </citerefentry>.
    </para>
  </refsect1>

  <refsect1>
    <title>AUTHORS</title>
    <para>
      The <command>b10-cmdctl</command> daemon was initially designed
      and coded by Zhang Likun of CNNIC.
    </para>
  </refsect1>
</refentry><!--
 - Local variables:
 - mode: sgml
 - End:
-->
