vom: Add bridge domain arp unicast forwarding flag
Change-Id: Iede47e8d9e168125bcd938cca6182c9270dcb5c4 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
This commit is contained in:

committed by
Neale Ranns

parent
0647cf22f8
commit
365e724ffe
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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<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
|
||||
*/
|
||||
@ -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
|
||||
*/
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user