ofp-print: Print OFPUTIL_NXST_AGGREGATE_REPLY.
authorBen Pfaff <blp@nicira.com>
Tue, 7 Dec 2010 23:07:54 +0000 (15:07 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 9 Dec 2010 18:27:08 +0000 (10:27 -0800)
lib/ofp-print.c

index 0ae987e445eafd06b610f19f9994e3988fe0ce35..56111435328e228d72b5762327a80c91fbb5489a 100644 (file)
@@ -1269,15 +1269,27 @@ ofp_print_nxst_flow_reply(struct ds *string, const struct ofp_header *oh)
 }
 
 static void
-ofp_print_ofpst_aggregate_reply(struct ds *string, const struct ofp_header *oh)
+ofp_print_ofp_aggregate_stats_reply (
+    struct ds *string, const struct ofp_aggregate_stats_reply *asr)
 {
-    const struct ofp_aggregate_stats_reply *asr = ofputil_stats_body(oh);
-
     ds_put_format(string, " packet_count=%"PRIu64, ntohll(asr->packet_count));
     ds_put_format(string, " byte_count=%"PRIu64, ntohll(asr->byte_count));
     ds_put_format(string, " flow_count=%"PRIu32, ntohl(asr->flow_count));
 }
 
+static void
+ofp_print_ofpst_aggregate_reply(struct ds *string, const struct ofp_header *oh)
+{
+    ofp_print_ofp_aggregate_stats_reply(string, ofputil_stats_body(oh));
+}
+
+static void
+ofp_print_nxst_aggregate_reply(struct ds *string,
+                               const struct nx_aggregate_stats_reply *nasr)
+{
+    ofp_print_ofp_aggregate_stats_reply(string, &nasr->asr);
+}
+
 static void print_port_stat(struct ds *string, const char *leader,
                             uint64_t stat, int more)
 {
@@ -1664,7 +1676,8 @@ ofp_to_string__(const struct ofp_header *oh,
         break;
 
     case OFPUTIL_NXST_AGGREGATE_REPLY:
-        /* XXX */
+        ofp_print_stats_reply(string, oh);
+        ofp_print_nxst_aggregate_reply(string, oh);
         break;
     }
 }