def __init__(self, connection, transparent): log.info("Init...") self.connection = connection self.transparent = transparent connection.addListeners(self) self.flowcreator = FlowCreator() self.createFlowRules()
class Controller(object): def __init__(self, connection, transparent): log.info("Init...") self.connection = connection self.transparent = transparent connection.addListeners(self) self.flowcreator = FlowCreator() self.createFlowRules() def _handle_PacketIn(self, event): packet = event.parsed log.info("Packet from " + str(packet.src) + " to " + str(packet.dst)) def createFlowRules(self): viewreader = ViewReader() #viewfile = str(raw_input("Enter the path to your view file (e.g. /home/mininet/nv.nv):")) with open("/home/mininet/config.conf") as file: lines = file.readlines() print("Loaded path from config file " + lines[0]) viewfile = lines[0].replace("\n", "") nv = viewreader.readNetworkView(viewfile) rules = self.flowcreator.generateRules(nv) for r in rules: self.connection.send(r)
class Controller(object): def __init__ (self,connection,transparent): log.info("Init...") self.connection = connection self.transparent = transparent connection.addListeners(self) self.flowcreator = FlowCreator() self.createFlowRules() def _handle_PacketIn (self, event): packet = event.parsed log.info("Packet from " + str(packet.src) + " to " + str(packet.dst)) def createFlowRules(self): viewreader = ViewReader() #viewfile = str(raw_input("Enter the path to your view file (e.g. /home/mininet/nv.nv):")) with open("/home/mininet/config.conf") as file: lines = file.readlines() print("Loaded path from config file " + lines[0]) viewfile = lines[0].replace("\n", "") nv = viewreader.readNetworkView(viewfile) rules = self.flowcreator.generateRules(nv) for r in rules: self.connection.send(r)
def __init__ (self,connection,transparent): log.info("Init...") self.connection = connection self.transparent = transparent connection.addListeners(self) self.flowcreator = FlowCreator() self.createFlowRules()