Beispiel #1
0
 def _handle_ConnectionUp (self, event):
     log.debug("Switch %s has come up.", dpid_to_str(event.dpid))
     ports = event.ofp.ports
     log.debug(ports)
     # Debug hw_addr
     for p in ports:
         #TODO Naming schema for switches
         if p.name == 'br0' or p.name == 'br1' or p.name == 'br2':
             switch = p.hw_addr
             log.debug(type(switch))
     log.debug('The switch address is')
     log.debug(switch)
     node = self.slice.find_switch(str(switch))
     sliver = self.slice.sliver_on_node(node)
     log.debug("Switch is on sliver "+sliver+" in node "+node)
     db.create_sliver(sliver,node,event.dpid,str(switch))
Beispiel #2
0
 def _handle_ConnectionUp(self, event):
     log.debug("Switch %s has come up.", dpid_to_str(event.dpid))
     ports = event.ofp.ports
     log.debug(ports)
     # Debug hw_addr
     for p in ports:
         #TODO Naming schema for switches
         if p.name == 'br0' or p.name == 'br1' or p.name == 'br2':
             switch = p.hw_addr
             log.debug(type(switch))
     log.debug('The switch address is')
     log.debug(switch)
     node = self.slice.find_switch(str(switch))
     sliver = self.slice.sliver_on_node(node)
     log.debug("Switch is on sliver " + sliver + " in node " + node)
     db.create_sliver(sliver, node, event.dpid, str(switch))
Beispiel #3
0
 def confine_register(self, switch, dpid):
     node = self.slice.find_switch(str(switch))
     sliver = self.slice.sliver_on_node(node)
     log.debug("Switch is on sliver " + sliver + " in node " + node)
     db.create_sliver(sliver, node, dpid, str(switch))
Beispiel #4
0
 def confine_register(self,switch,dpid):
     node = self.slice.find_switch(str(switch))
     sliver = self.slice.sliver_on_node(node)
     log.debug("Switch is on sliver "+sliver+" in node "+node)
     db.create_sliver(sliver,node,dpid,str(switch))