ndn/apps: add global routing helper
Change-Id: Id2bfb035424e2214d3dad1d00da95a0715c716c9
diff --git a/ndn/apps/nfdc.py b/ndn/apps/nfdc.py
index e5ed6cc..e772a42 100644
--- a/ndn/apps/nfdc.py
+++ b/ndn/apps/nfdc.py
@@ -22,7 +22,9 @@
# If not, see <http://www.gnu.org/licenses/>.
import time
-from mininet.log import setLogLevel, output, info, debug
+from mininet.log import debug
+
+SLEEP_TIME = 0.2
class Nfdc:
STRATEGY_ASF = "asf"
@@ -48,13 +50,13 @@
)
debug(node.cmd(cmd))
- time.sleep(0.5)
+ time.sleep(SLEEP_TIME)
@staticmethod
def unregisterRoute(node, namePrefix, remoteNodeAddress, origin=255):
cmd = "nfdc route remove {} {} {}".format(namePrefix, remoteNodeAddress, origin)
debug(node.cmd(cmd))
- time.sleep(0.5)
+ time.sleep(SLEEP_TIME)
@staticmethod
def createFace(node, remoteNodeAddress, protocol="udp", isPermanent=False):
@@ -64,20 +66,20 @@
"permanent" if isPermanent else "persistent"
))
debug(node.cmd(cmd))
- time.sleep(0.5)
+ time.sleep(SLEEP_TIME)
@staticmethod
def destroyFace(node, remoteNodeAddress, protocol="udp"):
debug(node.cmd("nfdc face destroy {}://{}".format(protocol, remoteNodeAddress)))
- time.sleep(0.5)
+ time.sleep(SLEEP_TIME)
@staticmethod
def setStrategy(node, namePrefix, strategy):
cmd = "nfdc strategy set {} ndn:/localhost/nfd/strategy/{}".format(namePrefix, strategy)
debug(node.cmd(cmd))
- time.sleep(0.5)
+ time.sleep(SLEEP_TIME)
@staticmethod
def unsetStrategy(node, namePrefix):
debug(node.cmd("nfdc strategy unset {}".format(namePrefix)))
- time.sleep(0.5)
\ No newline at end of file
+ time.sleep(SLEEP_TIME)
\ No newline at end of file