* Construct a new object matching the desried state
*/
sub_interface(const interface& parent, admin_state_t state, vlan_id_t vlan);
+
+ sub_interface(const interface& parent,
+ admin_state_t state,
+ const route_domain& rd,
+ vlan_id_t vlan);
+
/**
* Destructor
*/
sub_interface(const sub_interface& o);
/**
- * Return the matching 'singular instance' of the sub-interface
+ * comparison operator - for UT
*/
- std::shared_ptr<sub_interface> singular() const;
+ bool operator==(const sub_interface& s) const;
/**
- * A functor class that creates an interface
+ * Return the matching 'singular instance' of the sub-interface
*/
- class create_cmd : public interface::create_cmd<vapi::Create_vlan_subif>
- {
- public:
- /**
- * Cstrunctor taking the reference to the parent
- * and the sub-interface's VLAN
- */
- create_cmd(HW::item<handle_t>& item,
- const std::string& name,
- const handle_t& parent,
- uint16_t vlan);
-
- /**
- * Issue the command to VPP/HW
- */
- rc_t issue(connection& con);
-
- /**
- * convert to string format for debug purposes
- */
- std::string to_string() const;
-
- /**
- * Comparison operator - only used for UT
- */
- bool operator==(const create_cmd& i) const;
-
- private:
- /**
- * Refernece to the parents handle
- */
- const handle_t& m_parent;
-
- /**
- * The VLAN of the sub-interface
- */
- uint16_t m_vlan;
- };
+ std::shared_ptr<sub_interface> singular() const;
/**
- * A cmd class that Delete an interface
+ * Find a subinterface from its key
*/
- class delete_cmd : public interface::delete_cmd<vapi::Delete_subif>
- {
- public:
- /**
- * Constructor
- */
- delete_cmd(HW::item<handle_t>& item);
-
- /**
- * Issue the command to VPP/HW
- */
- rc_t issue(connection& con);
-
- /**
- * convert to string format for debug purposes
- */
- std::string to_string() const;
-
- /**
- * Comparison operator - only used for UT
- */
- bool operator==(const delete_cmd& i) const;
- };
+ static std::shared_ptr<sub_interface> find(const key_t& k);
private:
- /**
- * Construct with handle
- */
- sub_interface(const handle_t& handle,
- const interface& parent,
- admin_state_t state,
- vlan_id_t vlan);
- /**
- * The interface class can construct interfaces with handles
- */
- friend class interface;
-
/**
* Return the matching 'instance' of the sub-interface
* over-ride from the base class