Open Flow 1.0 uses a different alignment of members to Open Flow 1.1 and 1.2. For this reason I would like to add a struct ofp11_aggregate_stats_reply in a subsequent patch. In preparation for that rename ofp_aggregate_stats_reply.
Signed-off-by: Simon Horman <ho...@verge.net.au> --- v4 * No change v3 * Initial post --- include/openflow/openflow-common.h | 4 ++-- lib/ofp-print.c | 3 ++- lib/ofp-util.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h index 5070522..2457ae5 100644 --- a/include/openflow/openflow-common.h +++ b/include/openflow/openflow-common.h @@ -367,13 +367,13 @@ struct ofp_desc_stats { OFP_ASSERT(sizeof(struct ofp_desc_stats) == 1056); /* Reply to OFPST_AGGREGATE request. */ -struct ofp_aggregate_stats_reply { +struct ofp10_aggregate_stats_reply { ovs_32aligned_be64 packet_count; /* Number of packets in flows. */ ovs_32aligned_be64 byte_count; /* Number of bytes in flows. */ ovs_be32 flow_count; /* Number of flows. */ uint8_t pad[4]; /* Align to 64 bits. */ }; -OFP_ASSERT(sizeof(struct ofp_aggregate_stats_reply) == 24); +OFP_ASSERT(sizeof(struct ofp10_aggregate_stats_reply) == 24); /* The match type indicates the match structure (set of fields that compose the * match) in use. The match type is placed in the type field at the beginning diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 252c9f2..8dc4fb3 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -1003,8 +1003,9 @@ ofp_print_flow_stats_reply(struct ds *string, const struct ofp_header *oh) static void ofp_print_ofpst_aggregate_reply(struct ds *string, const struct ofp_header *oh) { - const struct ofp_aggregate_stats_reply *asr = ofputil_stats_msg_body(oh); + const struct ofp10_aggregate_stats_reply *asr; + asr = ofputil_stats_msg_body(oh); ds_put_format(string, " packet_count=%"PRIu64, ntohll(get_32aligned_be64(&asr->packet_count))); ds_put_format(string, " byte_count=%"PRIu64, diff --git a/lib/ofp-util.c b/lib/ofp-util.c index e8e2bea..7f576dc 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -919,7 +919,7 @@ static const struct ofputil_msg_type ofputil_msg_types[] = { sizeof(struct ofp_desc_stats), 0), OFPST10_REPLY(OFPST10_FLOW, OFPST_FLOW, 0, 1), OFPST10_REPLY(OFPST10_AGGREGATE, OFPST_AGGREGATE, - sizeof(struct ofp_aggregate_stats_reply), 0), + sizeof(struct ofp10_aggregate_stats_reply), 0), OFPST10_REPLY(OFPST_TABLE, OFPST_TABLE, 0, sizeof(struct ofp10_table_stats)), OFPST10_REPLY(OFPST_PORT, OFPST_PORT, @@ -2449,7 +2449,7 @@ ofputil_encode_aggregate_stats_reply( ofputil_decode_msg_type(request, &type); code = ofputil_msg_type_code(type); if (code == OFPUTIL_OFPST10_AGGREGATE_REQUEST) { - struct ofp_aggregate_stats_reply *asr; + struct ofp10_aggregate_stats_reply *asr; asr = ofputil_make_stats_reply(sizeof *asr, request, &msg); put_32aligned_be64(&asr->packet_count, -- 1.7.10.2.484.gcd07cc5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev