<!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>June 20, 2012</date>
  </refentryinfo>

  <refmeta>
    <refentrytitle>bindctl</refentrytitle>
    <manvolnum>1</manvolnum>
    <refmiscinfo>BIND10</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname>bindctl</refname>
    <refpurpose>control and configure BIND 10</refpurpose>
  </refnamediv>

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

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>bindctl</command>
      <arg><option>-a <replaceable>address</replaceable></option></arg>
      <arg><option>-h</option></arg>
      <arg><option>-c <replaceable>file</replaceable></option></arg>
      <arg><option>-p <replaceable>number</replaceable></option></arg>
      <arg><option>--address <replaceable>address</replaceable></option></arg>
      <arg><option>--help</option></arg>
      <arg><option>--certificate-chain <replaceable>file</replaceable></option></arg>
      <arg><option>--csv-file-dir<replaceable>file</replaceable></option></arg>
      <arg><option>--port <replaceable>number</replaceable></option></arg>
      <arg><option>--version</option></arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>DESCRIPTION</title>
    <para>
      The <command>bindctl</command> tool is a user interface to
      the BIND 10 services.  The program can be used to control
      the components and configure the BIND 10 options.  The options
      may be specified
<!-- TODO: as command-line arguments, or --> via its
      interactive command interpreter.
    </para>

    <para>
      <command>bindctl</command> communicates over a HTTPS REST-ful
      interface provided by
      <citerefentry><refentrytitle>b10-cmdctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
      The
<citerefentry><refentrytitle>b10-cfgmgr</refentrytitle><manvolnum>8</manvolnum></citerefentry>
      daemon stores the configurations.
    </para>

  </refsect1>

  <refsect1>
    <title>ARGUMENTS</title>

    <para>The arguments are as follows:</para>

    <variablelist>

      <varlistentry>
        <term><option>-a</option> <replaceable>address</replaceable>, <option>--address</option> <replaceable>address</replaceable></term>

        <listitem>
          <para>The IPv4 or IPv6 address to use to connect to the running
            <citerefentry><refentrytitle>b10-cmdctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
            daemon.
            The default is 127.0.0.1.
          </para>
         </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-c</option> <replaceable>file</replaceable>,
        <option>--certificate-chain</option> <replaceable>file</replaceable></term>

        <listitem>
          <para>The PEM formatted server certificate validation chain file.
          </para>
<!-- TODO: any default? -->
<!-- TODO: any way to choose this for cmdctl? -->
         </listitem>
      </varlistentry>

      <varlistentry>
        <term>
	  <option>--csv-file-dir</option><replaceable>file</replaceable>
	</term>

        <listitem>
          <para>
	    The directory name in which the user/password CSV file
            is stored (see AUTHENTICATION).
	    By default this option doesn't have any value,
	    in which case the "<filename>.bind10</filename>" directory
            under the user's home directory will be used.
          </para>
         </listitem>
      </varlistentry>

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

      <varlistentry>
        <term><option>-p</option> <replaceable>number</replaceable>, <option>--port</option> <replaceable>number</replaceable></term>

        <listitem>
          <para>The port number to use to connect to the running
            <citerefentry><refentrytitle>b10-cmdctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
            daemon.
            The default is 8080.</para>
<!-- TODO: -->
            <note><simpara>This default port number may change.</simpara></note>
         </listitem>
      </varlistentry>

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

    </variablelist>

  </refsect1>

  <refsect1>
    <title>AUTHENTICATION</title>

    <para>
      The tool will authenticate using a username and password.
      On the first successful login, it will save the details to
      a comma-separated-value (CSV) file
      which will be used for later uses of <command>bindctl</command>.
      The file name is "<filename>default_user.csv</filename>"
      located under the directory specified by the
      <option>--csv-file-dir</option> option.
    </para>

<!-- TODO: mention HTTPS? -->

  </refsect1>

  <refsect1>
    <title>USAGE</title>

    <para>
      The <command>bindctl</command> prompt shows
      <quote>&gt; </quote>.
       The prompt will also display the location if changed.
       The options are based on the module in use.
       The usage is:
       <command>module</command> <command>command</command> <replaceable>param1 = value1 , <replaceable>param2 = value2</replaceable></replaceable>
     </para>

     <para>
       <command>bindctl</command>'s
       interactive interface provides command-line completion and
       hints.  Press the Tab key to get a hint for the module,
       command, and/or parameters.
<!-- TODO: no hints at a blank line though ? -->

      The arrow keys and Emacs-style editing keys may be used to edit
      and recall previous lines.
<!-- TODO:  all Emacs-style editing keys? -->
     </para>

     <para>
       You can use the <command>help</command>
       keyword to receive usage assistance for a module or a module's
       command.
     </para>

     <para>
       The <command>quit</command>
       command is used to exit
       <command>bindctl</command>.
       (It doesn't stop the BIND 10 services.)
     </para>

     <para>
       The following module is available by default:
       <command>config</command> for Configuration commands.
<!-- TODO: or is config from the cfgmgr module? -->
       Additional modules may be available, such as
       <command>Boss</command>, <command>Xfrin</command>, and
       <command>Auth</command>.
     </para>

<!--
.Sh CONFIGURATION COMMANDS
The following configuration commands are recognized by
.Nm :
.Bl -tag -width Ic
.It Ic add Ar identifier Ar value
Add a value to a list.
.\" TODO: explain better
.\" TODO: define list, map, others ...
.\" TODO: why the value?
.It Ic commit
Commit all local changes.
.\" TODO: what does this do?
.It Ic go Ar identifier
Go to the specified location within the configuration.
.\" TODO: explain this
.It Ic help
Get help for the
.Em config
module.
.It Ic remove Ar identifier Ar value
Remove a value from a list.
.\" TODO: why the value?
.It Ic revert
Revert all local changes (that have not been committed).
.\" TODO: what does this do?
.It Ic set Ar identifier Ar value
Set a configuration value.
.\" TODO
.It Ic show Op Ar identifier.
.\" TODO
Show the currently set configuration values.
If no
.Ar identifier
is given, the current location is used (as set by the
.Ic go
command).
If a config option is a list or a map, the value is not
shown directly, but must be requested separately.
.\" TODO: example of this list or map
.It Ic unset Ar identifier
Remove a configuration value.
If the option is mandatory, it will reset to the default value.
.\" TODO: how to know default values before?
.El
.\" This manual page only covers builtin commands.
.\" .Sh PARKINGLOT COMMANDS
.\" .Bl -tag -width Ic
.\" .It Ic help
.\" Get help for the
.\" .Em ParkingLot
.\" module.
.\"
.\" TODO: Command arguments which have embedded spaces may be quoted with
.\" quote
.\" .Sq \&"
.\" marks.
.Pp
.Pp command-line editing?
.Pp
.Sh EXAMPLES
The following are some
.Nm
examples:
.Bl -tag -width abcde
.It Ic "config help"
Show the commands for the
.Em config
module.
.It Ic "config go ParkingLot/"
Go to the
.Dq ParkingLot/
configuration location.
-->

  </refsect1>

<!-- TODO: any options? -->

  <refsect1>
    <title>SEE ALSO</title>
    <para>
      <citerefentry>
        <refentrytitle>b10-auth</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
        <refentrytitle>b10-cfgmgr</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
        <refentrytitle>b10-cmdctl</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
        <refentrytitle>b10-xfrin</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
        <refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citetitle>BIND 10 Guide</citetitle>.
    </para>
<!-- TODO: point to developer docs -->
  </refsect1>

  <refsect1>
    <title>AUTHORS</title>
    <para>
      The <command>bindctl</command>
      tool and library were initially coded by Zhang Likun of CNNIC
      for the BIND 10 project.
      The initial manual page was written by Jeremy C. Reed of ISC.
    </para>
  </refsect1>

  <refsect1>
    <title>HISTORY</title>
    <para>
       The initial version (with internal name of
       <command>BigTool</command>)
       was started in October 2009.
    </para>
  </refsect1>

</refentry><!--
 - Local variables:
 - mode: sgml
 - End:
-->

