aboutsummaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-05-13 16:53:24 -0700
committerEthan Jackson <ethan@nicira.com>2011-05-20 15:53:28 -0700
commit9ac3fce4d5aea7e963439eb97f7c2d157aef4dfc (patch)
tree79e3beaeca613b5b46f9e3a81e6757cd5fa05d76 /vswitchd
parentc8544aa15f8811e9d6329d4a5e612ff7acb926c9 (diff)
cfm: Migrate cfm/show unixctl command to CFM module.
This patch moves the cfm/show unixctl show command from the bridge to the CFM module. This is more in line with how LACP does it, and will make future patches easier to implement.
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index ec4bb7be..aba0b942 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -164,7 +164,6 @@ static bool bridge_has_bond_fake_iface(const struct bridge *,
const char *name);
static bool port_is_bond_fake_iface(const struct port *);
-static unixctl_cb_func cfm_unixctl_show;
static unixctl_cb_func qos_unixctl_show;
static struct port *port_create(struct bridge *, const struct ovsrec_port *);
@@ -268,7 +267,6 @@ bridge_init(const char *remote)
ovsdb_idl_omit(idl, &ovsrec_ssl_col_external_ids);
/* Register unixctl commands. */
- unixctl_command_register("cfm/show", cfm_unixctl_show, NULL);
unixctl_command_register("qos/show", qos_unixctl_show, NULL);
unixctl_command_register("bridge/dump-flows", bridge_unixctl_dump_flows,
NULL);
@@ -276,6 +274,7 @@ bridge_init(const char *remote)
NULL);
lacp_init();
bond_init();
+ cfm_init();
}
void
@@ -1501,33 +1500,6 @@ bridge_wait(void)
}
}
-/* CFM unixctl user interface functions. */
-static void
-cfm_unixctl_show(struct unixctl_conn *conn,
- const char *args, void *aux OVS_UNUSED)
-{
- struct ds ds = DS_EMPTY_INITIALIZER;
- struct iface *iface;
- const struct cfm *cfm;
-
- iface = iface_find(args);
- if (!iface) {
- unixctl_command_reply(conn, 501, "no such interface");
- return;
- }
-
- cfm = ofproto_port_get_cfm(iface->port->bridge->ofproto, iface->ofp_port);
-
- if (!cfm) {
- unixctl_command_reply(conn, 501, "CFM not enabled");
- return;
- }
-
- cfm_dump_ds(cfm, &ds);
- unixctl_command_reply(conn, 200, ds_cstr(&ds));
- ds_destroy(&ds);
-}
-
/* QoS unixctl user interface functions. */
struct qos_unixctl_show_cbdata {
@@ -2549,6 +2521,7 @@ iface_configure_cfm(struct iface *iface)
cfm.mpid = mon->mpid;
cfm.interval = mon->interval ? *mon->interval : 1000;
+ cfm.name = iface->name;
memcpy(cfm.maid, maid, sizeof cfm.maid);