diff options
author | Mengke Liu <mengke.liu@intel.com> | 2015-12-16 02:47:50 +0800 |
---|---|---|
committer | Jesse Gross <jesse@kernel.org> | 2015-12-15 13:06:11 -0800 |
commit | 4e548ad9e60f8248090a467fefcc58da5f298c96 (patch) | |
tree | 6a3becb2d557b741e23cca80926a6aeb74fe5de4 /lib/ofp-print.c | |
parent | aa68cf38e14d159ae3fef061765d7986b7376f6e (diff) | |
download | openvswitch-4e548ad9e60f8248090a467fefcc58da5f298c96.tar.gz |
geneve-map-rename: rename geneve-map to tlv-map.
This patch renames the command name related with geneve-map to a more
generic name as following:
add-geneve-map -> add-tlv-map
del-geneve-map -> del-tlv-map
dump-geneve-map -> dump-tlv-map
It also renames the Geneve_table to tlv_table.
By doing this renaming, the NSH variable context header (the same TLV
format as Geneve) or other protocol can reuse the field tun_metadata<N>
in the future.
Signed-off-by: Mengke Liu <mengke.liu@intel.com>
Signed-off-by: Ricky Li <ricky.li@intel.com>
Signed-off-by: Jesse Gross <jesse@kernel.org>
Diffstat (limited to 'lib/ofp-print.c')
-rw-r--r-- | lib/ofp-print.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/lib/ofp-print.c b/lib/ofp-print.c index d4f1972db..930b01a6e 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -3031,9 +3031,9 @@ ofp_print_bundle_add(struct ds *s, const struct ofp_header *oh, int verbosity) } static void -print_geneve_table(struct ds *s, struct ovs_list *mappings) +print_tlv_table(struct ds *s, struct ovs_list *mappings) { - struct ofputil_geneve_map *map; + struct ofputil_tlv_map *map; ds_put_cstr(s, " mapping table:\n"); ds_put_cstr(s, " class\ttype\tlength\tmatch field\n"); @@ -3048,12 +3048,12 @@ print_geneve_table(struct ds *s, struct ovs_list *mappings) } static void -ofp_print_geneve_table_mod(struct ds *s, const struct ofp_header *oh) +ofp_print_tlv_table_mod(struct ds *s, const struct ofp_header *oh) { int error; - struct ofputil_geneve_table_mod gtm; + struct ofputil_tlv_table_mod ttm; - error = ofputil_decode_geneve_table_mod(oh, >m); + error = ofputil_decode_tlv_table_mod(oh, &ttm); if (error) { ofp_print_error(s, error); return; @@ -3061,34 +3061,34 @@ ofp_print_geneve_table_mod(struct ds *s, const struct ofp_header *oh) ds_put_cstr(s, "\n "); - switch (gtm.command) { - case NXGTMC_ADD: + switch (ttm.command) { + case NXTTMC_ADD: ds_put_cstr(s, "ADD"); break; - case NXGTMC_DELETE: + case NXTTMC_DELETE: ds_put_cstr(s, "DEL"); break; - case NXGTMC_CLEAR: + case NXTTMC_CLEAR: ds_put_cstr(s, "CLEAR"); break; } - if (gtm.command != NXGTMC_CLEAR) { - print_geneve_table(s, >m.mappings); + if (ttm.command != NXTTMC_CLEAR) { + print_tlv_table(s, &ttm.mappings); } - ofputil_uninit_geneve_table(>m.mappings); + ofputil_uninit_tlv_table(&ttm.mappings); } static void -ofp_print_geneve_table_reply(struct ds *s, const struct ofp_header *oh) +ofp_print_tlv_table_reply(struct ds *s, const struct ofp_header *oh) { int error; - struct ofputil_geneve_table_reply gtr; - struct ofputil_geneve_map *map; + struct ofputil_tlv_table_reply ttr; + struct ofputil_tlv_map *map; int allocated_space = 0; - error = ofputil_decode_geneve_table_reply(oh, >r); + error = ofputil_decode_tlv_table_reply(oh, &ttr); if (error) { ofp_print_error(s, error); return; @@ -3096,17 +3096,17 @@ ofp_print_geneve_table_reply(struct ds *s, const struct ofp_header *oh) ds_put_char(s, '\n'); - LIST_FOR_EACH (map, list_node, >r.mappings) { + LIST_FOR_EACH (map, list_node, &ttr.mappings) { allocated_space += map->option_len; } ds_put_format(s, " max option space=%"PRIu32" max fields=%"PRIu16"\n", - gtr.max_option_space, gtr.max_fields); + ttr.max_option_space, ttr.max_fields); ds_put_format(s, " allocated option space=%d\n", allocated_space); ds_put_char(s, '\n'); - print_geneve_table(s, >r.mappings); + print_tlv_table(s, &ttr.mappings); - ofputil_uninit_geneve_table(>r.mappings); + ofputil_uninit_tlv_table(&ttr.mappings); } /* This function will print the request forward message. The reason for @@ -3410,15 +3410,15 @@ ofp_to_string__(const struct ofp_header *oh, enum ofpraw raw, ofp_print_bundle_add(string, msg, verbosity); break; - case OFPTYPE_NXT_GENEVE_TABLE_MOD: - ofp_print_geneve_table_mod(string, msg); + case OFPTYPE_NXT_TLV_TABLE_MOD: + ofp_print_tlv_table_mod(string, msg); break; - case OFPTYPE_NXT_GENEVE_TABLE_REQUEST: + case OFPTYPE_NXT_TLV_TABLE_REQUEST: break; - case OFPTYPE_NXT_GENEVE_TABLE_REPLY: - ofp_print_geneve_table_reply(string, msg); + case OFPTYPE_NXT_TLV_TABLE_REPLY: + ofp_print_tlv_table_reply(string, msg); break; } |