22 singular_db<gbp_endpoint_group::key_t, gbp_endpoint_group>
23 gbp_endpoint_group::m_db;
28 : remote_ep_timeout(0xffffffff)
93 , m_sclass(epg.m_sclass)
97 , m_retention(epg.m_retention)
104 m_db.release(
key(),
this);
122 m_retention = retention;
134 return (
key() == gg.
key() && (m_vnid == gg.m_vnid) &&
135 (m_retention == gg.m_retention) && (m_itf == gg.m_itf) &&
136 (m_rd == gg.m_rd) && (m_bd == gg.m_bd));
140 gbp_endpoint_group::sweep()
153 m_hw, m_vnid, m_sclass, m_bd->id(), m_rd->id(), m_retention,
161 std::ostringstream s;
162 s <<
"gbp-endpoint-group:[" 163 <<
"vnid:" << m_vnid <<
", sclass:" << m_sclass <<
", " 164 <<
"retention:[" << m_retention.
to_string() <<
"], " 165 << (m_itf ? m_itf->to_string() :
"NULL") <<
", " << m_bd->to_string()
166 <<
", " << m_rd->to_string() <<
"]";
176 m_hw, m_vnid, m_sclass, m_bd->id(), m_rd->id(), m_retention,
181 std::shared_ptr<gbp_endpoint_group>
184 return (m_db.find_or_add(temp.
key(), temp));
187 std::shared_ptr<gbp_endpoint_group>
190 return (m_db.find(k));
193 std::shared_ptr<gbp_endpoint_group>
196 return find_or_add(*
this);
205 const std::shared_ptr<gbp_route_domain>
211 const std::shared_ptr<gbp_bridge_domain>
225 gbp_endpoint_group::event_handler::handle_replay()
233 std::shared_ptr<gbp_endpoint_group_cmds::dump_cmd>
cmd =
234 std::make_shared<gbp_endpoint_group_cmds::dump_cmd>();
239 for (
auto& record : *cmd) {
240 auto& payload = record.get_payload();
242 std::shared_ptr<interface> itf =
244 std::shared_ptr<gbp_route_domain> rd =
246 std::shared_ptr<gbp_bridge_domain> bd =
250 <<
", " << payload.epg.rd_id <<
", " 251 << payload.epg.bd_id <<
"]";
253 if (itf && bd && rd) {
259 }
else if (bd && rd) {
266 <<
" or BD:" << payload.epg.bd_id
267 <<
" or RD:" << payload.epg.rd_id;
273 gbp_endpoint_group::event_handler::order()
const bool operator==(const retention_t &o) const
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.
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.
Endpoint Retention Policy Settings.
static rc_t write()
Write/Execute all commands hitherto enqueued.
static const log_level_t DEBUG
const key_t key() const
Return the object's key.
uint32_t remote_ep_timeout
Remote Endpoint timeout/ageing.
static const handle_t INVALID
A value of an interface handle_t that means the itf does not exist.
sclass_t key_t
The key for a GBP endpoint group is its ID.
static std::shared_ptr< gbp_bridge_domain > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
gbp_endpoint_group(vnid_t vnid, sclass_t sclass, const interface &itf, const gbp_route_domain &rd, const gbp_bridge_domain &bd)
Construct a GBP endpoint_group.
rc_t rc() const
Get the HW return code.
A entry in the ARP termination table of a Bridge Domain.
void set(const retention_t &retention)
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 entry in the ARP termination table of a Bridge Domain.
const std::shared_ptr< gbp_bridge_domain > get_bridge_domain() 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.
static void dump(std::ostream &os)
Dump all bridge_domain-doamin into the stream provided.
std::string to_string() const
static const log_level_t ERROR
const std::shared_ptr< gbp_route_domain > get_route_domain() const
A entry in the ARP termination table of a Route Domain.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
uint32_t vnid_t
EPG IDs are 32 bit integers.
static std::shared_ptr< gbp_route_domain > find(const key_t &k)
Find the instnace of the route_domain domain in the OM.
~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.
vnid_t vnid() const
Get the ID of the EPG.
static bool register_listener(listener *listener)
Register a listener of events.
A command class that creates or updates the GBP endpoint_group.