Ejemplo n.º 1
0
    def multipart_reply_handler(self, ev):
        msg = ev.msg
        datapath = msg.datapath
        dpid = datapath.id
        switch = self.deviceInfo.setdefault(dpid, SwitchFeatures(dpid))

        # self.num = self.num+1
        # print self.num
        # ports = switch.getPorts()
        # print 'msg: ', msg.__dict__
        for portdesc in msg.body:
            # print 'portdesc: ', portdesc

            portNo = portdesc.port_no
            if portNo > 10000:
                # print 11111111111111111111111111
                name = portdesc.name
                switch.setName(name)
            else:
                port = PortFeatures(portNo)
                port.initFields(portdesc)
                # print 'port: ',port.__dict__
                switch.ports[portNo] = port
                self.QoS_dict[dpid].queueInfo[portNo] = QueuePort(portNo, dpid)

        if self.superExist:
            self._send_switch_features_message(dpid)
Ejemplo n.º 2
0
    def multipart_reply_handler(self, ev):
        msg = ev.msg
        datapath = msg.datapath
        dpid = datapath.id
        switch = self.deviceInfo.setdefault(dpid, SwitchFeatures(dpid))

        # self.num = self.num+1
        # print self.num
        #ports = switch.getPorts()
        #print 'msg: ', msg.__dict__
        for portdesc in msg.body:
            #print 'portdesc: ', portdesc

            portNo = portdesc.port_no
            if portNo > 10000:
               # print 11111111111111111111111111
                name = portdesc.name
                switch.setName(name)
            else:
                port = PortFeatures(portNo)
                port.initFields(portdesc)
                #print 'port: ',port.__dict__
                switch.ports[portNo] = port
                self.QoS_dict[dpid].queueInfo[portNo] = QueuePort(portNo, dpid)


        if self.superExist:
            self._send_switch_features_message(dpid)
Ejemplo n.º 3
0
    def multipart_reply_handler(self, ev):
        msg = ev.msg
        datapath = msg.datapath
        dpid = datapath.id
        switch = self.deviceInfo.setdefault(dpid, SwtichFeatures(dpid))

        ports = switch.getPorts()

        for portdesc in msg.body:
            portNo = portdesc.port_no
            if portNo > 10000:
                name = portdesc.name
                switch.setName(name)
            port = PortFeatures(portNo)
            port.initFields(portdesc)
            ports[portNo] = port

        if self.superExist:
            self._send_switch_features_message(dpid)
Ejemplo n.º 4
0
    def multipart_reply_handler(self, ev):
        msg = ev.msg
        datapath = msg.datapath
        dpid = datapath.id
        switch = self.deviceInfo.setdefault(dpid, SwtichFeatures(dpid))

        ports = switch.getPorts()

        for portdesc in msg.body:
            portNo = portdesc.port_no
            if portNo > 10000:
                name = portdesc.name
                switch.setName(name)
            port = PortFeatures(portNo)
            port.initFields(portdesc)
            ports[portNo] = port

        if self.superExist:
            self._send_switch_features_message(dpid)