@@ -1713,49 +1713,30 @@ module StatsRequest = struct
1713
1713
match msg with
1714
1714
| DescriptionRequest -> sizeof_ofp_stats_request
1715
1715
| FlowTableStatsRequest -> sizeof_ofp_stats_request
1716
- | IndividualRequest flow_req ->
1717
- marshal_flow_stats_request flow_req.is_of_match flow_req.is_out_port flow_req.is_table_id out'
1718
- | AggregateRequest agg_req ->
1719
- marshal_flow_stats_request agg_req.as_of_match agg_req.as_out_port agg_req.as_table_id out'
1716
+ | IndividualRequest stats_req
1717
+ | AggregateRequest stats_req ->
1718
+ marshal_flow_stats_request stats_req.sr_of_match stats_req.sr_out_port stats_req.sr_table_id out'
1720
1719
1721
- let parse_flow_stats_request bits =
1722
- let is_of_match = Match. parse (get_ofp_flow_stats_request_of_match bits) in
1723
- let is_table_id = get_ofp_flow_stats_request_table_id bits in
1724
- let is_out_port =
1720
+ let parse_stats_request bits =
1721
+ let sr_of_match = Match. parse (get_ofp_flow_stats_request_of_match bits) in
1722
+ let sr_table_id = get_ofp_flow_stats_request_table_id bits in
1723
+ let sr_out_port =
1725
1724
(let open PseudoPort in
1726
1725
if ofp_port_to_int OFPP_NONE = (get_ofp_flow_stats_request_out_port bits) then
1727
1726
None
1728
1727
else
1729
1728
Some (PhysicalPort (get_ofp_flow_stats_request_out_port bits)))
1730
1729
in
1731
- { is_of_match = is_of_match;
1732
- is_table_id = is_table_id;
1733
- is_out_port = is_out_port
1734
- }
1730
+ { sr_of_match; sr_table_id; sr_out_port }
1735
1731
1736
- let parse_aggregate_stats_request bits =
1737
- let as_of_match = Match. parse (get_ofp_flow_stats_request_of_match bits) in
1738
- let as_table_id = get_ofp_flow_stats_request_table_id bits in
1739
- let as_out_port =
1740
- (let open PseudoPort in
1741
- if ofp_port_to_int OFPP_NONE = (get_ofp_flow_stats_request_out_port bits) then
1742
- None
1743
- else
1744
- Some (PhysicalPort (get_ofp_flow_stats_request_out_port bits)))
1745
- in
1746
- { as_of_match = as_of_match;
1747
- as_table_id = as_table_id;
1748
- as_out_port = as_out_port
1749
- }
1750
-
1751
1732
let parse bits =
1752
1733
let stats_type_code = get_ofp_stats_request_req_type bits in
1753
1734
let body = Cstruct. shift bits sizeof_ofp_stats_request in
1754
1735
match int_to_ofp_stats_types stats_type_code with
1755
1736
| Some OFPST_DESC -> DescriptionRequest
1756
1737
| Some OFPST_TABLE -> FlowTableStatsRequest
1757
- | Some OFPST_FLOW -> IndividualRequest (parse_flow_stats_request body)
1758
- | Some OFPST_AGGREGATE -> AggregateRequest (parse_aggregate_stats_request body)
1738
+ | Some OFPST_FLOW -> IndividualRequest (parse_stats_request body)
1739
+ | Some OFPST_AGGREGATE -> AggregateRequest (parse_stats_request body)
1759
1740
| Some OFPST_QUEUE -> raise (Unparsable " queue statistics unsupported" )
1760
1741
| Some OFPST_VENDOR -> raise (Unparsable " vendor statistics unsupported" )
1761
1742
| Some OFPST_PORT -> raise (Unparsable " port statistics unsupported" )
0 commit comments