26 :
interface(mk_name(parent, vlan), parent.type(), state)
27 , m_parent(parent.singular())
53 , m_parent(o.m_parent)
61 return (interface::operator==(s) && (m_parent->key() == s.m_parent->key()) &&
62 (m_vlan == s.m_vlan));
66 sub_interface::mk_name(
const interface& parent, vlan_id_t vlan)
68 return (parent.
name() +
"." + std::to_string(vlan));
72 sub_interface::mk_create_cmd(std::queue<cmd*>& q)
81 sub_interface::mk_delete_cmd(std::queue<cmd*>& q)
88 std::shared_ptr<sub_interface>
91 return std::dynamic_pointer_cast<
sub_interface>(singular_i());
94 std::shared_ptr<interface>
95 sub_interface::singular_i()
const 97 return m_db.find_or_add(
key(), *
this);
100 std::shared_ptr<sub_interface>
void release()
release/remove an interface form the singular store
~sub_interface()
Destructor.
HW::item< handle_t > m_hdl
The SW interface handle VPP has asigned to the interface.
virtual void sweep(void)
Sweep/reap the object if still stale.
sub_interface(const interface &parent, admin_state_t state, vlan_id_t vlan)
Construct a new object matching the desried state.
static std::shared_ptr< sub_interface > find(const key_t &k)
Find a subinterface from its key.
static singular_db< key_t, interface > m_db
A map of all interfaces key against the interface's name.
vhost_vring_state_t state
A functor class that creates an interface.
A cmd class that Delete an interface.
The admin state of the interface.
A representation of an interface in VPP.
const std::string & name() const
Return the interface type.
The VPP Object Model (VOM) library.
bool operator==(const sub_interface &s) const
comparison operator - for UT
std::string key_t
The key for interface's key.
std::shared_ptr< sub_interface > singular() const
Return the matching 'singular instance' of the sub-interface.
const type_t & type() const
Return the interface type.
const key_t & key() const
Return the interface type.