Ejemplo n.º 1
0
	def __init__(self,core,parm):
		""" ControllerAdapter init"""
		self.controllerIP = "localhost"
		self.controllerPort = "8080"
		self.timerInterval = 5
		self.switches=[]
		self.links=[]
		self.inquiryHandler=[]

		#load config
		if(parm):
			if(parm.has_key("ip")):
				self.controllerIP = parm["ip"]
			if(parm.has_key("port")):
				self.controllerPort = parm["port"]
			if(parm.has_key("interval")):
				self.timerInterval = int(parm["interval"])
		logger.debug('IP =%s  port = %s  interval = %s' % (self.controllerIP,self.controllerPort,self.timerInterval))
		core.registerEvent("controlleradapter",self.periodicInquiry,self.timerInterval)
Ejemplo n.º 2
0
	def __init__(self,core,parm):
		#members
		self.controllerIP = "localhost"
		self.controllerPort = "8080"
		self.timerInterval = 5
		self.switchUrl="http://"+self.controllerIP+":"+self.controllerPort+"/wm/omniui/switch/json"
		self.linkUrl="http://"+self.controllerIP+":"+self.controllerPort+"/wm/omniui/link/json"
		self.switches=[]
		self.links=[]
		self.inquiryHandler=[]

		#load config
		if(parm):
			if(parm.has_key("ip")):
				self.controllerIP = parm["ip"]
			if(parm.has_key("port")):
				self.controllerPort = parm["port"]
			if(parm.has_key("interval")):
				self.timerInterval = int(parm["interval"])
		logger.debug('IP =%s  port = %s  interval = %s' % (self.controllerIP,self.controllerPort,self.timerInterval))
		core.registerEvent("controlleradapter",self.periodicInquiry,self.timerInterval)
Ejemplo n.º 3
0
    def __init__(self, core, parm):
        """ ControllerAdapter init"""
        self.controllerIP = "localhost"
        self.controllerPort = "8080"
        self.timerInterval = 5
        self.switches = []
        self.links = []
        self.inquiryHandler = []

        #load config
        if (parm):
            if (parm.has_key("ip")):
                self.controllerIP = parm["ip"]
            if (parm.has_key("port")):
                self.controllerPort = parm["port"]
            if (parm.has_key("interval")):
                self.timerInterval = int(parm["interval"])
        logger.debug(
            'IP =%s  port = %s  interval = %s' %
            (self.controllerIP, self.controllerPort, self.timerInterval))
        core.registerEvent("controlleradapter", self.periodicInquiry,
                           self.timerInterval)
Ejemplo n.º 4
0
	def __init__(self,core,parm):
		""" BusyLinkDetect init"""
		self.controllerIP = "localhost"
		self.controllerPort = "8080"
		self.timerInterval = 5

		self.baseState = 1
		self.finalState = 3
		self.threshold = 0.8
		self.statistics = {}
		self.BLD_result = []

		#load config
		if(parm):
			if(parm.has_key("ip")):
				self.controllerIP = parm["ip"]
			if(parm.has_key("port")):
				self.controllerPort = parm["port"]
			if(parm.has_key("interval")):
				self.timerInterval = int(parm["interval"])
		logger.debug('IP =%s  port = %s  interval = %s' % (self.controllerIP,self.controllerPort,self.timerInterval))
		core.registerEvent("periodicQuery",self.periodicQuery,self.timerInterval)
		core.registerEventHandler("periodicQuery", self.busyLinkDetect)