mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
openflow-1.1+: OFPT_TABLE_MOD (part 1)
Added infrastructure to support Openflow OFPT_TABLE_MOD message. This patch does not include the flexible table miss handling code that is necessary to support the semantics specified in OFPT_TABLE_MOD messages. Current flow miss behavior continues to conform to Openflow 1.0. Future commits to add more flexible table miss support are needed to fully support OPFT_TABLE_MOD for Openflow-1.1+. Signed-off-by: Andy Zhou <azhou@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -964,6 +964,49 @@ ofp_print_port_mod(struct ds *string, const struct ofp_header *oh)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ofp_print_table_miss_config(struct ds *string, const uint32_t config)
|
||||
{
|
||||
uint32_t table_miss_config = config & OFPTC11_TABLE_MISS_MASK;
|
||||
|
||||
switch (table_miss_config) {
|
||||
case OFPTC11_TABLE_MISS_CONTROLLER:
|
||||
ds_put_cstr(string, "controller\n");
|
||||
break;
|
||||
case OFPTC11_TABLE_MISS_CONTINUE:
|
||||
ds_put_cstr(string, "continue\n");
|
||||
break;
|
||||
case OFPTC11_TABLE_MISS_DROP:
|
||||
ds_put_cstr(string, "drop\n");
|
||||
break;
|
||||
default:
|
||||
ds_put_cstr(string, "Unknown\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ofp_print_table_mod(struct ds *string, const struct ofp_header *oh)
|
||||
{
|
||||
struct ofputil_table_mod pm;
|
||||
enum ofperr error;
|
||||
|
||||
error = ofputil_decode_table_mod(oh, &pm);
|
||||
if (error) {
|
||||
ofp_print_error(string, error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pm.table_id == 0xff) {
|
||||
ds_put_cstr(string, " table_id: ALL_TABLES");
|
||||
} else {
|
||||
ds_put_format(string, " table_id=%"PRIu8, pm.table_id);
|
||||
}
|
||||
|
||||
ds_put_cstr(string, ", flow_miss_config=");
|
||||
ofp_print_table_miss_config(string, pm.config);
|
||||
}
|
||||
|
||||
static void
|
||||
ofp_print_meter_flags(struct ds *s, uint16_t flags)
|
||||
{
|
||||
@@ -2431,6 +2474,10 @@ ofp_to_string__(const struct ofp_header *oh, enum ofpraw raw,
|
||||
ofp_print_port_mod(string, oh);
|
||||
break;
|
||||
|
||||
case OFPTYPE_TABLE_MOD:
|
||||
ofp_print_table_mod(string, oh);
|
||||
break;
|
||||
|
||||
case OFPTYPE_METER_MOD:
|
||||
ofp_print_meter_mod(string, oh);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user