20 singular_db<bridge_domain_entry::key_t, bridge_domain_entry>
21 bridge_domain_entry::m_db;
23 bridge_domain_entry::event_handler bridge_domain_entry::m_evh;
31 , m_tx_itf(tx_itf.singular())
54 , m_tx_itf(bde.m_tx_itf)
61 return (std::make_pair(m_bd->key(), m_mac));
67 return ((
key() == bde.
key()) && (m_tx_itf == bde.m_tx_itf));
75 m_db.release(
key(),
this);
79 bridge_domain_entry::sweep()
93 m_hw, m_mac, m_bd->id(), m_tx_itf->handle(),
100 std::ostringstream s;
101 s <<
"bridge-domain-entry:[" << m_bd->to_string() <<
", " << m_mac.
to_string()
102 <<
", tx:" << m_tx_itf->name() <<
"]";
115 m_hw, m_mac, m_bd->id(), m_tx_itf->handle(),
120 std::shared_ptr<bridge_domain_entry>
123 return (m_db.find_or_add(temp.
key(), temp));
126 std::shared_ptr<bridge_domain_entry>
129 return (m_db.find(k));
132 std::shared_ptr<bridge_domain_entry>
135 return find_or_add(*
this);
144 bridge_domain_entry::event_handler::event_handler()
148 "bridge domain entry configurations",
this);
152 bridge_domain_entry::event_handler::handle_replay()
160 std::shared_ptr<bridge_domain_entry_cmds::dump_cmd>
cmd =
161 std::make_shared<bridge_domain_entry_cmds::dump_cmd>();
166 for (
auto& record : *cmd) {
167 auto& payload = record.get_payload();
174 <<
" itf:" << payload.sw_if_index
175 <<
" bd:" << payload.bd_id;
183 <<
" " << bd->to_string() <<
" " 184 << itf->to_string() <<
" mac:[" 197 bridge_domain_entry::event_handler::order()
const 211 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
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 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::string to_string() const
String conversion.
static rc_t write()
Write/Execute all commands hitherto enqueued.
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.
const key_t key() const
Return the object's key.
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.
rc_t rc() const
Get the HW return code.
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::string to_string() const
Convert to string for debugging.
std::pair< bridge_domain::key_t, mac_address_t > key_t
The key for a bridge_domain.
bool operator==(const bridge_domain_entry &be) const
comparison operator
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
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::shared_ptr< bridge_domain_entry > singular() const
Return the matching 'singular instance'.
std::shared_ptr< bridge_domain > singular() const
Return the matchin 'singular' instance of the bridge-domain.
std::ostream & operator<<(std::ostream &os, const std::pair< direction_t, interface::key_t > &key)
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.