diff options
author | Neale Ranns <neale.ranns@cisco.com> | 2017-11-14 08:40:43 -0800 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2017-11-14 19:25:54 +0000 |
commit | 10e7a9f8d8c8572be16f9b3f0395da6f8eff22ec (patch) | |
tree | 76cad881f5bd9a2c1c3ec664a880c3d0ba299961 /src/vpp-api/vom/bridge_domain.cpp | |
parent | a161a6dedb1aa3aba00109d325d2909051a3c987 (diff) |
VOM: bridge-domain learning mode and route help commands
Change-Id: I2fa219d6530f1e7a3b8ae32d35a0c60ba57c5129
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/bridge_domain.cpp')
-rw-r--r-- | src/vpp-api/vom/bridge_domain.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/vpp-api/vom/bridge_domain.cpp b/src/vpp-api/vom/bridge_domain.cpp index 8e012b5d951..81d83621212 100644 --- a/src/vpp-api/vom/bridge_domain.cpp +++ b/src/vpp-api/vom/bridge_domain.cpp @@ -19,6 +19,17 @@ #include "vom/l2_binding.hpp" namespace VOM { + +const bridge_domain::learning_mode_t bridge_domain::learning_mode_t::ON(1, + "on"); +const bridge_domain::learning_mode_t bridge_domain::learning_mode_t::OFF(0, + "off"); + +bridge_domain::learning_mode_t::learning_mode_t(int v, const std::string& s) + : enum_base<bridge_domain::learning_mode_t>(v, s) +{ +} + /** * A DB of al the interfaces, key on the name */ @@ -29,13 +40,15 @@ bridge_domain::event_handler bridge_domain::m_evh; /** * Construct a new object matching the desried state */ -bridge_domain::bridge_domain(uint32_t id) +bridge_domain::bridge_domain(uint32_t id, const learning_mode_t& lmode) : m_id(id) + , m_learning_mode(lmode) { } bridge_domain::bridge_domain(const bridge_domain& o) : m_id(o.m_id) + , m_learning_mode(o.m_learning_mode) { } @@ -58,7 +71,7 @@ void bridge_domain::replay() { if (rc_t::OK == m_id.rc()) { - HW::enqueue(new bridge_domain_cmds::create_cmd(m_id)); + HW::enqueue(new bridge_domain_cmds::create_cmd(m_id, m_learning_mode)); } } @@ -116,7 +129,7 @@ bridge_domain::update(const bridge_domain& desired) * the desired state is always that the interface should be created */ if (rc_t::OK != m_id.rc()) { - HW::enqueue(new bridge_domain_cmds::create_cmd(m_id)); + HW::enqueue(new bridge_domain_cmds::create_cmd(m_id, m_learning_mode)); } } |