29 bridge_domain::learning_mode_t::learning_mode_t(
int v,
const std::string& s)
30 : enum_base<bridge_domain::learning_mode_t>(v, s)
37 singular_db<uint32_t, bridge_domain> bridge_domain::m_db;
39 bridge_domain::event_handler bridge_domain::m_evh;
46 , m_learning_mode(lmode)
52 , m_learning_mode(o.m_learning_mode)
71 return ((m_learning_mode == b.m_learning_mode) &&
id() == b.
id());
75 bridge_domain::sweep()
84 bridge_domain::replay()
96 m_db.release(m_id.
data(),
this);
102 std::ostringstream s;
103 s <<
"bridge-domain:[" << m_id.
to_string()
104 <<
" learning-mode:" << m_learning_mode.
to_string() <<
"]";
109 std::shared_ptr<bridge_domain>
112 return (m_db.find(key));
126 std::shared_ptr<bridge_domain>
129 return (m_db.find_or_add(temp.m_id.
data(), temp));
132 std::shared_ptr<bridge_domain>
135 return find_or_add(*
this);
150 std::shared_ptr<bridge_domain_cmds::dump_cmd>
cmd =
151 std::make_shared<bridge_domain_cmds::dump_cmd>();
156 for (
auto& record : *cmd) {
157 auto& payload = record.get_payload();
173 for (
unsigned int ii = 0; ii < payload.n_sw_ifs; ii++) {
174 std::shared_ptr<interface> itf =
182 bridge_domain::event_handler::event_handler()
189 bridge_domain::event_handler::handle_replay()
195 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...
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.
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.