28 bridge_domain::learning_mode_t::learning_mode_t(
int v,
const std::string& s)
29 : enum_base<bridge_domain::learning_mode_t>(v, s)
36 singular_db<uint32_t, bridge_domain> bridge_domain::m_db;
38 bridge_domain::event_handler bridge_domain::m_evh;
45 , m_learning_mode(lmode)
51 , m_learning_mode(o.m_learning_mode)
70 return ((m_learning_mode == b.m_learning_mode) &&
id() == b.
id());
74 bridge_domain::sweep()
83 bridge_domain::replay()
95 m_db.release(m_id.
data(),
this);
101 std::ostringstream s;
102 s <<
"bridge-domain:[" << m_id.
to_string()
103 <<
" learning-mode:" << m_learning_mode.
to_string() <<
"]";
108 std::shared_ptr<bridge_domain>
111 return (m_db.find(key));
125 std::shared_ptr<bridge_domain>
128 return (m_db.find_or_add(temp.m_id.
data(), temp));
131 std::shared_ptr<bridge_domain>
134 return find_or_add(*
this);
149 std::shared_ptr<bridge_domain_cmds::dump_cmd>
cmd =
150 std::make_shared<bridge_domain_cmds::dump_cmd>();
155 for (
auto& record : *cmd) {
156 auto& payload = record.get_payload();
172 for (
unsigned int ii = 0; ii < payload.n_sw_ifs; ii++) {
173 std::shared_ptr<interface> itf =
181 bridge_domain::event_handler::event_handler()
188 bridge_domain::event_handler::handle_replay()
194 bridge_domain::event_handler::order()
const A Clas representing the binding of an L2 interface to a bridge-domain and the properties of that bind...
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 const learning_mode_t ON
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.
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.
static void dump(std::ostream &os)
Dump all bridge-doamin into the stream provided.
std::string to_string() const
convert to string format for debug purposes
T & data()
Return the data read/written.
rc_t rc() const
Get the HW return code.
static const learning_mode_t OFF
std::string to_string(void) const
convert to string format for debug purposes
uint32_t id() const
Return the bridge domain's VPP ID.
const key_t & key() const
Return the bridge domain's key.
Bridge Domain Learning mode.
A base class for all object_base in the VPP object_base-Model.
bool operator==(const bridge_domain &b) const
Comparison operator - for UT.
Tables in which entries are added, e.g bridge/route-domains.
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.
uint32_t key_t
Key Type for Bridge Domains in the sigular DB.
std::shared_ptr< bridge_domain > singular() const
Return the matchin 'singular' instance of the bridge-domain.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
A command class that creates an Bridge-Domain.
const std::string & to_string() const
convert to string format for debug purposes
bridge_domain(uint32_t id, const learning_mode_t &lmode=learning_mode_t::ON)
Construct a new object matching the desried state.
static bool register_listener(listener *listener)
Register a listener of events.
A cmd class that Delete an Bridge-Domain.
~bridge_domain()
Destructor.