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)
Exemple #2
0
 def start(self):
     Application.start(self,
                       'mw-nfd --config {}'.format(self.confFile),
                       logfile=self.logFile)
     Minindn.sleep(2)
Exemple #3
0
 def start(self):
     self.createFaces()
     Application.start(self, 'nlsr -f {}'.format(self.confFile), self.logFile, self.envDict)
     Minindn.sleep(1)
Exemple #4
0
 def unsetStrategy(node, namePrefix):
     debug(node.cmd("nfdc strategy unset {}".format(namePrefix)))
     Minindn.sleep(SLEEP_TIME)
Exemple #5
0
 def setStrategy(node, namePrefix, strategy):
     cmd = 'nfdc strategy set {} ndn:/localhost/nfd/strategy/{}'.format(
         namePrefix, strategy)
     debug(node.cmd(cmd))
     Minindn.sleep(SLEEP_TIME)
Exemple #6
0
 def destroyFace(node, remoteNodeAddress, protocol='udp'):
     debug(
         node.cmd('nfdc face destroy {}://{}'.format(
             protocol, remoteNodeAddress)))
     Minindn.sleep(SLEEP_TIME)
Exemple #7
0
 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)
Exemple #8
0
 def unregisterRoute(node, namePrefix, remoteNodeAddress, origin=255):
     cmd = 'nfdc route remove {} {} {}'.format(namePrefix,
                                               remoteNodeAddress, origin)
     debug(node.cmd(cmd))
     Minindn.sleep(SLEEP_TIME)