nfdc: support for specifying Origin in unregister command.
refs #1688
Change-Id: I8fb42eb4935902f59991c66c0a0fff33dccea4d3
diff --git a/docs/manpages/nfdc.rst b/docs/manpages/nfdc.rst
index 55b7ee0..9de9e0c 100644
--- a/docs/manpages/nfdc.rst
+++ b/docs/manpages/nfdc.rst
@@ -59,9 +59,12 @@
``unregister``
Unregister an existing routing entry from Routing Information Base (RIB).
- ``unregister <prefix> <faceId>``
+ ``unregister [-o origin] <prefix> <faceId>``
- ``prefix``
+ ``-o <origin>``
+ Origin of the unregistration request (default is 255).
+
+ ``prefix``
A prefix of an existing RIB entry, from which routing entry is requested to be
removed.
diff --git a/tools/nfdc.cpp b/tools/nfdc.cpp
index 3534917..a410c7a 100644
--- a/tools/nfdc.cpp
+++ b/tools/nfdc.cpp
@@ -47,7 +47,7 @@
" -e: specify expiring time in ms\n"
" -o: specify origin\n"
" 0 for Local producer applications, 128 for NLSR, 255 for static routes\n"
- " unregister name <faceId>\n"
+ " unregister [-o origin] name <faceId>\n"
" unregister name from the given faceId\n"
" create <faceUri> \n"
" Create a face in one of the following formats:\n"
@@ -286,7 +286,8 @@
ControlParameters parameters;
parameters
.setName(m_name)
- .setFaceId(m_faceId);
+ .setFaceId(m_faceId)
+ .setOrigin(m_origin);
m_controller.start<RibUnregisterCommand>(parameters,
bind(&Nfdc::onSuccess, this, _1,