X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fofp-util.c;fp=lib%2Fofp-util.c;h=a2e950167471877e6e87a0f5b1abde49ee46da6a;hb=0157ad3a08e849dae1223fe5ee0f33afc99235fc;hp=1226ace32ad876e262cc94f3ffb283640329fa68;hpb=c376f9a3e968570d2df2574336d86185fc18b8a2;p=sliver-openvswitch.git diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 1226ace32..a2e950167 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -1396,9 +1396,9 @@ ofputil_flow_mod_usable_protocols(const struct ofputil_flow_mod *fms, } static enum ofperr -ofputil_decode_ofpst_flow_request(struct ofputil_flow_stats_request *fsr, - const struct ofp10_flow_stats_request *ofsr, - bool aggregate) +ofputil_decode_ofpst10_flow_request(struct ofputil_flow_stats_request *fsr, + const struct ofp10_flow_stats_request *ofsr, + bool aggregate) { fsr->aggregate = aggregate; ofputil_cls_rule_from_ofp10_match(&ofsr->match, 0, &fsr->match); @@ -1409,6 +1409,33 @@ ofputil_decode_ofpst_flow_request(struct ofputil_flow_stats_request *fsr, return 0; } +static enum ofperr +ofputil_decode_ofpst11_flow_request(struct ofputil_flow_stats_request *fsr, + struct ofpbuf *b, bool aggregate) +{ + const struct ofp11_flow_stats_request *ofsr; + enum ofperr error; + + ofsr = ofpbuf_pull(b, sizeof *ofsr); + fsr->aggregate = aggregate; + fsr->table_id = ofsr->table_id; + error = ofputil_port_from_ofp11(ofsr->out_port, &fsr->out_port); + if (error) { + return error; + } + if (ofsr->out_group != htonl(OFPG11_ANY)) { + return OFPERR_NXFMFC_GROUPS_NOT_SUPPORTED; + } + fsr->cookie = ofsr->cookie; + fsr->cookie_mask = ofsr->cookie_mask; + error = ofputil_pull_ofp11_match(b, 0, &fsr->match, NULL); + if (error) { + return error; + } + + return 0; +} + static enum ofperr ofputil_decode_nxst_flow_request(struct ofputil_flow_stats_request *fsr, struct ofpbuf *b, bool aggregate) @@ -1447,10 +1474,13 @@ ofputil_decode_flow_stats_request(struct ofputil_flow_stats_request *fsr, raw = ofpraw_pull_assert(&b); switch ((int) raw) { case OFPRAW_OFPST10_FLOW_REQUEST: - return ofputil_decode_ofpst_flow_request(fsr, b.data, false); + return ofputil_decode_ofpst10_flow_request(fsr, b.data, false); case OFPRAW_OFPST_AGGREGATE_REQUEST: - return ofputil_decode_ofpst_flow_request(fsr, b.data, true); + 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_NXST_FLOW_REQUEST: return ofputil_decode_nxst_flow_request(fsr, &b, false);