def update_flow_list(controller, switch): """Request flow stats from switches. Args: controller(:class:`~kytos.core.controller.Controller`): the controller being used. switch(:class:`~kytos.core.switch.Switch`): target to send a stats request. Returns: int: multipart request xid """ multipart_request = MultipartRequest() multipart_request.multipart_type = MultipartType.OFPMP_FLOW multipart_request.body = FlowStatsRequest() emit_message_out(controller, switch.connection, multipart_request) return multipart_request.header.xid
def request_port_stats(controller, switch): """Request port stats from switches. Args: controller(:class:`~kytos.core.controller.Controller`): the controller being used. switch(:class:`~kytos.core.switch.Switch`): target to send a stats request. Returns: int: multipart request xid """ multipart_request = MultipartRequest() multipart_request.multipart_type = MultipartType.OFPMP_PORT_STATS multipart_request.body = PortStatsRequest() emit_message_out(controller, switch.connection, multipart_request) return multipart_request.header.xid