summaryrefslogtreecommitdiff
path: root/lib/ofp-print.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2015-07-02 20:35:44 -0700
committerBen Pfaff <blp@nicira.com>2015-07-03 08:46:40 -0700
commit03c72922c2c7b00933d97235fddfd7956948349d (patch)
treef88c3a5f4062c4721b0cf00be570c7a90d359b5d /lib/ofp-print.c
parent82c22d34b5f459bc968fd268112d1e33bd103943 (diff)
downloadopenvswitch-03c72922c2c7b00933d97235fddfd7956948349d.tar.gz
Implement OpenFlow 1.4+ OFPMP_TABLE_DESC message.
Signed-off-by: Ben Pfaff <blp@nicira.com> Co-authored-by: Saloni Jain <saloni.jain@tcs.com> Signed-off-by: Saloni Jain <saloni.jain@tcs.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Diffstat (limited to 'lib/ofp-print.c')
-rw-r--r--lib/ofp-print.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index d76134f74..4603bb7cc 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -1025,6 +1025,18 @@ ofp_print_table_mod(struct ds *string, const struct ofp_header *oh)
}
}
+/* This function will print the Table description properties. */
+static void
+ofp_print_table_desc(struct ds *string, const struct ofputil_table_desc *td)
+{
+ ds_put_format(string, "\n table %"PRIu8, td->table_id);
+ ds_put_cstr(string, ":\n");
+ ds_put_format(string, " eviction=%s eviction_flags=",
+ ofputil_table_eviction_to_string(td->eviction));
+ ofputil_put_eviction_flags(string, td->eviction_flags);
+ ds_put_char(string, '\n');
+}
+
static void
ofp_print_queue_get_config_request(struct ds *string,
const struct ofp_header *oh)
@@ -2607,6 +2619,28 @@ ofp_print_table_features_reply(struct ds *s, const struct ofp_header *oh)
}
}
+static void
+ofp_print_table_desc_reply(struct ds *s, const struct ofp_header *oh)
+{
+ struct ofpbuf b;
+
+ ofpbuf_use_const(&b, oh, ntohs(oh->length));
+
+ for (;;) {
+ struct ofputil_table_desc td;
+ int retval;
+
+ retval = ofputil_decode_table_desc(&b, &td, oh->version);
+ if (retval) {
+ if (retval != EOF) {
+ ofp_print_error(s, retval);
+ }
+ return;
+ }
+ ofp_print_table_desc(s, &td);
+ }
+}
+
static const char *
bundle_flags_to_name(uint32_t bit)
{
@@ -2814,6 +2848,11 @@ ofp_to_string__(const struct ofp_header *oh, enum ofpraw raw,
ofp_print_table_features_reply(string, oh);
break;
+ case OFPTYPE_TABLE_DESC_REQUEST:
+ case OFPTYPE_TABLE_DESC_REPLY:
+ ofp_print_table_desc_reply(string, oh);
+ break;
+
case OFPTYPE_HELLO:
ofp_print_hello(string, oh);
break;