27 singular_db<uint32_t, gbp_route_domain> gbp_route_domain::m_db;
37 , m_ip4_uu_fwd(rd.m_ip4_uu_fwd)
38 , m_ip6_uu_fwd(rd.m_ip6_uu_fwd)
47 , m_ip4_uu_fwd(ip4_uu_fwd.
singular())
48 , m_ip6_uu_fwd(ip6_uu_fwd.
singular())
52 const std::shared_ptr<interface> ip4_uu_fwd,
53 const std::shared_ptr<interface> ip6_uu_fwd)
56 , m_ip4_uu_fwd(ip4_uu_fwd->
singular())
57 , m_ip6_uu_fwd(ip6_uu_fwd->
singular())
76 return (m_rd->table_id());
79 const std::shared_ptr<route_domain>
90 if (m_ip4_uu_fwd && b.m_ip4_uu_fwd)
91 equal &= (m_ip4_uu_fwd->key() == b.m_ip4_uu_fwd->key());
92 else if (!m_ip4_uu_fwd && !b.m_ip4_uu_fwd)
97 if (m_ip6_uu_fwd && b.m_ip6_uu_fwd)
98 equal &= (m_ip6_uu_fwd->key() == b.m_ip6_uu_fwd->key());
99 else if (!m_ip6_uu_fwd && !b.m_ip6_uu_fwd)
104 return ((m_rd->key() == b.m_rd->key()) && equal);
108 gbp_route_domain::sweep()
120 if (m_ip4_uu_fwd && m_ip6_uu_fwd)
122 m_id, m_ip4_uu_fwd->handle(), m_ip6_uu_fwd->handle()));
134 m_db.release(m_id.
data(),
this);
140 std::ostringstream s;
141 s <<
"gbp-route-domain:[" << m_rd->to_string();
144 s <<
" v4-uu:[" << m_ip4_uu_fwd->to_string() <<
"]";
146 s <<
" v6-uu:[" << m_ip6_uu_fwd->to_string() <<
"]";
153 std::shared_ptr<gbp_route_domain>
156 return (m_db.find(key));
166 if (m_ip4_uu_fwd && m_ip6_uu_fwd)
168 m_id, m_ip4_uu_fwd->handle(), m_ip6_uu_fwd->handle()));
175 std::shared_ptr<gbp_route_domain>
178 return (m_db.find_or_add(temp.m_id.
data(), temp));
181 std::shared_ptr<gbp_route_domain>
184 return find_or_add(*
this);
199 std::shared_ptr<gbp_route_domain_cmds::dump_cmd>
cmd =
200 std::make_shared<gbp_route_domain_cmds::dump_cmd>();
205 for (
auto& record : *cmd) {
206 auto& payload = record.get_payload();
208 std::shared_ptr<interface> ip6_uu_fwd =
210 std::shared_ptr<interface> ip4_uu_fwd =
213 if (ip6_uu_fwd && ip4_uu_fwd) {
232 gbp_route_domain::event_handler::handle_replay()
238 gbp_route_domain::event_handler::order()
const
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
route_domain::key_t key_t
The key for a route_domain is the pari of EPG-IDs.
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
static std::shared_ptr< interface > find(const handle_t &h)
The the singular instance of the interface in the DB by handle.
std::string to_string() const
Convert to string for debugging.
bool operator==(const gbp_route_domain &rdae) const
comparison operator
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
static rc_t write()
Write/Execute all commands hitherto enqueued.
rc_t rc() const
Get the HW return code.
static const log_level_t DEBUG
gbp_route_domain(const route_domain &rd)
Construct a GBP route_domain.
std::shared_ptr< gbp_route_domain > singular() const
Return the matching 'singular instance'.
static void dump(std::ostream &os)
Dump all route_domain-doamin into the stream provided.
static const handle_t INVALID
A value of an interface handle_t that means the itf does not exist.
const std::shared_ptr< route_domain > get_route_domain()
virtual tables - tables with a dependency on another table
T & data()
Return the data read/written.
uint32_t id() const
Return the route domain's VPP ID.
A cmd class that Delete an Route-Domain.
A representation of an interface in VPP.
A command class that creates an Route-Domain.
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
void event_handler(void *tls_async)
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
static const rc_t OK
The HW write was successfull.
static void enqueue(cmd *f)
Enqueue A command for execution.
A entry in the ARP termination table of a Route Domain.
~gbp_route_domain()
Destructor.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
static std::shared_ptr< gbp_route_domain > find(const key_t &k)
Find the instnace of the route_domain domain in the OM.
const key_t key() const
Return the object's key.
void replay(void)
replay the object to create it in hardware
static bool register_listener(listener *listener)
Register a listener of events.