22 singular_db<gbp_endpoint_group::key_t, gbp_endpoint_group>
23 gbp_endpoint_group::m_db;
33 , m_itf(itf.singular())
41 , m_epg_id(epg.m_epg_id)
51 m_db.release(
key(),
this);
69 return (
key() == gbpe.
key() && (m_itf == gbpe.m_itf) && (m_rd == gbpe.m_rd) &&
74 gbp_endpoint_group::sweep()
87 m_hw, m_epg_id, m_bd->id(), m_rd->table_id(), m_itf->handle()));
95 s <<
"gbp-endpoint-group:[" 96 <<
"epg:" << m_epg_id <<
", " << m_itf->to_string() <<
", " 97 << m_bd->to_string() <<
", " << m_rd->to_string() <<
"]";
107 m_hw, m_epg_id, m_bd->id(), m_rd->table_id(), m_itf->handle()));
111 std::shared_ptr<gbp_endpoint_group>
114 return (m_db.find_or_add(temp.
key(), temp));
117 std::shared_ptr<gbp_endpoint_group>
120 return (m_db.find(k));
123 std::shared_ptr<gbp_endpoint_group>
126 return find_or_add(*
this);
143 gbp_endpoint_group::event_handler::handle_replay()
151 std::shared_ptr<gbp_endpoint_group_cmds::dump_cmd>
cmd =
152 std::make_shared<gbp_endpoint_group_cmds::dump_cmd>();
157 for (
auto& record : *cmd) {
158 auto& payload = record.get_payload();
160 std::shared_ptr<interface> itf =
162 std::shared_ptr<route_domain> rd =
167 <<
", " << payload.epg.ip4_table_id <<
", " 168 << payload.epg.bd_id <<
"]";
170 if (itf && bd && rd) {
180 gbp_endpoint_group::event_handler::order()
const static std::shared_ptr< route_domain > find(const key_t &temp)
Find the instnace of the route domain in the OM.
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
gbp_endpoint_group(epg_id_t epg_id, const interface &itf, const route_domain &rd, const bridge_domain &bd)
Construct a GBP endpoint_group.
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.
uint32_t epg_id_t
EPG IDs are 32 bit integers.
std::string to_string() const
Convert to string for debugging.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
A cmd class that deletes a GBP endpoint_group.
static rc_t write()
Write/Execute all commands hitherto enqueued.
static const log_level_t DEBUG
static std::shared_ptr< bridge_domain > find(const key_t &key)
Static function to find the bridge_domain in the model.
const key_t key() const
Return the object's key.
epg_id_t id() const
Get the ID of the EPG.
rc_t rc() const
Get the HW return code.
bool operator==(const gbp_endpoint_group &bdae) const
comparison operator
std::shared_ptr< gbp_endpoint_group > singular() const
Return the matching 'singular instance'.
void replay(void)
replay the object to create it in hardware
A representation of an interface in VPP.
A base class for all object_base in the VPP object_base-Model.
A entry in the ARP termination table of a Bridge 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.
static void dump(std::ostream &os)
Dump all bridge_domain-doamin into the stream provided.
epg_id_t key_t
The key for a GBP endpoint group is its ID.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
~gbp_endpoint_group()
Destructor.
static std::shared_ptr< gbp_endpoint_group > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
static bool register_listener(listener *listener)
Register a listener of events.
A command class that creates or updates the GBP endpoint_group.