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 std::shared_ptr< gbp_route_domain > singular() const
Return the matching 'singular instance'.
uint32_t table_id_t
type def the table-id
const std::shared_ptr< interface > get_ip6_uu_fwd() 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 pair 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.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
std::string to_string() const
Convert to string for debugging.
static rc_t write()
Write/Execute all commands hitherto enqueued.
static const log_level_t DEBUG
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.
virtual tables - tables with a dependency on another table
T & data()
Return the data read/written.
bool operator==(const gbp_route_domain &rdae) const
comparison operator
rc_t rc() const
Get the HW return code.
const key_t key() const
Return the object's key.
A cmd class that Delete an Route-Domain.
A representation of an interface in VPP.
A command class that creates an Route-Domain.
const std::shared_ptr< interface > get_ip4_uu_fwd() const
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.
gbp_route_domain(const route_domain &rd, scope_t scope)
Construct a GBP route_domain.
void replay(void)
replay the object to create it in hardware
static bool register_listener(listener *listener)
Register a listener of events.
const std::shared_ptr< route_domain > get_route_domain() const
Accessors for children.
route::table_id_t id() const
Return the route domain's VPP ID.