csle_ryu.dao package
Submodules
csle_ryu.dao.agg_flow_statistic module
- class csle_ryu.dao.agg_flow_statistic.AggFlowStatistic(timestamp: float, datapath_id: str, total_num_packets: int, total_num_bytes: int, total_num_flows: int)[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO containing aggregated flow statistics of an OpenFlow switch
- copy() csle_ryu.dao.agg_flow_statistic.AggFlowStatistic [source]
Copies the object
- Returns
a copy of the DTO
- static from_dict(d: Dict[str, Any]) csle_ryu.dao.agg_flow_statistic.AggFlowStatistic [source]
Converts a dict representation to an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) csle_ryu.dao.agg_flow_statistic.AggFlowStatistic [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_kafka_record(record: str) csle_ryu.dao.agg_flow_statistic.AggFlowStatistic [source]
Converts a kafka record to a DTO
- Parameters
record – the kafka record
- Returns
the DTO
csle_ryu.dao.avg_flow_statistic module
- class csle_ryu.dao.avg_flow_statistic.AvgFlowStatistic(timestamp: float, datapath_id: str, total_num_packets: int, total_num_bytes: int, avg_duration_nanoseconds: int, avg_duration_seconds: int, avg_hard_timeout: int, avg_idle_timeout: int, avg_priority: int, avg_cookie: int)[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO containing avg data of a flow statistics returned by an OpenFlow switch
- static average_flow_statistics(timestamp: float, datapath_id: str, flow_statistics: List[csle_ryu.dao.flow_statistic.FlowStatistic]) csle_ryu.dao.avg_flow_statistic.AvgFlowStatistic [source]
Computes the average metrics from a list of flow statistics
- Parameters
flow_statistics – the list of flow statistics to average
- Returns
the computed averages
- copy() csle_ryu.dao.avg_flow_statistic.AvgFlowStatistic [source]
- Returns
a copy of the DTO
- static from_dict(d: Dict[str, Any]) csle_ryu.dao.avg_flow_statistic.AvgFlowStatistic [source]
Converts a dict representation to an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) csle_ryu.dao.avg_flow_statistic.AvgFlowStatistic [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_kafka_record(record: str) csle_ryu.dao.avg_flow_statistic.AvgFlowStatistic [source]
Converts a kafka record to a DTO
- Parameters
record – the kafka record
- Returns
the DTO
csle_ryu.dao.avg_port_statistic module
- class csle_ryu.dao.avg_port_statistic.AvgPortStatistic(timestamp: float, datapath_id: str, total_num_received_packets: int, total_num_received_bytes: int, total_num_received_errors: int, total_num_transmitted_packets: int, total_num_transmitted_bytes: int, total_num_transmitted_errors: int, total_num_received_dropped: int, total_num_transmitted_dropped, total_num_received_frame_errors, total_num_received_overrun_errors, total_num_received_crc_errors, total_num_collisions, avg_duration_nanoseconds, avg_duration_seconds)[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO containing data with average port statistics from an OpenFlow switch
- static average_port_statistics(timestamp: float, datapath_id: str, port_statistics: List[csle_ryu.dao.port_statistic.PortStatistic]) csle_ryu.dao.avg_port_statistic.AvgPortStatistic [source]
Computes the average metrics from a list of flow statistics
- Parameters
port_statistics – the list of flow statistics to average
- Returns
the computed averages
- copy() csle_ryu.dao.port_statistic.PortStatistic [source]
- Returns
a copy of the DTO
- static from_dict(d: Dict[str, Any]) csle_ryu.dao.avg_port_statistic.AvgPortStatistic [source]
Converts a dict representation to an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) csle_ryu.dao.avg_port_statistic.AvgPortStatistic [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_kafka_record(record: str) csle_ryu.dao.avg_port_statistic.AvgPortStatistic [source]
Converts a kafka record to a DTO
- Parameters
record – the kafka record
- Returns
the DTO
csle_ryu.dao.flow_statistic module
- class csle_ryu.dao.flow_statistic.FlowStatistic(timestamp: float, datapath_id: str, in_port: str, out_port: str, dst_mac_address: str, num_packets: int, num_bytes: int, duration_nanoseconds: int, duration_seconds: int, hard_timeout: int, idle_timeout: int, priority: int, cookie: int)[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO containing data of a flow statistic returned by an OpenFlow switch
- copy() csle_ryu.dao.flow_statistic.FlowStatistic [source]
- Returns
a copy of the DTO
- static from_dict(d: Dict[str, Any]) csle_ryu.dao.flow_statistic.FlowStatistic [source]
Converts a dict representation to an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) csle_ryu.dao.flow_statistic.FlowStatistic [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_kafka_record(record: str) csle_ryu.dao.flow_statistic.FlowStatistic [source]
Converts a kafka record to a DTO
- Parameters
record – the kafka record
- Returns
the DTO
csle_ryu.dao.port_statistic module
- class csle_ryu.dao.port_statistic.PortStatistic(timestamp: float, datapath_id: str, port: int, num_received_packets: int, num_received_bytes: int, num_received_errors: int, num_transmitted_packets: int, num_transmitted_bytes: int, num_transmitted_errors: int, num_received_dropped: int, num_transmitted_dropped: int, num_received_frame_errors: int, num_received_overrun_errors: int, num_received_crc_errors: int, num_collisions: int, duration_nanoseconds: int, duration_seconds: int)[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO containing data with port statistics from an OpenFlow switch
- copy() csle_ryu.dao.port_statistic.PortStatistic [source]
- Returns
a copy of the DTO
- static from_dict(d: Dict[str, Any]) csle_ryu.dao.port_statistic.PortStatistic [source]
Converts a dict representation to an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) csle_ryu.dao.port_statistic.PortStatistic [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_kafka_record(record: str) csle_ryu.dao.port_statistic.PortStatistic [source]
Converts a kafka record to a DTO
- Parameters
record – the kafka record
- Returns
the DTO
csle_ryu.dao.ryu_controller_type module
Type of RYU SDN controllers in CSLE