---
 NEWS                       |    1 +
 lib/cfm.c                  |   17 +++++++++++++++++
 vswitchd/ovs-vswitchd.8.in |    2 ++
 3 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
index 1d209e9..99380cf 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Post-v1.2.0
       - Added an OpenFlow extension for flexible learning.
     - ovs-appctl:
       - New "version" command to determine version of running daemon
+      - New "cfm/list" command to print interfaces configured with CFM
     - ovs-vswitchd:
       - The software switch now supports 255 OpenFlow tables, instead
         of just one.  By default, only table 0 is consulted, but the
diff --git a/lib/cfm.c b/lib/cfm.c
index 0bb2bf1..9ae9b03 100644
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -109,6 +109,8 @@ struct remote_mp {
 static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
 static struct hmap all_cfms = HMAP_INITIALIZER(&all_cfms);
 
+static void cfm_unixctl_list(struct unixctl_conn *, const char *args,
+                             void *aux);
 static void cfm_unixctl_show(struct unixctl_conn *, const char *args,
                              void *aux);
 
@@ -220,6 +222,7 @@ lookup_remote_mp(const struct cfm *cfm, uint64_t mpid)
 void
 cfm_init(void)
 {
+    unixctl_command_register("cfm/list", "", cfm_unixctl_list, NULL);
     unixctl_command_register("cfm/show", "interface", cfm_unixctl_show, NULL);
 }
 
@@ -503,6 +506,20 @@ cfm_get_remote_mpids(const struct cfm *cfm, const uint64_t 
**rmps,
     *n_rmps = cfm->rmps_array_len;
 }
 
+static void
+cfm_unixctl_list(struct unixctl_conn *conn,
+                 const char *args OVS_UNUSED, void *aux OVS_UNUSED)
+{
+    struct ds ds = DS_EMPTY_INITIALIZER;
+    struct cfm *cfm;
+
+    HMAP_FOR_EACH (cfm, hmap_node, &all_cfms) {
+        ds_put_format(&ds, "%s\n", cfm->name);
+    }
+    unixctl_command_reply(conn, 200, ds_cstr(&ds));
+    ds_destroy(&ds);
+}
+
 static struct cfm *
 cfm_find(const char *name)
 {
diff --git a/vswitchd/ovs-vswitchd.8.in b/vswitchd/ovs-vswitchd.8.in
index 516e6da..829c115 100644
--- a/vswitchd/ovs-vswitchd.8.in
+++ b/vswitchd/ovs-vswitchd.8.in
@@ -111,6 +111,8 @@ Causes \fBovs\-vswitchd\fR to gracefully terminate.
 .IP "\fBqos/show\fR \fIinterface\fR"
 Queries the kernel for Quality of Service configuration and statistics
 associated with the given \fIinterface\fR.
+.IP "\fBcfm/list\fR"
+Lists interfaces configured with Connectivity Fault Management.
 .IP "\fBcfm/show\fR \fIinterface\fR"
 Displays detailed information about Connectivity Fault Management
 configured on \fIinterface\fR.
-- 
1.7.1

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to