def __init__(self, *args, **kw): SwitchImpl.__init__(self, *args, **kw) self.role_by_conn={} self.connections = [] self.connection_in_action = None # index of the next 'other' controller to get a message # (for round robin of async messages) self.next_other = 0 self.beef_up_handlers()
def __init__(self, *args, **kw): SwitchImpl.__init__(self, *args, **kw) self.role_by_conn={} self.connections = [] self.connection_in_action = None # index of the next 'other' controller to get a message # (for round robin of async messages) self.next_other = 0 self.beef_up_handlers()
def _receive_vendor(self, vendor, connection): self.log.debug("Vendor %s %s" % (self.name, str(vendor))) if(vendor.vendor == nx.VENDOR_ID): try: data = nx.unpack_vendor_data_nx(vendor.data) if isinstance(data, nx.role_request_data): self.set_role(connection, data.role) reply = of.ofp_vendor(vendor = nx.VENDOR_ID, data = nx.role_reply_data(role = data.role)) self.send(reply) return except NotImplemented: self.send_error(connection) else: return SwitchImpl._receive_vendor(self, vendor)
def _receive_vendor(self, vendor, connection): self.log.debug("Vendor %s %s" % (self.name, str(vendor))) if(vendor.vendor == nx.VENDOR_ID): try: data = nx.unpack_vendor_data_nx(vendor.data) if isinstance(data, nx.role_request_data): self.set_role(connection, data.role) reply = of.ofp_vendor(vendor = nx.VENDOR_ID, data = nx.role_reply_data(role = data.role)) self.send(reply) return except NotImplemented: self.send_error(connection) else: return SwitchImpl._receive_vendor(self, vendor)