def registerRoute(node, namePrefix, remoteNodeAddress, protocol=PROTOCOL_UDP, origin=255, cost=0, inheritFlag=True, captureFlag=False, expirationInMillis=None): cmd = ('nfdc route add {} {}://{} origin {} cost {} {}{}{}').format( namePrefix, protocol, remoteNodeAddress, origin, cost, 'no-inherit ' if not inheritFlag else '', 'capture ' if captureFlag else '', 'expires {}'.format(expirationInMillis) if expirationInMillis else '') debug(node.cmd(cmd)) Minindn.sleep(SLEEP_TIME)
def start(self): Application.start(self, 'mw-nfd --config {}'.format(self.confFile), logfile=self.logFile) Minindn.sleep(2)
def start(self): self.createFaces() Application.start(self, 'nlsr -f {}'.format(self.confFile), self.logFile, self.envDict) Minindn.sleep(1)
def unsetStrategy(node, namePrefix): debug(node.cmd("nfdc strategy unset {}".format(namePrefix))) Minindn.sleep(SLEEP_TIME)
def setStrategy(node, namePrefix, strategy): cmd = 'nfdc strategy set {} ndn:/localhost/nfd/strategy/{}'.format( namePrefix, strategy) debug(node.cmd(cmd)) Minindn.sleep(SLEEP_TIME)
def destroyFace(node, remoteNodeAddress, protocol='udp'): debug( node.cmd('nfdc face destroy {}://{}'.format( protocol, remoteNodeAddress))) Minindn.sleep(SLEEP_TIME)
def createFace(node, remoteNodeAddress, protocol='udp', isPermanent=False): cmd = ('nfdc face create {}://{} {}'.format( protocol, remoteNodeAddress, 'permanent' if isPermanent else 'persistent')) debug(node.cmd(cmd)) Minindn.sleep(SLEEP_TIME)
def unregisterRoute(node, namePrefix, remoteNodeAddress, origin=255): cmd = 'nfdc route remove {} {} {}'.format(namePrefix, remoteNodeAddress, origin) debug(node.cmd(cmd)) Minindn.sleep(SLEEP_TIME)