23 singular_db<l2_emulation::key_t, l2_emulation> l2_emulation::m_db;
25 l2_emulation::event_handler l2_emulation::m_evh;
31 : m_itf(itf.singular())
45 return (m_itf->key());
51 return ((*m_itf == *l.m_itf));
54 std::shared_ptr<l2_emulation>
57 return (m_db.find(key));
73 l2_emulation::replay()
86 m_db.release(m_itf->key(),
this);
93 s <<
"L2-emulation:[" << m_itf->to_string() <<
"]";
110 std::shared_ptr<l2_emulation>
113 return (m_db.find_or_add(temp.m_itf->key(), temp));
116 std::shared_ptr<l2_emulation>
119 return find_or_add(*
this);
128 l2_emulation::event_handler::event_handler()
135 l2_emulation::event_handler::handle_replay()
149 l2_emulation::event_handler::order()
const bool operator==(const l2_emulation &l) const
Comparison operator - for UT.
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.
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.