38 gbp_bridge_domain::flags_t::flags_t(
int v,
const std::string& s)
46 singular_db<uint32_t, gbp_bridge_domain> gbp_bridge_domain::m_db;
60 , m_bvi(bvi.singular())
76 , m_bvi(bvi.singular())
77 , m_uu_fwd(uu_fwd.singular())
78 , m_bm_flood(bm_flood.singular())
85 const std::shared_ptr<interface> bvi,
86 const std::shared_ptr<interface> uu_fwd,
87 const std::shared_ptr<interface> bm_flood,
94 , m_bm_flood(bm_flood)
98 m_bvi = m_bvi->singular();
100 m_uu_fwd = m_uu_fwd->singular();
102 m_bm_flood = m_bm_flood->singular();
108 const std::shared_ptr<interface> uu_fwd,
109 const std::shared_ptr<interface> bm_flood,
112 , m_bd(bd.singular())
113 , m_rd(rd.singular())
114 , m_bvi(bvi.singular())
116 , m_bm_flood(bm_flood)
120 m_uu_fwd = m_uu_fwd->singular();
122 m_bm_flood = m_bm_flood->singular();
130 , m_uu_fwd(bd.m_uu_fwd)
131 , m_bm_flood(bd.m_bm_flood)
132 , m_flags(bd.m_flags)
139 return (m_bd->key());
148 const std::shared_ptr<bridge_domain>
154 const std::shared_ptr<interface>
165 if (m_bvi &&
b.m_bvi)
166 equal &= (m_bvi->key() ==
b.m_bvi->key());
167 else if (!m_bvi && !
b.m_bvi)
172 if (m_uu_fwd &&
b.m_uu_fwd)
173 equal &= (m_uu_fwd->key() ==
b.m_uu_fwd->key());
174 else if (!m_uu_fwd && !
b.m_uu_fwd)
179 if (m_bm_flood &&
b.m_bm_flood)
180 equal &= (m_bm_flood->key() ==
b.m_bm_flood->key());
181 else if (!m_bm_flood && !
b.m_bm_flood)
186 return ((m_bd->key() ==
b.m_bd->key()) && equal);
190 gbp_bridge_domain::sweep()
214 m_db.release(m_id.
data(),
this);
220 std::ostringstream s;
221 s <<
"gbp-bridge-domain:[" << m_bd->to_string()
225 s <<
" bvi:" << m_bvi->to_string();
227 s <<
" uu-fwd:" << m_uu_fwd->to_string();
234 std::shared_ptr<gbp_bridge_domain>
237 return (m_db.find(
key));
254 std::shared_ptr<gbp_bridge_domain>
257 return (m_db.find_or_add(temp.m_id.data(), temp));
260 std::shared_ptr<gbp_bridge_domain>
263 return find_or_add(*
this);
278 std::shared_ptr<gbp_bridge_domain_cmds::dump_cmd>
cmd =
279 std::make_shared<gbp_bridge_domain_cmds::dump_cmd>();
284 for (
auto& record : *
cmd) {
285 auto& payload = record.get_payload();
287 std::shared_ptr<interface> uu_fwd =
289 std::shared_ptr<interface> bm_flood =
291 std::shared_ptr<interface> bvi =
293 std::shared_ptr<gbp_route_domain> grd =
306 if (uu_fwd && bm_flood && bvi && grd) {
317 <<
"no BVI:" << payload.bd.bvi_sw_if_index
318 <<
" nor uu-fwd:" << payload.bd.uu_fwd_sw_if_index;
330 gbp_bridge_domain::event_handler::handle_replay()
336 gbp_bridge_domain::event_handler::order()
const