ofpbuf_use_const(&b, oh, ntohs(oh->length));
raw = ofpraw_pull_assert(&b);
- if (raw == OFPRAW_OFPT10_FLOW_REMOVED) {
+ if (raw == OFPRAW_OFPT11_FLOW_REMOVED) {
+ const struct ofp12_flow_removed *ofr;
+ enum ofperr error;
+
+ ofr = ofpbuf_pull(&b, sizeof *ofr);
+
+ error = ofputil_pull_ofp11_match(&b, ntohs(ofr->priority),
+ &fr->rule, NULL);
+ if (error) {
+ return error;
+ }
+
+ fr->cookie = ofr->cookie;
+ fr->reason = ofr->reason;
+ /* XXX: ofr->table_id is ignored */
+ fr->duration_sec = ntohl(ofr->duration_sec);
+ fr->duration_nsec = ntohl(ofr->duration_nsec);
+ fr->idle_timeout = ntohs(ofr->idle_timeout);
+ fr->hard_timeout = ntohs(ofr->hard_timeout);
+ fr->packet_count = ntohll(ofr->packet_count);
+ fr->byte_count = ntohll(ofr->byte_count);
+ } else if (raw == OFPRAW_OFPT10_FLOW_REMOVED) {
const struct ofp_flow_removed *ofr;
ofr = ofpbuf_pull(&b, sizeof *ofr);
])
AT_CLEANUP
-AT_SETUP([OFPT_FLOW_REMOVED])
+AT_SETUP([OFPT_FLOW_REMOVED - OF1.0])
AT_KEYWORDS([ofp-print])
AT_CHECK([ovs-ofctl ofp-print "\
01 0b 00 58 00 00 00 00 00 00 00 00 00 03 50 54 \
])
AT_CLEANUP
+AT_SETUP([OFPT_FLOW_REMOVED - OF1.2])
+AT_KEYWORDS([ofp-print])
+AT_CHECK([ovs-ofctl ofp-print "\
+03 0b 00 40 00 00 00 00 fe dc ba 98 76 54 32 10 \
+80 00 01 05 00 00 00 01 00 98 96 80 00 3c 00 78 \
+00 00 00 00 00 12 d6 87 00 00 00 00 6f 68 ba 66 \
+00 01 00 0a 80 00 0c 02 10 09 00 00 00 00 00 00"], [0], [dnl
+OFPT_FLOW_REMOVED (OF1.2) (xid=0x0): dl_vlan=9 reason=hard cookie:0xfedcba9876543210 duration1.01s idle60 hard120 pkts1234567 bytes1869134438
+])
+AT_CLEANUP
+
AT_SETUP([OFPT_PORT_STATUS - OF1.0])
AT_KEYWORDS([ofp-print])
AT_CHECK([ovs-ofctl ofp-print "\