v5: Add dump-table-features to ovs-ofctl.8.in 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...@huawei.com> Reviewed-by: Simon Horman <ho...@verge.net.au> --- utilities/ovs-ofctl.8.in | 4 ++++ utilities/ovs-ofctl.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in index 411ad64..5a4d153 100644 --- a/utilities/ovs-ofctl.8.in +++ b/utilities/ovs-ofctl.8.in @@ -58,6 +58,10 @@ information on its flow tables and ports. \fBdump\-tables \fIswitch\fR Prints to the console statistics for each of the flow tables used by \fIswitch\fR. +.TP +\fBdump\-tables\-features \fIswitch\fR +Prints to the console features for each of the flow tables used by +\fIswitch\fR. . .TP \fBdump\-ports \fIswitch\fR [\fInetdev\fR] diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index c35e15b..52041be 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 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev