daemon/core/broker.py
def addtunnel(self, remoteip, n1num, n2num, localnum):
        ''' Add a new GreTapBridge between nodes on two different machines.
        '''
        key = self.tunnelkey(n1num, n2num)
        if localnum == n2num:
            remotenum = n1num
        else:
            remotenum = n2num
        if key in self.tunnels.keys():
            self.session.warn("tunnel with key %s (%s-%s) already exists!" % \
                              (key, n1num, n2num))
        else:
            objid = key & ((1<<16)-1)
            self.session.info("Adding tunnel for %s-%s to %s with key %s" % \
                              (n1num, n2num, remoteip, key))
            if localnum in self.phys:
                # no bridge is needed on physical nodes; use the GreTap directly
                gt = GreTap(node=None, name=None, session=self.session,
                                remoteip=remoteip, key=key)
            else:
                gt = self.session.addobj(cls = GreTapBridge, objid = objid,
                                    policy="ACCEPT", remoteip=remoteip, key = key)
            gt.localnum = localnum
            gt.remotenum = remotenum
            self.tunnels[key] = gt
 Add a new GreTapBridge between nodes on two different machines.
        
Add a new GreTapBridge between nodes on two different machines.
Add a new GreTapBridge between nodes on two different machines .
def addtunnel(self, remoteip, n1num, n2num, localnum):
        key = self.tunnelkey(n1num, n2num)
        if localnum == n2num:
            remotenum = n1num
        else:
            remotenum = n2num
        if key in self.tunnels.keys():
            self.session.warn("tunnel with key %s (%s-%s) already exists!" % \
                              (key, n1num, n2num))
        else:
            objid = key & ((1<<16)-1)
            self.session.info("Adding tunnel for %s-%s to %s with key %s" % \
                              (n1num, n2num, remoteip, key))
            if localnum in self.phys:
                gt = GreTap(node=None, name=None, session=self.session,
                                remoteip=remoteip, key=key)
            else:
                gt = self.session.addobj(cls = GreTapBridge, objid = objid,
                                    policy="ACCEPT", remoteip=remoteip, key = key)
            gt.localnum = localnum
            gt.remotenum = remotenum
            self.tunnels[key] = gt
def addtunnel ( self , remoteip , n1num , n2num , localnum ) : key = self . tunnelkey ( n1num , n2num ) if localnum == n2num : remotenum = n1num else : remotenum = n2num if key in self . tunnels . keys ( ) : self . session . warn ( "tunnel with key %s (%s-%s) already exists!" % ( key , n1num , n2num ) ) else : objid = key & ( ( 1 << 16 ) - 1 ) self . session . info ( "Adding tunnel for %s-%s to %s with key %s" % ( n1num , n2num , remoteip , key ) ) if localnum in self . phys : gt = GreTap ( node = None , name = None , session = self . session , remoteip = remoteip , key = key ) else : gt = self . session . addobj ( cls = GreTapBridge , objid = objid , policy = "ACCEPT" , remoteip = remoteip , key = key ) gt . localnum = localnum gt . remotenum = remotenum self . tunnels [ key ] = gt
Add a new GreTapBridge between nodes on two different machines.
Add a new GreTapBridge between nodes on two different machines .
''' Add a new GreTapBridge between nodes on two different machines.
        ''' # no bridge is needed on physical nodes; use the GreTap directly
self
remoteip
n1num
n2num
localnum