21 singular_db<bridge_domain_entry::key_t, bridge_domain_entry>
22 bridge_domain_entry::m_db;
32 , m_tx_itf(tx_itf.singular())
55 , m_tx_itf(bde.m_tx_itf)
62 return (std::make_pair(m_bd->key(), m_mac));
68 return ((
key() == bde.
key()) && (m_tx_itf == bde.m_tx_itf));
76 m_db.release(
key(),
this);
80 bridge_domain_entry::sweep()
94 m_hw, m_mac, m_bd->id(), m_tx_itf->handle(),
101 std::ostringstream s;
102 s <<
"bridge-domain-entry:[" << m_bd->to_string() <<
", " << m_mac.
to_string()
103 <<
", tx:" << m_tx_itf->name() <<
"]";
116 m_hw, m_mac, m_bd->id(), m_tx_itf->handle(),
121 std::shared_ptr<bridge_domain_entry>
124 return (m_db.find_or_add(temp.
key(), temp));
127 std::shared_ptr<bridge_domain_entry>
130 return (m_db.find(k));
133 std::shared_ptr<bridge_domain_entry>
136 return find_or_add(*
this);
149 "bridge domain entry configurations",
this);
153 bridge_domain_entry::event_handler::handle_replay()
161 std::shared_ptr<bridge_domain_entry_cmds::dump_cmd>
cmd =
162 std::make_shared<bridge_domain_entry_cmds::dump_cmd>();
167 for (
auto& record : *cmd) {
168 auto& payload = record.get_payload();
175 <<
" itf:" << payload.sw_if_index
176 <<
" bd:" << payload.bd_id;
184 <<
" " << bd->to_string() <<
" " 185 << itf->to_string() <<
" mac:[" 198 bridge_domain_entry::event_handler::order()
const 212 os <<
"[" << key.first <<
", " << key.second.to_string() <<
"]";
~bridge_domain_entry()
Destructor.
A command class that creates or updates the bridge_domain.
void replay(void)
replay the object to create it in hardware
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
bool operator==(const bridge_domain_entry &be) const
comparison operator
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::shared_ptr< bridge_domain > singular() const
Return the matchin 'singular' instance of the bridge-domain.
static std::shared_ptr< bridge_domain_entry > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
static void dump(std::ostream &os)
Dump all bridge_domain-doamin into the stream provided.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
std::shared_ptr< bridge_domain_entry > singular() const
Return the matching 'singular instance'.
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
A cmd class that deletes a bridge_domain.
static std::shared_ptr< bridge_domain > find(const key_t &key)
Static function to find the bridge_domain in the model.
bridge_domain_entry(const bridge_domain &bd, const mac_address_t &mac, const interface &tx_itf)
Construct a bridge_domain in the given bridge domain.
const key_t key() const
Return the object's key.
A MAC forwarding entry in the bridge-domain/L2-FIB.
A representation of an interface in VPP.
A base class for all object_base in the VPP object_base-Model.
std::pair< bridge_domain::key_t, mac_address_t > key_t
The key for 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 const log_level_t ERROR
std::string to_string() const
Convert to string for debugging.
std::ostream & operator<<(std::ostream &os, const std::pair< direction_t, interface::key_t > &key)
std::string to_string() const
String conversion.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
static const type_t BVI
A brideged Virtual interface (aka SVI or IRB)
Type def of a Ethernet address.
static bool register_listener(listener *listener)
Register a listener of events.
static const uint32_t DEFAULT_TABLE
The value of the defaultbridge domain.