[ovs-dev] [PATCH v4.1 5/5] ofctl: Add ovs-ofctl dump-table-features.

Alexander Wu alexander.wu at huawei.com
Fri Dec 6 09:28:30 UTC 2013


v4:
  No change.

v3:
  No change.

v2:
  No change

v1:
  Now the cli we implement is very crude. Maybe it could
  display better.

Signed-off-by: Alexander Wu <alexander.wu at huawei.com>
Reviewed-by: Simon Horman <horms at verge.net.au>
---
 utilities/ovs-ofctl.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 5eb8cf4..05234aa 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -281,6 +281,7 @@ usage(void)
            "  show SWITCH                 show OpenFlow information\n"
            "  dump-desc SWITCH            print switch description\n"
            "  dump-tables SWITCH          print table stats\n"
+           "  dump-table-features SWITCH  print table features\n"
            "  mod-port SWITCH IFACE ACT   modify port behavior\n"
            "  mod-table SWITCH MOD        modify flow table behavior\n"
            "  get-frags SWITCH            print fragment handling behavior\n"
@@ -650,6 +651,21 @@ ofctl_dump_tables(int argc OVS_UNUSED, char *argv[])
     dump_trivial_stats_transaction(argv[1], OFPRAW_OFPST_TABLE_REQUEST);
 }
 
+static void
+ofctl_dump_table_features(int argc OVS_UNUSED, char *argv[])
+{
+    struct ofpbuf *request;
+    struct vconn *vconn;
+
+    open_vconn(argv[1], &vconn);
+    request = ofputil_encode_table_features_request(vconn_get_version(vconn));
+    if (request) {
+        dump_stats_transaction(vconn, request);
+    }
+
+    vconn_close(vconn);
+}
+
 static bool
 fetch_port_by_features(const char *vconn_name,
                        const char *port_name, ofp_port_t port_no,
@@ -3340,6 +3356,7 @@ static const struct command all_commands[] = {
     { "snoop", 1, 1, ofctl_snoop },
     { "dump-desc", 1, 1, ofctl_dump_desc },
     { "dump-tables", 1, 1, ofctl_dump_tables },
+    { "dump-table-features", 1, 1, ofctl_dump_table_features },
     { "dump-flows", 1, 2, ofctl_dump_flows },
     { "dump-aggregate", 1, 2, ofctl_dump_aggregate },
     { "queue-stats", 1, 3, ofctl_queue_stats },
-- 
1.7.3.1.msysgit.0





More information about the dev mailing list