]> git.proxmox.com Git - mirror_ovs.git/commitdiff
openflow: Merge ofp_flow_stats_request and ofp_aggregate_stats_request.
authorBen Pfaff <blp@nicira.com>
Mon, 23 May 2011 23:07:22 +0000 (16:07 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 14 Jun 2011 18:21:50 +0000 (11:21 -0700)
include/openflow/openflow.h
lib/ofp-util.c
ofproto/ofproto.c

index 5329f20aca253abf6e60d437f659a4443c38c05f..b7c7085ded87513d4d9559d8c4b3cd7cd9ff3ee5 100644 (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. */
index e96ace9417209185a2a27400f4483bb9a3137df7..df084b0eae57725cc85891ac5517bb69538492cc 100644 (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);
index 553680dc65f57818746d2e6fade6ee3d1010fcf6..e5bea041c904ce4a84dabc436dbb7db164bc2f32 100644 (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;