27 singular_db<uint32_t, gbp_route_domain> gbp_route_domain::m_db;
38 , m_ip4_uu_fwd(rd.m_ip4_uu_fwd)
39 , m_ip6_uu_fwd(rd.m_ip6_uu_fwd)
50 , m_ip4_uu_fwd(ip4_uu_fwd.singular())
51 , m_ip6_uu_fwd(ip6_uu_fwd.singular())
57 const std::shared_ptr<interface> ip4_uu_fwd,
58 const std::shared_ptr<interface> ip6_uu_fwd)
62 , m_ip4_uu_fwd(ip4_uu_fwd)
63 , m_ip6_uu_fwd(ip6_uu_fwd)
66 m_ip4_uu_fwd = m_ip4_uu_fwd->singular();
68 m_ip6_uu_fwd = m_ip6_uu_fwd->singular();
89 return (m_rd->table_id());
92 const std::shared_ptr<route_domain>
98 const std::shared_ptr<interface>
104 const std::shared_ptr<interface>
115 if (m_ip4_uu_fwd &&
b.m_ip4_uu_fwd)
116 equal &= (m_ip4_uu_fwd->key() ==
b.m_ip4_uu_fwd->key());
117 else if (!m_ip4_uu_fwd && !
b.m_ip4_uu_fwd)
122 if (m_ip6_uu_fwd &&
b.m_ip6_uu_fwd)
123 equal &= (m_ip6_uu_fwd->key() ==
b.m_ip6_uu_fwd->key());
124 else if (!m_ip6_uu_fwd && !
b.m_ip6_uu_fwd)
129 return ((m_rd->key() ==
b.m_rd->key()) && m_scope ==
b.m_scope && equal);
133 gbp_route_domain::sweep()
145 if (m_ip4_uu_fwd && m_ip6_uu_fwd)
147 m_id, m_scope, m_ip4_uu_fwd->handle(), m_ip6_uu_fwd->handle()));
159 m_db.release(m_id.
data(),
this);
165 std::ostringstream s;
166 s <<
"gbp-route-domain:[" << m_rd->to_string() <<
"scope:" << m_scope;
169 s <<
" v4-uu:[" << m_ip4_uu_fwd->to_string() <<
"]";
171 s <<
" v6-uu:[" << m_ip6_uu_fwd->to_string() <<
"]";
178 std::shared_ptr<gbp_route_domain>
181 return (m_db.find(
key));
188 if (m_ip4_uu_fwd && m_ip6_uu_fwd)
190 m_id, m_scope, m_ip4_uu_fwd->handle(), m_ip6_uu_fwd->handle()));
197 std::shared_ptr<gbp_route_domain>
200 return (m_db.find_or_add(temp.key(), temp));
203 std::shared_ptr<gbp_route_domain>
206 return find_or_add(*
this);
221 std::shared_ptr<gbp_route_domain_cmds::dump_cmd>
cmd =
222 std::make_shared<gbp_route_domain_cmds::dump_cmd>();
227 for (
auto& record : *
cmd) {
228 auto& payload = record.get_payload();
230 std::shared_ptr<interface> ip6_uu_fwd =
232 std::shared_ptr<interface> ip4_uu_fwd =
235 if (ip6_uu_fwd && ip4_uu_fwd) {
255 gbp_route_domain::event_handler::handle_replay()
261 gbp_route_domain::event_handler::order()
const