tools: nfdc help command

refs #3780

Change-Id: Ibd0e37bad127a38e582864fadd81afadc74baf48
diff --git a/docs/conf.py b/docs/conf.py
index 89dc2a0..2f81985 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -62,7 +62,7 @@
 
 # General information about the project.
 project = u'NFD - Named Data Networking Forwarding Daemon'
-copyright = u'2014, Named Data Networking Project'
+copyright = u'2014-2016, Named Data Networking Project'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -247,8 +247,11 @@
         u'NDN auto-configuration client', None, 1),
     ('manpages/ndn-autoconfig.conf', 'ndn-autoconfig.conf',
         u'NDN auto-configuration client configuration file', None, 5),
-    ('manpages/nfdc', 'nfdc',
-        u'NFD utility to manipulate the forwarding table (FIB)', None, 1),
+    ('manpages/nfdc', 'nfdc', u'show / manipulate NFD state and configuration', None, 1),
+    ('manpages/nfdc-status', 'nfdc-status', u'show NFD status', None, 1),
+    ('manpages/nfdc-face', 'nfdc-face', u'show and manipulate NFD faces', None, 1),
+    ('manpages/nfdc-route', 'nfdc-route', u'show and manipulate NFD routes', None, 1),
+    ('manpages/nfdc-strategy', 'nfdc-strategy', u'show and manipulate NFD strategy choices', None, 1),
     ('manpages/nfd-autoreg', 'nfd-autoreg', u'NFD Auto-registration Server', None, 1),
     ('manpages/nfd-status-http-server', 'nfd-status-http-server',
         u'NFD status HTTP server', None, 1),
diff --git a/docs/manpages.rst b/docs/manpages.rst
index 7207f34..0dd78eb 100644
--- a/docs/manpages.rst
+++ b/docs/manpages.rst
@@ -6,6 +6,10 @@
 .. toctree::
    manpages/nfd
    manpages/nfdc
+   manpages/nfdc-status
+   manpages/nfdc-face
+   manpages/nfdc-route
+   manpages/nfdc-strategy
    manpages/nfd-status
    schema
    manpages/nfd-status-http-server
diff --git a/docs/manpages/nfdc-face.rst b/docs/manpages/nfdc-face.rst
new file mode 100644
index 0000000..8233364
--- /dev/null
+++ b/docs/manpages/nfdc-face.rst
@@ -0,0 +1,51 @@
+nfdc-face
+=========
+
+SYNOPSIS
+--------
+| nfdc face [list]
+| nfdc channel [list]
+| nfdc create [-P] <faceUri>
+| nfdc destroy <faceId|faceUri>
+
+DESCRIPTION
+-----------
+In NFD, a face is the generalization of network interface.
+It could be a physical network interface to communicate on a physical link,
+an overlay communication channel between NFD and a remote node,
+or an inter-process communication channel between NFD and a local application.
+
+The **nfdc face list** command shows a list of faces, their properties, and statistics.
+
+The **nfdc channel list** command shows a list of channels.
+Channels are listening sockets that can accept incoming connections and create new faces.
+
+The **nfdc create** command creates a new UDP or TCP face.
+
+The **nfdc destroy** command destroys an existing face.
+It has no effect if the specified face does not exist.
+
+OPTIONS
+-------
+-P
+    Creates a "permanent" rather than persistent face.
+    A persistent face is closed when a socket error occrs.
+    A permanent face is kept alive upon socket errors,
+    and is closed only upon **nfdc destroy** command.
+
+<faceUri>
+    An URI representing the remote endpoint of a face.
+    Its syntax is:
+
+    - udp[4|6]://<IP-or-host>[:<port>]
+    - tcp[4|6]://<IP-or-host>[:<port>]
+
+    When a hostname is specified, a DNS query is used to obtain the IP address.
+
+<faceId>
+    Numerical identifier of the face.
+    It is displayed in the output of **nfdc face list** and **nfdc create** commands.
+
+SEE ALSO
+--------
+nfd(1), nfdc(1)
diff --git a/docs/manpages/nfdc-route.rst b/docs/manpages/nfdc-route.rst
new file mode 100644
index 0000000..b654f8f
--- /dev/null
+++ b/docs/manpages/nfdc-route.rst
@@ -0,0 +1,64 @@
+nfdc-route
+==========
+
+SYNOPSIS
+--------
+| nfdc route [list]
+| nfdc fib [list]
+| nfdc register [-I] [-C] [-c <cost>] [-e <expiration>] [-o <origin>] <prefix> <faceId|faceUri>
+| nfdc unregister [-o <origin>] <prefix> <faceId>
+
+DESCRIPTION
+-----------
+In NFD, the routing information base (RIB) stores static or dynamic routing information
+registered by applications, operators, and NFD itself.
+Each *route* in the RIB indicates that contents under a name prefix may be available via a nexthop.
+A route contains a name prefix, a nexthop face, the origin, a cost, and a set of route inheritance flags;
+refer to NFD Management protocol for more information.
+
+The **nfdc route list** command shows a list of routes in the RIB.
+
+The **nfdc fib list** command shows the forwarding information base (FIB),
+which is calculated from RIB routes and used directly by NFD forwarding.
+
+The **nfdc register** command adds a new route.
+If a route with the same prefix, nexthop, and origin already exists,
+it is updated with the specified cost, expiration, and route inheritance flags.
+
+The **nfdc unregister** command removes a route with matching prefix, nexthop, and origin.
+
+OPTIONS
+-------
+-I
+    Unset CHILD_INHERIT flag in the route.
+
+-C
+    Set CAPTURE flag in the route.
+
+-c <cost>
+    The administrative cost of the route.
+    The default is 0.
+
+-e <expiration>
+    Expiration time of the route, in milliseconds.
+    When the route expires, NFD removes it from the RIB.
+    The default is infinite, which keeps the route active until the nexthop face is destroyed.
+
+-o <origin>
+    Origin of the route, i.e. who is announcing the route.
+    The default is 255, indicating a static route.
+
+<prefix>
+    Name prefix of the route.
+
+<faceUri>
+    An URI representing the remote endpoint of a face.
+    It can be used in **nfdc register** to create a new UDP or TCP face.
+
+<faceId>
+    A numerical identifier of the face.
+    It is displayed in the output of **nfdc face list** and **nfdc create** commands.
+
+SEE ALSO
+--------
+nfd(1), nfdc(1)
diff --git a/docs/manpages/nfdc-status.rst b/docs/manpages/nfdc-status.rst
new file mode 100644
index 0000000..10d1078
--- /dev/null
+++ b/docs/manpages/nfdc-status.rst
@@ -0,0 +1,31 @@
+nfdc-status
+===========
+
+SYNOPSIS
+--------
+| nfdc status [show]
+| nfdc status report [<format>]
+
+DESCRIPTION
+-----------
+The **nfdc status show** command shows general status of NFD, including its version,
+uptime, data structure counters, and global packet counters.
+
+The **nfdc status report** command generates a comprehensive report of NFD status, including:
+
+- general status (individually available from **nfdc status show**)
+- list of channels (individually available from **nfdc channel list**)
+- list of faces (individually available from **nfdc face list**)
+- list of FIB entries (individually available from **nfdc fib list**)
+- list of RIB entries (individually available from **nfdc route list**)
+- list of strategy choices (individually available from **nfdc strategy list**)
+
+OPTIONS
+-------
+<format>
+    The format of NFD status report, either ``text`` or ``xml``.
+    The default is ``text``.
+
+SEE ALSO
+--------
+nfdc(1), nfdc-channel(1), nfdc-face(1), nfdc-fib(1), nfdc-route(1), nfdc-strategy(1)
diff --git a/docs/manpages/nfdc-strategy.rst b/docs/manpages/nfdc-strategy.rst
new file mode 100644
index 0000000..1f1c292
--- /dev/null
+++ b/docs/manpages/nfdc-strategy.rst
@@ -0,0 +1,44 @@
+nfdc-strategy
+=============
+
+SYNOPSIS
+--------
+| nfdc strategy [list]
+| nfdc set-strategy <prefix> <strategy>
+| nfdc unset-strategy <prefix>
+
+DESCRIPTION
+-----------
+In NFD, packet forwarding behavior is determined by forwarding pipelines and forwarding strategies.
+The forwarding pipelines define general steps of packet processing.
+Forwarding strategies provide the intelligence to make decision on whether, when, and where
+to forward Interests.
+
+NFD contains multiple forwarding strategy implementations.
+The strategy choice table determines which strategy is used in forwarding an Interest.
+
+The **nfdc strategy list** command shows the strategy choices.
+
+The **nfdc set-strategy** command sets the strategy for a name prefix.
+
+The **nfdc unset-strategy** command clears the strategy choice at a name prefix,
+so that a strategy choice at a shorter prefix or the default strategy will be used.
+It undoes a prior **nfdc set-strategy** command on the same name prefix.
+
+OPTIONS
+-------
+<prefix>
+    The name prefix of a strategy choice.
+    The strategy choice is effective for all Interests under the name prefix,
+    unless overridden by another strategy choice.
+    Specifying ``ndn:/`` as the prefix in **nfdc set-strategy** changes the default strategy.
+    Specifying ``ndn:/`` as the prefix in **nfdc unset-strategy** is disallowed,
+    because NFD must always have a default strategy.
+
+<strategy>
+    A name that identifies the forwarding strategy.
+    Consult NFD Developer's Guide for a complete list of all implemented strategies.
+
+SEE ALSO
+--------
+nfd(1), nfdc(1)