22 singular_db<gbp_ext_itf::key_t, gbp_ext_itf> gbp_ext_itf::m_db;
30 , m_itf(itf.singular())
31 , m_bd(gbd.singular())
32 , m_rd(grd.singular())
47 m_db.release(
key(),
this);
53 return (m_itf->key());
59 return m_itf->handle();
65 return ((
key() == gei.
key()) && (m_itf == gei.m_itf) && (m_rd == gei.m_rd) &&
83 m_bd->id(), m_rd->id()));
91 s <<
"gbp-ext_itf:[" << m_itf->to_string() <<
", " << m_bd->to_string()
92 <<
", " << m_rd->to_string() <<
"]";
102 m_bd->id(), m_rd->id()));
106 std::shared_ptr<gbp_ext_itf>
109 return (m_db.find_or_add(temp.
key(), temp));
112 std::shared_ptr<gbp_ext_itf>
115 return (m_db.find(k));
118 std::shared_ptr<gbp_ext_itf>
121 return find_or_add(*
this);
137 gbp_ext_itf::event_handler::handle_replay()
145 std::shared_ptr<gbp_ext_itf_cmds::dump_cmd>
cmd =
146 std::make_shared<gbp_ext_itf_cmds::dump_cmd>();
151 for (
auto& record : *cmd) {
152 auto& payload = record.get_payload();
154 std::shared_ptr<interface> itf =
156 std::shared_ptr<gbp_bridge_domain> gbd =
158 std::shared_ptr<gbp_route_domain> grd =
162 <<
", " << payload.ext_itf.bd_id <<
", " 163 << payload.ext_itf.rd_id <<
"]";
165 if (itf && gbd && grd) {
172 <<
" or BD:" << payload.ext_itf.bd_id
173 <<
" or RD:" << payload.ext_itf.rd_id;
179 gbp_ext_itf::event_handler::order()
const ~gbp_ext_itf()
Destructor.
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
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.
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_ext_itf(const interface &itf, const gbp_bridge_domain &gbd, const gbp_route_domain &grd)
Construct a GBP ext_itf.
static std::shared_ptr< gbp_bridge_domain > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
static std::shared_ptr< gbp_ext_itf > find(const key_t &k)
Find the instnace of the ext_itf interface in the OM.
const handle_t & handle() const
return the ext_itfulation interface's handle
A enternal interface for GBP.
static void dump(std::ostream &os)
Dump all bridge_domain-doamin into the stream provided.
A entry in the ARP termination table of a Bridge Domain.
bool operator==(const gbp_ext_itf &bdae) const
comparison operator
A representation of an interface in VPP.
std::string to_string() const
Convert to string for debugging.
A type declaration of an interface handle in VPP.
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.
std::shared_ptr< gbp_ext_itf > singular() const
Return the matching 'singular instance'.
static const log_level_t ERROR
A entry in the ARP termination table of a Route Domain.
Then L2/objects that bind to interfaces, BD, ACLS, etc.
const key_t key() const
Return the object's key.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
A cmd class that deletes a GBP ext_itf.
static std::shared_ptr< gbp_route_domain > find(const key_t &k)
Find the instnace of the route_domain domain in the OM.
interface::key_t key_t
The key for a GBP ext_itf interface.
void replay(void)
replay the object to create it in hardware
static bool register_listener(listener *listener)
Register a listener of events.
A command class that creates or updates the GBP ext_itf.