def emit_message_out(self, connection, message): """Emit a KytosEvent for each outgoing message.""" if connection.is_alive(): emit_message_out(self.controller, connection, message)
def send_port_request(controller, connection): """Send a Port Description Request after the Features Reply.""" port_request = MultipartRequest() port_request.multipart_type = MultipartType.OFPMP_PORT_DESC emit_message_out(controller, connection, port_request)
def say_hello(controller, connection): """Send back a Hello packet with the same version as the switch.""" hello = Hello() emit_message_out(controller, connection, hello)
def send_set_config(controller, switch): """Send a SetConfig message after the OpenFlow handshake.""" set_config = SetConfig() set_config.flags = ConfigFlag.OFPC_FRAG_NORMAL set_config.miss_send_len = ControllerMaxLen.OFPCML_NO_BUFFER emit_message_out(controller, switch.connection, set_config)
def emit_message_out(self, connection, message): """Emit a KytosEvent for an outgoing message containing the message and the destination.""" if connection.is_alive(): emit_message_out(self.controller, connection, message)
def send_set_config(controller, switch): """Send a SetConfig message after the OpenFlow handshake.""" set_config = SetConfig() set_config.flags = ConfigFlag.OFPC_FRAG_NORMAL set_config.miss_send_len = 0xffff # Send the whole packet emit_message_out(controller, switch.connection, set_config)