From a2ad9ecdd0d4ac9a641e8cef1f3f4681fd77d6b1 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 7 Dec 2010 15:07:54 -0800 Subject: [PATCH] ofp-print: Print OFPUTIL_NXST_AGGREGATE_REPLY. --- lib/ofp-print.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 0ae987e4..56111435 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -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; } } -- 2.30.2