21 singular_db<nat_static::key_t, nat_static> nat_static::m_db;
46 , m_inside(ns.m_inside)
47 , m_outside(ns.m_outside)
56 m_db.release(
key(),
this);
62 return (std::make_pair(m_rd->key(), m_outside));
68 return ((
key() == n.
key()) && (m_inside == n.m_inside));
75 if (m_inside.is_v4()) {
77 m_hw, m_rd->table_id(), m_inside.to_v4(), m_outside.to_v4()));
80 m_hw, m_rd->table_id(), m_inside.to_v6(), m_outside.to_v6()));
90 if (m_inside.is_v4()) {
92 m_hw, m_rd->table_id(), m_inside.to_v4(), m_outside.to_v4()));
95 m_hw, m_rd->table_id(), m_inside.to_v6(), m_outside.to_v6()));
107 if (m_inside.is_v4()) {
109 m_hw, m_rd->table_id(), m_inside.to_v4(), m_outside.to_v4()));
112 m_hw, m_rd->table_id(), m_inside.to_v6(), m_outside.to_v6()));
120 std::ostringstream s;
122 <<
"table:" << m_rd->to_string() <<
" inside:" << m_inside.to_string()
123 <<
" outside:" << m_outside.to_string() <<
"]";
128 std::shared_ptr<nat_static>
129 nat_static::find_or_add(
const nat_static& temp)
131 return (m_db.find_or_add(temp.
key(), temp));
134 std::shared_ptr<nat_static>
137 return (m_db.find(
key));
140 std::shared_ptr<nat_static>
143 return find_or_add(*
this);
159 nat_static::event_handler::handle_replay()
170 std::shared_ptr<nat_static_cmds::dump_44_cmd> cmd44 =
171 std::make_shared<nat_static_cmds::dump_44_cmd>();
176 for (
auto& record : *cmd44) {
178 auto& payload = record.get_payload();
183 nat_static n(route_domain(payload.vrf_id), inside, outside);
193 std::shared_ptr<nat_static_cmds::dump_66_cmd> cmd66 =
194 std::make_shared<nat_static_cmds::dump_66_cmd>();
199 for (
auto& record : *cmd66) {
201 auto& payload = record.get_payload();
206 nat_static n(route_domain(payload.vrf_id), inside, outside);
218 nat_static::event_handler::order()
const