mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
ofp-msgs: Split OFPRAW_OFPST_AGGREGATE_REQUEST
Split OFPRAW_OFPST_AGGREGATE_REQUEST into OpenFlow 1.0 and 1.1+ versions. This should be sufficient to allow adding encoding and decoding of Open Flow 1.1 and 1.2 Aggregate Stats Request messages. Encoding and decoding of Open Flow 1.1 and 1.2 Aggregate Stats Response messages works using the existing code without modification. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -1476,12 +1476,15 @@ ofputil_decode_flow_stats_request(struct ofputil_flow_stats_request *fsr,
|
||||
case OFPRAW_OFPST10_FLOW_REQUEST:
|
||||
return ofputil_decode_ofpst10_flow_request(fsr, b.data, false);
|
||||
|
||||
case OFPRAW_OFPST_AGGREGATE_REQUEST:
|
||||
case OFPRAW_OFPST10_AGGREGATE_REQUEST:
|
||||
return ofputil_decode_ofpst10_flow_request(fsr, b.data, true);
|
||||
|
||||
case OFPRAW_OFPST11_FLOW_REQUEST:
|
||||
return ofputil_decode_ofpst11_flow_request(fsr, &b, false);
|
||||
|
||||
case OFPRAW_OFPST11_AGGREGATE_REQUEST:
|
||||
return ofputil_decode_ofpst11_flow_request(fsr, &b, true);
|
||||
|
||||
case OFPRAW_NXST_FLOW_REQUEST:
|
||||
return ofputil_decode_nxst_flow_request(fsr, &b, false);
|
||||
|
||||
@@ -1509,7 +1512,7 @@ ofputil_encode_flow_stats_request(const struct ofputil_flow_stats_request *fsr,
|
||||
struct ofp11_flow_stats_request *ofsr;
|
||||
|
||||
raw = (fsr->aggregate
|
||||
? OFPRAW_OFPST_AGGREGATE_REQUEST
|
||||
? OFPRAW_OFPST11_AGGREGATE_REQUEST
|
||||
: OFPRAW_OFPST11_FLOW_REQUEST);
|
||||
msg = ofpraw_alloc(raw, OFP12_VERSION, NXM_TYPICAL_LEN);
|
||||
ofsr = ofpbuf_put_zeros(msg, sizeof *ofsr);
|
||||
@@ -1527,7 +1530,7 @@ ofputil_encode_flow_stats_request(const struct ofputil_flow_stats_request *fsr,
|
||||
struct ofp10_flow_stats_request *ofsr;
|
||||
|
||||
raw = (fsr->aggregate
|
||||
? OFPRAW_OFPST_AGGREGATE_REQUEST
|
||||
? OFPRAW_OFPST10_AGGREGATE_REQUEST
|
||||
: OFPRAW_OFPST10_FLOW_REQUEST);
|
||||
msg = ofpraw_alloc(raw, OFP10_VERSION, 0);
|
||||
ofsr = ofpbuf_put_zeros(msg, sizeof *ofsr);
|
||||
@@ -1863,7 +1866,7 @@ ofputil_encode_aggregate_stats_reply(
|
||||
enum ofpraw raw;
|
||||
|
||||
ofpraw_decode(&raw, request);
|
||||
if (raw == OFPRAW_OFPST_AGGREGATE_REQUEST) {
|
||||
if (raw == OFPRAW_OFPST10_AGGREGATE_REQUEST) {
|
||||
packet_count = unknown_to_zero(stats->packet_count);
|
||||
byte_count = unknown_to_zero(stats->byte_count);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user