2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-23 14:57:06 +00:00

openflow: Merge ofp_flow_stats_request and ofp_aggregate_stats_request.

This commit is contained in:
Ben Pfaff
2011-05-23 16:07:22 -07:00
parent 03cd34939e
commit 2a1c0549a3
3 changed files with 4 additions and 19 deletions

View File

@@ -706,7 +706,7 @@ enum ofp_stats_types {
OFPST_FLOW,
/* Aggregate flow statistics.
* The request body is struct ofp_aggregate_stats_request.
* The request body is struct ofp_flow_stats_request.
* The reply body is struct ofp_aggregate_stats_reply. */
OFPST_AGGREGATE,
@@ -759,7 +759,7 @@ struct ofp_desc_stats {
};
OFP_ASSERT(sizeof(struct ofp_desc_stats) == 1056);
/* Body for stats request of type OFPST_FLOW. */
/* Body for stats request of type OFPST_FLOW or OFPST_AGGREGATE. */
struct ofp_flow_stats_request {
struct ofp_match match; /* Fields to match. */
uint8_t table_id; /* ID of table to read (from ofp_table_stats)
@@ -792,18 +792,6 @@ struct ofp_flow_stats {
};
OFP_ASSERT(sizeof(struct ofp_flow_stats) == 88);
/* Body for stats request of type OFPST_AGGREGATE. */
struct ofp_aggregate_stats_request {
struct ofp_match match; /* Fields to match. */
uint8_t table_id; /* ID of table to read (from ofp_table_stats)
or 0xff for all tables. */
uint8_t pad; /* Align to 32 bits. */
ovs_be16 out_port; /* Require matching entries to include this
as an output port. A value of OFPP_NONE
indicates no restriction. */
};
OFP_ASSERT(sizeof(struct ofp_aggregate_stats_request) == 44);
/* Body of reply to OFPST_AGGREGATE request. */
struct ofp_aggregate_stats_reply {
ovs_32aligned_be64 packet_count; /* Number of packets in flows. */

View File

@@ -512,7 +512,7 @@ ofputil_decode_ofpst_request(const struct ofp_header *oh,
{ OFPUTIL_OFPST_AGGREGATE_REQUEST,
OFPST_AGGREGATE, "OFPST_AGGREGATE request",
OSM_SIZE + sizeof(struct ofp_aggregate_stats_request), 0 },
OSM_SIZE + sizeof(struct ofp_flow_stats_request), 0 },
{ OFPUTIL_OFPST_TABLE_REQUEST,
OFPST_TABLE, "OFPST_TABLE request",
@@ -1099,9 +1099,6 @@ ofputil_encode_flow_stats_request(const struct flow_stats_request *fsr,
struct ofp_flow_stats_request *ofsr;
int type;
BUILD_ASSERT_DECL(sizeof(struct ofp_flow_stats_request)
== sizeof(struct ofp_aggregate_stats_request));
type = fsr->aggregate ? OFPST_AGGREGATE : OFPST_FLOW;
ofsr = ofputil_make_stats_request(sizeof *ofsr, type, &msg);
ofputil_cls_rule_to_match(&fsr->match, &ofsr->match);

View File

@@ -2066,7 +2066,7 @@ static int
handle_aggregate_stats_request(struct ofconn *ofconn,
const struct ofp_header *oh)
{
const struct ofp_aggregate_stats_request *request = ofputil_stats_body(oh);
const struct ofp_flow_stats_request *request = ofputil_stats_body(oh);
struct ofproto *ofproto = ofconn_get_ofproto(ofconn);
struct ofp_aggregate_stats_reply *reply;
struct cls_rule target;