29 bridge_domain::learning_mode_t::learning_mode_t(
int v,
const std::string& s)
30 : enum_base<bridge_domain::learning_mode_t>(v, s)
37 bridge_domain::flood_mode_t::flood_mode_t(
int v,
const std::string& s)
38 : enum_base<bridge_domain::flood_mode_t>(v, s)
47 bridge_domain::uu_flood_mode_t::uu_flood_mode_t(
int v,
const std::string& s)
48 : enum_base<bridge_domain::uu_flood_mode_t>(v, s)
56 bridge_domain::mac_age_mode_t::mac_age_mode_t(
int v,
const std::string& s)
57 : enum_base<bridge_domain::mac_age_mode_t>(v, s)
66 bridge_domain::arp_term_mode_t::arp_term_mode_t(
int v,
const std::string& s)
67 : enum_base<bridge_domain::arp_term_mode_t>(v, s)
76 bridge_domain::arp_ufwd_mode_t::arp_ufwd_mode_t(
int v,
const std::string& s)
77 : enum_base<bridge_domain::arp_ufwd_mode_t>(v, s)
84 singular_db<uint32_t, bridge_domain> bridge_domain::m_db;
99 , m_learning_mode(lmode)
100 , m_arp_term_mode(amode)
101 , m_arp_ufwd_mode(aumode)
102 , m_flood_mode(fmode)
103 , m_uu_flood_mode(uufmode)
104 , m_mac_age_mode(mmode)
110 , m_learning_mode(o.m_learning_mode)
111 , m_arp_term_mode(o.m_arp_term_mode)
112 , m_arp_ufwd_mode(o.m_arp_ufwd_mode)
113 , m_flood_mode(o.m_flood_mode)
114 , m_uu_flood_mode(o.m_uu_flood_mode)
115 , m_mac_age_mode(o.m_mac_age_mode)
122 return (m_id.
data());
128 return (m_id.
data());
134 return ((m_learning_mode ==
b.m_learning_mode) &&
135 (m_flood_mode ==
b.m_flood_mode) &&
136 (m_uu_flood_mode ==
b.m_uu_flood_mode) &&
137 (m_mac_age_mode ==
b.m_mac_age_mode) &&
138 (m_arp_term_mode ==
b.m_arp_term_mode) &&
139 (m_arp_ufwd_mode ==
b.m_arp_ufwd_mode) &&
id() ==
b.id());
143 bridge_domain::sweep()
152 bridge_domain::replay()
156 m_id, m_learning_mode, m_arp_term_mode, m_arp_ufwd_mode, m_flood_mode,
157 m_uu_flood_mode, m_mac_age_mode));
166 m_db.release(m_id.
data(),
this);
172 std::ostringstream s;
173 s <<
"bridge-domain:[" << m_id.
to_string()
174 <<
" learning-mode:" << m_learning_mode.
to_string() <<
"]";
179 std::shared_ptr<bridge_domain>
182 return (m_db.find(
key));
193 m_id, m_learning_mode, m_arp_term_mode, m_arp_ufwd_mode, m_flood_mode,
194 m_uu_flood_mode, m_mac_age_mode));
198 std::shared_ptr<bridge_domain>
199 bridge_domain::find_or_add(
const bridge_domain& temp)
201 return (m_db.find_or_add(temp.m_id.data(), temp));
204 std::shared_ptr<bridge_domain>
207 return find_or_add(*
this);
222 std::shared_ptr<bridge_domain_cmds::dump_cmd>
cmd =
223 std::make_shared<bridge_domain_cmds::dump_cmd>();
228 for (
auto& record : *
cmd) {
229 auto& payload = record.get_payload();
233 (payload.learn ? learning_mode_t::ON : learning_mode_t::OFF),
234 (payload.arp_term ? arp_term_mode_t::ON : arp_term_mode_t::OFF),
235 (payload.arp_ufwd ? arp_ufwd_mode_t::ON : arp_ufwd_mode_t::OFF),
236 (payload.flood ? flood_mode_t::ON : flood_mode_t::OFF),
237 (payload.uu_flood ? uu_flood_mode_t::ON : uu_flood_mode_t::OFF),
238 (payload.mac_age ? mac_age_mode_t::ON : mac_age_mode_t::OFF));
249 std::shared_ptr<interface> uu_fwd_itf =
257 << payload.uu_fwd_sw_if_index;
263 for (
unsigned int ii = 0; ii < payload.n_sw_ifs; ii++) {
264 std::shared_ptr<interface> itf =
271 << payload.sw_if_details[ii].sw_if_index;
284 bridge_domain::event_handler::handle_replay()
290 bridge_domain::event_handler::order()
const