case OFPUTIL_C_ARP_MATCH_IP: return "ARP_MATCH_IP";
case OFPUTIL_C_STP: return "STP";
case OFPUTIL_C_GROUP_STATS: return "GROUP_STATS";
+ case OFPUTIL_C_PORT_BLOCKED: return "PORT_BLOCKED";
}
return NULL;
ofputil_capabilities_to_name, ' ');
ds_put_char(string, '\n');
- ds_put_cstr(string, "actions: ");
- ofp_print_bit_names(string, features.actions,
- ofputil_action_bitmap_to_name, ' ');
- ds_put_char(string, '\n');
+ switch ((enum ofp_version)oh->version) {
+ case OFP10_VERSION:
+ ds_put_cstr(string, "actions: ");
+ ofp_print_bit_names(string, features.actions,
+ ofputil_action_bitmap_to_name, ' ');
+ ds_put_char(string, '\n');
+ break;
+ case OFP11_VERSION:
+ case OFP12_VERSION:
+ break;
+ default:
+ NOT_REACHED();
+ }
ofp_print_phy_ports(string, oh->version, &b);
}
bool need_priority;
enum ofperr error;
enum ofpraw raw;
+ enum ofputil_protocol protocol;
+
+ protocol = ofputil_protocol_from_ofp_version(oh->version);
+ protocol = ofputil_protocol_set_tid(protocol, true);
ofpbuf_init(&ofpacts, 64);
- error = ofputil_decode_flow_mod(&fm, oh, OFPUTIL_P_OF10_TID, &ofpacts);
+ error = ofputil_decode_flow_mod(&fm, oh, protocol, &ofpacts);
if (error) {
ofpbuf_uninit(&ofpacts);
ofp_print_error(s, error);
}
ds_put_cstr(string, " duration");
ofp_print_duration(string, fr.duration_sec, fr.duration_nsec);
- ds_put_format(string, " idle%"PRIu16" pkts%"PRIu64" bytes%"PRIu64"\n",
- fr.idle_timeout, fr.packet_count, fr.byte_count);
+ ds_put_format(string, " idle%"PRIu16, fr.idle_timeout);
+ if (fr.hard_timeout) {
+ /* The hard timeout was only added in OF1.2, so only print it if it is
+ * actually in use to avoid gratuitous change to the formatting. */
+ ds_put_format(string, " hard%"PRIu16, fr.hard_timeout);
+ }
+ ds_put_format(string, " pkts%"PRIu64" bytes%"PRIu64"\n",
+ fr.packet_count, fr.byte_count);
}
static void