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 _rx_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(xid=vendor.xid, vendor = nx.VENDOR_ID, data = nx.role_reply_data(role = data.role)) self.send(reply) return except NotImplementedError: self.send_vendor_error(connection) else: return SoftwareSwitch._rx_vendor(self, vendor)