27 singular_db<uint32_t, gbp_bridge_domain> gbp_bridge_domain::m_db;
38 , m_bvi(bvi.singular())
53 const std::shared_ptr<interface> bvi,
54 const std::shared_ptr<interface> uu_fwd)
64 const std::shared_ptr<interface> uu_fwd)
76 , m_uu_fwd(bd.m_uu_fwd)
92 const std::shared_ptr<bridge_domain>
98 const std::shared_ptr<interface>
109 if (m_bvi && b.m_bvi)
110 equal &= (m_bvi->key() == b.m_bvi->key());
111 else if (!m_bvi && !b.m_bvi)
116 if (m_uu_fwd && b.m_uu_fwd)
117 equal &= (m_uu_fwd->key() == b.m_uu_fwd->key());
118 else if (!m_uu_fwd && !b.m_uu_fwd)
123 return ((m_bd->key() == b.m_bd->key()) && equal);
127 gbp_bridge_domain::sweep()
150 m_db.release(m_id.
data(),
this);
156 std::ostringstream s;
157 s <<
"gbp-bridge-domain:[" << m_bd->to_string();
160 s <<
" bvi:" << m_bvi->to_string();
162 s <<
" uu-fwd:" << m_uu_fwd->to_string();
169 std::shared_ptr<gbp_bridge_domain>
172 return (m_db.find(key));
188 std::shared_ptr<gbp_bridge_domain>
191 return (m_db.find_or_add(temp.m_id.
data(), temp));
194 std::shared_ptr<gbp_bridge_domain>
197 return find_or_add(*
this);
212 std::shared_ptr<gbp_bridge_domain_cmds::dump_cmd>
cmd =
213 std::make_shared<gbp_bridge_domain_cmds::dump_cmd>();
218 for (
auto& record : *cmd) {
219 auto& payload = record.get_payload();
221 std::shared_ptr<interface> uu_fwd =
223 std::shared_ptr<interface> bvi =
236 <<
"no BVI:" << payload.bd.bvi_sw_if_index
237 <<
" nor uu-fwd:" << payload.bd.uu_fwd_sw_if_index;
249 gbp_bridge_domain::event_handler::handle_replay()
255 gbp_bridge_domain::event_handler::order()
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.
A cmd class that Delete an Bridge-Domain.
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.
const std::shared_ptr< interface > get_bvi()
static const log_level_t DEBUG
static void dump(std::ostream &os)
Dump all bridge_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.
std::shared_ptr< gbp_bridge_domain > singular() const
Return the matching 'singular instance'.
void replay(void)
replay the object to create it in hardware
static std::shared_ptr< gbp_bridge_domain > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
bool operator==(const gbp_bridge_domain &bdae) const
comparison operator
A command class that creates an Bridge-Domain.
A entry in the ARP termination table of a Bridge Domain.
gbp_bridge_domain(const bridge_domain &bd, const interface &bvi)
Construct a GBP bridge_domain.
bridge_domain::key_t key_t
The key for a bridge_domain is the pari of EPG-IDs.
A representation of an interface in VPP.
A base class for all object_base in the VPP object_base-Model.
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 const log_level_t ERROR
std::string to_string() const
Convert to string for debugging.
const std::shared_ptr< bridge_domain > get_bridge_domain()
const key_t key() const
Return the object's key.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
~gbp_bridge_domain()
Destructor.
static bool register_listener(listener *listener)
Register a listener of events.
uint32_t id() const
Return the bridge domain's VPP ID.