24 singular_db<l2_binding::key_t, l2_binding> l2_binding::m_db;
62 : m_itf(itf.singular())
74 , m_vtr_op(o.m_vtr_op)
75 , m_vtr_op_tag(o.m_vtr_op_tag)
82 return (m_itf->key());
88 return ((*m_itf == *l.m_itf) && (*m_bd == *l.m_bd));
91 std::shared_ptr<l2_binding>
94 return (m_db.find(key));
130 m_db.release(m_itf->key(),
this);
136 std::ostringstream s;
137 s <<
"L2-binding:[" << m_itf->to_string() <<
" " << m_bd->to_string() <<
" " 162 }
else if (!(*m_bd == *desired.m_bd)) {
178 if (m_vtr_op.update(desired.m_vtr_op)) {
184 std::shared_ptr<l2_binding>
185 l2_binding::find_or_add(
const l2_binding& temp)
187 return (m_db.find_or_add(temp.m_itf->key(), temp));
190 std::shared_ptr<l2_binding>
193 return find_or_add(*
this);
209 l2_binding::event_handler::handle_replay()
223 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...
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 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.
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 ...
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