23 singular_db<l2_binding::key_t, l2_binding> l2_binding::m_db;
25 l2_binding::event_handler l2_binding::m_evh;
61 : m_itf(itf.singular())
73 , m_vtr_op(o.m_vtr_op)
74 , m_vtr_op_tag(o.m_vtr_op_tag)
81 return (m_itf->key());
87 return ((*m_itf == *l.m_itf) && (*m_bd == *l.m_bd));
90 std::shared_ptr<l2_binding>
93 return (m_db.find(key));
129 m_db.release(m_itf->key(),
this);
135 std::ostringstream s;
136 s <<
"L2-binding:[" << m_itf->to_string() <<
" " << m_bd->to_string() <<
" " 161 }
else if (!(*m_bd == *desired.m_bd)) {
177 if (m_vtr_op.update(desired.m_vtr_op)) {
183 std::shared_ptr<l2_binding>
184 l2_binding::find_or_add(
const l2_binding& temp)
186 return (m_db.find_or_add(temp.m_itf->key(), temp));
189 std::shared_ptr<l2_binding>
192 return find_or_add(*
this);
201 l2_binding::event_handler::event_handler()
208 l2_binding::event_handler::handle_replay()
222 l2_binding::event_handler::order()
const binding< l2_list > l2_binding
Typedef the L2 binding type.
static const rc_t NOOP
The HW write/update action was/has not been attempted.
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 const l2_vtr_op_t L2_VTR_PUSH_1
static const l2_vtr_op_t L2_VTR_POP_1
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
static const l2_vtr_op_t L2_VTR_DISABLED
static const l2_vtr_op_t L2_VTR_TRANSLATE_1_2
static rc_t write()
Write/Execute all commands hitherto enqueued.
Error codes that VPP will return during a HW write.
static std::shared_ptr< l2_binding > find(const key_t &key)
Static function to find the bridge_domain in the model.
bool operator==(const l2_binding &l) const
Comparison operator - for UT.
static const handle_t INVALID
A value of an interface handle_t that means the itf does not exist.
std::string to_string() const
convert to string format for debug purposes
static const l2_vtr_op_t L2_VTR_PUSH_2
A functor class that binds L2 configuration to an interface.
rc_t rc() const
Get the HW return code.
std::string to_string() const
convert to string format for debug purposes
const key_t & key() const
Return the binding's key.
static const l2_vtr_op_t L2_VTR_TRANSLATE_2_1
interface::key_t key_t
Key type for an L2 binding in the singular DB.
std::shared_ptr< l2_binding > singular() const
Return the 'singular instance' of the L2 config that matches this object.
A representation of an interface in VPP.
A base class for all object_base in the VPP object_base-Model.
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
A cmd class that Unbinds L2 configuration from an interface.
static const rc_t OK
The HW write was successfull.
static void enqueue(cmd *f)
Enqueue A command for execution.
void set(const l2_vtr_op_t &op, uint16_t tag)
Set the VTR operation on the binding/interface.
Then L2/objects that bind to interfaces, BD, ACLS, etc.
static const l2_vtr_op_t L2_VTR_TRANSLATE_2_2
The VPP Object Model (VOM) library.
static const rc_t UNSET
The value un-set.
static const type_t BVI
A brideged Virtual interface (aka SVI or IRB)
l2_binding(const interface &itf, const bridge_domain &bd)
Construct a new object matching the desried state.
l2_vtr_op_t(const l2_vtr_op_t &l)=default
static const l2_vtr_op_t L2_VTR_TRANSLATE_1_1
A cmd class sets the VTR operation.
static void dump(std::ostream &os)
Dump all l2_bindings into the stream provided.
static bool register_listener(listener *listener)
Register a listener of events.
static const l2_vtr_op_t L2_VTR_POP_2