Add enable-local-control and disable-local-control commands
diff --git a/src/main/java/com/intel/jndn/management/NFD.java b/src/main/java/com/intel/jndn/management/NFD.java
index 58d5d70..026faca 100644
--- a/src/main/java/com/intel/jndn/management/NFD.java
+++ b/src/main/java/com/intel/jndn/management/NFD.java
@@ -17,6 +17,7 @@
import com.intel.jndn.management.types.ControlResponse;
import com.intel.jndn.management.types.FaceStatus;
import com.intel.jndn.management.types.FibEntry;
+import com.intel.jndn.management.types.LocalControlHeader;
import com.intel.jndn.management.types.RibEntry;
import com.intel.jndn.utils.Client;
import com.intel.jndn.utils.SegmentedClient;
@@ -232,6 +233,46 @@
}
/**
+ * Enable a local control feature on the given forwarder. See
+ * http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Enable-a-LocalControlHeader-feature
+ *
+ * @param forwarder
+ * @param header
+ * @return
+ * @throws Exception
+ */
+ public static boolean enableLocalControlHeader(Face forwarder, LocalControlHeader header) throws Exception {
+ // build command name
+ Name command = new Name("/localhost/nfd/faces/enable-local-control");
+ ControlParameters parameters = new ControlParameters();
+ parameters.setLocalControlFeature(header.getNumericValue());
+ command.append(parameters.wireEncode());
+
+ // send command and return
+ return sendCommandAndErrorCheck(forwarder, new Interest(command));
+ }
+
+ /**
+ * Disable a local control feature on the given forwarder. See
+ * http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Disable-a-LocalControlHeader-feature
+ *
+ * @param forwarder
+ * @param header
+ * @return
+ * @throws Exception
+ */
+ public static boolean disableLocalControlHeader(Face forwarder, LocalControlHeader header) throws Exception {
+ // build command name
+ Name command = new Name("/localhost/nfd/faces/disable-local-control");
+ ControlParameters parameters = new ControlParameters();
+ parameters.setLocalControlFeature(header.getNumericValue());
+ command.append(parameters.wireEncode());
+
+ // send command and return
+ return sendCommandAndErrorCheck(forwarder, new Interest(command));
+ }
+
+ /**
* Register a route on the forwarder; see
* http://named-data.net/doc/NFD/current/manpages/nfdc.html for command-line
* usage and http://redmine.named-data.net/projects/nfd/wiki/RibMgmt for