tools: nfdc route add command

This commit also simplifies 'nfdc face destroy' and its test case.

'nfdc register' is deprecated in favor of 'nfdc route add'.

refs #3866

Change-Id: I1de5cc0bc956d57b0793da920c1e87b3580a3297
diff --git a/docs/manpages/nfdc-route.rst b/docs/manpages/nfdc-route.rst
index a7c7f2a..7b01c44 100644
--- a/docs/manpages/nfdc-route.rst
+++ b/docs/manpages/nfdc-route.rst
@@ -5,7 +5,8 @@
 --------
 | nfdc route [list]
 | nfdc fib [list]
-| nfdc register [-I] [-C] [-c <COST>] [-e <EXPIRATION>] [-o <ORIGIN>] <PREFIX> <FACEID|FACEURI>
+| nfdc route add [prefix] <PREFIX> [nexthop] <FACEID|FACEURI> [origin <ORIGIN>] [cost <COST>]
+|   [no-inherit] [capture] [expires <EXPIRATION-MILLIS>]
 | nfdc unregister [-o <ORIGIN>] <PREFIX> <FACEID>
 
 DESCRIPTION
@@ -21,43 +22,59 @@
 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.
+The **nfdc route add** command requests to add a 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.
+it is updated with the specified cost, route inheritance flags, and expiration period.
+This command returns when the request has been accepted, but does not wait for RIB update completion.
 
 The **nfdc unregister** command removes a route with matching prefix, nexthop, and origin.
 
 OPTIONS
 -------
--I
-    Unset CHILD_INHERIT flag in the route.
+<PREFIX>
+    Name prefix of the route.
 
--C
-    Set CAPTURE flag in the route.
+<FACEID>
+    Numerical identifier of the face.
+    It is displayed in the output of **nfdc face list** and **nfdc face create** commands.
 
--c <COST>
+<FACEURI>
+    An URI representing the remote endpoint of a face.
+    It must uniquely match an existing face.
+
+<ORIGIN>
+    Origin of the route, i.e. who is announcing the route.
+    The default is 255, indicating a static route.
+
+<COST>
     The administrative cost of the route.
     The default is 0.
 
--e <EXPIRATION>
+no-inherit
+    Unset CHILD_INHERIT flag in the route.
+
+capture
+    Set CAPTURE flag in the route.
+
+<EXPIRATION-MILLIS>
     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.
+EXIT CODES
+----------
 
-<PREFIX>
-    Name prefix of the route.
+0: Success
 
-<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.
+1: An unspecified error occurred
 
-<FACEID>
-    A numerical identifier of the face.
-    It is displayed in the output of **nfdc face list** and **nfdc face create** commands.
+2: Malformed command line
+
+3: Face not found (**nfdc route add** only)
+
+4: FaceUri canonization failed (**nfdc route add** only)
+
+5: Ambiguous: multiple matching faces are found (**nfdc route add** only)
 
 SEE ALSO
 --------