aboutsummaryrefslogtreecommitdiffstats
path: root/extras/vom
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2019-05-27 18:36:15 +0200
committerNeale Ranns <nranns@cisco.com>2019-06-03 10:42:31 +0000
commit365e724ffe5c5420b338b20c06a6c73171f39bce (patch)
tree4aa90eb1440c0f4acc50d08184dd715ab6adbe23 /extras/vom
parent0647cf22f8a8fff87f993e7a1d2eb1a5dbb1bdfe (diff)
vom: Add bridge domain arp unicast forwarding flag
Change-Id: Iede47e8d9e168125bcd938cca6182c9270dcb5c4 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'extras/vom')
-rw-r--r--extras/vom/vom/bridge_domain.cpp22
-rw-r--r--extras/vom/vom/bridge_domain.hpp21
-rw-r--r--extras/vom/vom/bridge_domain_cmds.cpp3
-rw-r--r--extras/vom/vom/bridge_domain_cmds.hpp5
4 files changed, 48 insertions, 3 deletions
diff --git a/extras/vom/vom/bridge_domain.cpp b/extras/vom/vom/bridge_domain.cpp
index 1cc55316bc0..7535af35b34 100644
--- a/extras/vom/vom/bridge_domain.cpp
+++ b/extras/vom/vom/bridge_domain.cpp
@@ -58,6 +58,16 @@ bridge_domain::arp_term_mode_t::arp_term_mode_t(int v, const std::string& s)
{
}
+const bridge_domain::arp_ufwd_mode_t bridge_domain::arp_ufwd_mode_t::ON(1,
+ "on");
+const bridge_domain::arp_ufwd_mode_t bridge_domain::arp_ufwd_mode_t::OFF(0,
+ "off");
+
+bridge_domain::arp_ufwd_mode_t::arp_ufwd_mode_t(int v, const std::string& s)
+ : enum_base<bridge_domain::arp_ufwd_mode_t>(v, s)
+{
+}
+
/**
* A DB of al the interfaces, key on the name
*/
@@ -71,11 +81,13 @@ bridge_domain::event_handler bridge_domain::m_evh;
bridge_domain::bridge_domain(uint32_t id,
const learning_mode_t& lmode,
const arp_term_mode_t& amode,
+ const arp_ufwd_mode_t& aumode,
const flood_mode_t& fmode,
const mac_age_mode_t& mmode)
: m_id(id)
, m_learning_mode(lmode)
, m_arp_term_mode(amode)
+ , m_arp_ufwd_mode(aumode)
, m_flood_mode(fmode)
, m_mac_age_mode(mmode)
{
@@ -85,6 +97,7 @@ bridge_domain::bridge_domain(const bridge_domain& o)
: m_id(o.m_id)
, m_learning_mode(o.m_learning_mode)
, m_arp_term_mode(o.m_arp_term_mode)
+ , m_arp_ufwd_mode(o.m_arp_ufwd_mode)
, m_flood_mode(o.m_flood_mode)
, m_mac_age_mode(o.m_mac_age_mode)
{
@@ -108,7 +121,8 @@ bridge_domain::operator==(const bridge_domain& b) const
return ((m_learning_mode == b.m_learning_mode) &&
(m_flood_mode == b.m_flood_mode) &&
(m_mac_age_mode == b.m_mac_age_mode) &&
- (m_arp_term_mode == b.m_arp_term_mode) && id() == b.id());
+ (m_arp_term_mode == b.m_arp_term_mode) &&
+ (m_arp_ufwd_mode == b.m_arp_ufwd_mode) && id() == b.id());
}
void
@@ -125,7 +139,8 @@ bridge_domain::replay()
{
if (rc_t::OK == m_id.rc()) {
HW::enqueue(new bridge_domain_cmds::create_cmd(
- m_id, m_learning_mode, m_arp_term_mode, m_flood_mode, m_mac_age_mode));
+ m_id, m_learning_mode, m_arp_term_mode, m_arp_ufwd_mode, m_flood_mode,
+ m_mac_age_mode));
}
}
@@ -161,7 +176,8 @@ bridge_domain::update(const bridge_domain& desired)
*/
if (rc_t::OK != m_id.rc()) {
HW::enqueue(new bridge_domain_cmds::create_cmd(
- m_id, m_learning_mode, m_arp_term_mode, m_flood_mode, m_mac_age_mode));
+ m_id, m_learning_mode, m_arp_term_mode, m_arp_ufwd_mode, m_flood_mode,
+ m_mac_age_mode));
}
}
diff --git a/extras/vom/vom/bridge_domain.hpp b/extras/vom/vom/bridge_domain.hpp
index d345da238ca..ecaae04496d 100644
--- a/extras/vom/vom/bridge_domain.hpp
+++ b/extras/vom/vom/bridge_domain.hpp
@@ -67,6 +67,21 @@ public:
};
/**
+ * Bridge Domain ARP Unicast Forward mode
+ */
+ struct arp_ufwd_mode_t : enum_base<arp_ufwd_mode_t>
+ {
+ const static arp_ufwd_mode_t ON;
+ const static arp_ufwd_mode_t OFF;
+
+ private:
+ /**
+ * Private constructor taking the value and the string name
+ */
+ arp_ufwd_mode_t(int v, const std::string& s);
+ };
+
+ /**
* Bridge Domain MAC aging mode
*/
struct mac_age_mode_t : enum_base<mac_age_mode_t>
@@ -107,6 +122,7 @@ public:
bridge_domain(uint32_t id,
const learning_mode_t& lmode = learning_mode_t::ON,
const arp_term_mode_t& amode = arp_term_mode_t::ON,
+ const arp_ufwd_mode_t& aumode = arp_ufwd_mode_t::OFF,
const flood_mode_t& fmode = flood_mode_t::ON,
const mac_age_mode_t& mmode = mac_age_mode_t::OFF);
@@ -237,6 +253,11 @@ private:
arp_term_mode_t m_arp_term_mode;
/**
+ * The ARP Unicast Forward mode of the bridge
+ */
+ arp_ufwd_mode_t m_arp_ufwd_mode;
+
+ /**
* The flood mode of the bridge
*/
flood_mode_t m_flood_mode;
diff --git a/extras/vom/vom/bridge_domain_cmds.cpp b/extras/vom/vom/bridge_domain_cmds.cpp
index 0e533be2899..a7dccf28a07 100644
--- a/extras/vom/vom/bridge_domain_cmds.cpp
+++ b/extras/vom/vom/bridge_domain_cmds.cpp
@@ -22,11 +22,13 @@ namespace bridge_domain_cmds {
create_cmd::create_cmd(HW::item<uint32_t>& item,
const bridge_domain::learning_mode_t& lmode,
const bridge_domain::arp_term_mode_t& amode,
+ const bridge_domain::arp_ufwd_mode_t& aumode,
const bridge_domain::flood_mode_t& fmode,
const bridge_domain::mac_age_mode_t& mmode)
: rpc_cmd(item)
, m_learning_mode(lmode)
, m_arp_term_mode(amode)
+ , m_arp_ufwd_mode(aumode)
, m_flood_mode(fmode)
, m_mac_age_mode(mmode)
{
@@ -50,6 +52,7 @@ create_cmd::issue(connection& con)
payload.forward = 1;
payload.learn = m_learning_mode.value();
payload.arp_term = m_arp_term_mode.value();
+ payload.arp_ufwd = m_arp_ufwd_mode.value();
payload.mac_age = m_mac_age_mode.value();
payload.is_add = 1;
diff --git a/extras/vom/vom/bridge_domain_cmds.hpp b/extras/vom/vom/bridge_domain_cmds.hpp
index 0ab1bfad95c..818de674823 100644
--- a/extras/vom/vom/bridge_domain_cmds.hpp
+++ b/extras/vom/vom/bridge_domain_cmds.hpp
@@ -37,6 +37,7 @@ public:
create_cmd(HW::item<uint32_t>& item,
const bridge_domain::learning_mode_t& lmode,
const bridge_domain::arp_term_mode_t& amode,
+ const bridge_domain::arp_ufwd_mode_t& aumode,
const bridge_domain::flood_mode_t& fmode,
const bridge_domain::mac_age_mode_t& mmode);
@@ -64,6 +65,10 @@ private:
*/
bridge_domain::arp_term_mode_t m_arp_term_mode;
/**
+ * the learning mode for the bridge
+ */
+ bridge_domain::arp_ufwd_mode_t m_arp_ufwd_mode;
+ /**
* the flood mode for the bridge
*/
bridge_domain::flood_mode_t m_flood_mode;