From 365e724ffe5c5420b338b20c06a6c73171f39bce Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Mon, 27 May 2019 18:36:15 +0200 Subject: vom: Add bridge domain arp unicast forwarding flag Change-Id: Iede47e8d9e168125bcd938cca6182c9270dcb5c4 Signed-off-by: Mohsin Kazmi --- extras/vom/vom/bridge_domain.cpp | 22 +++++++++++++++++++--- extras/vom/vom/bridge_domain.hpp | 21 +++++++++++++++++++++ extras/vom/vom/bridge_domain_cmds.cpp | 3 +++ extras/vom/vom/bridge_domain_cmds.hpp | 5 +++++ 4 files changed, 48 insertions(+), 3 deletions(-) (limited to 'extras/vom') 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(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 @@ -66,6 +66,21 @@ public: arp_term_mode_t(int v, const std::string& s); }; + /** + * Bridge Domain ARP Unicast Forward mode + */ + struct arp_ufwd_mode_t : enum_base + { + 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 */ @@ -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); @@ -236,6 +252,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 */ 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& 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& 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); @@ -63,6 +64,10 @@ private: * the learning mode for the bridge */ 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 */ -- cgit 1.2.3-korg