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())
53 const std::shared_ptr<interface> ip4_uu_fwd,
54 const std::shared_ptr<interface> ip6_uu_fwd)
57 , m_ip4_uu_fwd(ip4_uu_fwd)
58 , m_ip6_uu_fwd(ip6_uu_fwd)
61 m_ip4_uu_fwd = m_ip4_uu_fwd->singular();
63 m_ip6_uu_fwd = m_ip6_uu_fwd->singular();
83 return (m_rd->table_id());
86 const std::shared_ptr<route_domain>
92 const std::shared_ptr<interface>
98 const std::shared_ptr<interface>
109 if (m_ip4_uu_fwd && b.m_ip4_uu_fwd)
110 equal &= (m_ip4_uu_fwd->key() == b.m_ip4_uu_fwd->key());
111 else if (!m_ip4_uu_fwd && !b.m_ip4_uu_fwd)
116 if (m_ip6_uu_fwd && b.m_ip6_uu_fwd)
117 equal &= (m_ip6_uu_fwd->key() == b.m_ip6_uu_fwd->key());
118 else if (!m_ip6_uu_fwd && !b.m_ip6_uu_fwd)
123 return ((m_rd->key() == b.m_rd->key()) && equal);
127 gbp_route_domain::sweep()
139 if (m_ip4_uu_fwd && m_ip6_uu_fwd)
141 m_id, m_ip4_uu_fwd->handle(), m_ip6_uu_fwd->handle()));
153 m_db.release(m_id.
data(),
this);
159 std::ostringstream s;
160 s <<
"gbp-route-domain:[" << m_rd->to_string();
163 s <<
" v4-uu:[" << m_ip4_uu_fwd->to_string() <<
"]";
165 s <<
" v6-uu:[" << m_ip6_uu_fwd->to_string() <<
"]";
172 std::shared_ptr<gbp_route_domain>
175 return (m_db.find(key));
185 if (m_ip4_uu_fwd && m_ip6_uu_fwd)
187 m_id, m_ip4_uu_fwd->handle(), m_ip6_uu_fwd->handle()));
194 std::shared_ptr<gbp_route_domain>
197 return (m_db.find_or_add(temp.
key(), temp));
200 std::shared_ptr<gbp_route_domain>
203 return find_or_add(*
this);
218 std::shared_ptr<gbp_route_domain_cmds::dump_cmd>
cmd =
219 std::make_shared<gbp_route_domain_cmds::dump_cmd>();
224 for (
auto& record : *cmd) {
225 auto& payload = record.get_payload();
227 std::shared_ptr<interface> ip6_uu_fwd =
229 std::shared_ptr<interface> ip4_uu_fwd =
232 if (ip6_uu_fwd && ip4_uu_fwd) {
251 gbp_route_domain::event_handler::handle_replay()
257 gbp_route_domain::event_handler::order()
const uint32_t table_id_t
type def the table-id
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.
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.
virtual tables - tables with a dependency on another table
T & data()
Return the data read/written.
const std::shared_ptr< interface > get_ip6_uu_fwd() const
A cmd class that Delete an Route-Domain.
const std::shared_ptr< interface > get_ip4_uu_fwd() const
const std::shared_ptr< route_domain > get_route_domain() const
Accessors for children.
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.
route::table_id_t id() const
Return the route domain's VPP ID.