24 singular_db<l2_emulation::key_t, l2_emulation> l2_emulation::m_db;
32 : m_itf(itf.singular())
46 return (m_itf->key());
52 return ((*m_itf == *l.m_itf));
55 std::shared_ptr<l2_emulation>
58 return (m_db.find(key));
74 l2_emulation::replay()
87 m_db.release(m_itf->key(),
this);
94 s <<
"L2-emulation:[" << m_itf->to_string() <<
"]";
111 std::shared_ptr<l2_emulation>
114 return (m_db.find_or_add(temp.m_itf->key(), temp));
117 std::shared_ptr<l2_emulation>
120 return find_or_add(*
this);
136 l2_emulation::event_handler::handle_replay()
150 l2_emulation::event_handler::order()
const bool operator==(const l2_emulation &l) const
Comparison operator - for UT.
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 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.
std::shared_ptr< l2_emulation > singular() const
Return the 'singular instance' of the L2 config that matches this object.
static const handle_t INVALID
A value of an interface handle_t that means the itf does not exist.
l2_emulation(const interface &itf)
Construct a new object matching the desried state.
rc_t rc() const
Get the HW return code.
const key_t & key() const
Return the binding's key.
static void dump(std::ostream &os)
Dump all l2_emulations into the stream provided.
A Clas representing the binding of an L2 interface to a bridge-domain and the properties of that bind...
std::string to_string() const
convert to string format for debug purposes
~l2_emulation()
Destructor.
A representation of an interface in VPP.
A functor class that enable L2 emulation to an interface.
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 std::shared_ptr< l2_emulation > find(const key_t &key)
Static function to find the bridge_domain in the model.
Then L2/objects that bind to interfaces, BD, ACLS, etc.
interface::key_t key_t
Key type for an L2 emulation in the singular DB.
The VPP Object Model (VOM) library.
A cmd class that Unbinds L2 configuration from an interface.
static bool register_listener(listener *listener)
Register a listener of events.