class interface : public object_base
{
public:
+ struct stats_type_t : public enum_base<stats_type_t>
+ {
+ const static stats_type_t DETAILED;
+ const static stats_type_t NORMAL;
+
+ private:
+ stats_type_t(int v, const std::string& s);
+ };
+
/**
* The key for interface's key
*/
struct type_t : enum_base<type_t>
{
/**
- * Unkown type
+ * Unknown type
*/
const static type_t UNKNOWN;
/**
*/
const static type_t TAP;
+ /**
+ * vhost-user interface type
+ */
+ const static type_t VHOST;
+
+ /**
+ * bond interface type
+ */
+ const static type_t BOND;
+
/**
* Convert VPP's name of the interface to a type
*/
/**
* Construct a new object matching the desried state
*/
- interface(const std::string& name, type_t type, admin_state_t state);
+ interface(const std::string& name,
+ type_t type,
+ admin_state_t state,
+ const std::string& tag = "");
/**
* Construct a new object matching the desried state mapped
* to a specific route_domain
interface(const std::string& name,
type_t type,
admin_state_t state,
- const route_domain& rd);
+ const route_domain& rd,
+ const std::string& tag = "");
/**
* Destructor
*/
*/
const l2_address_t& l2_address() const;
+ /**
+ * Set the admin state of the interface
+ */
+ void set(const admin_state_t& state);
+
/**
* Set the L2 Address
*/
*/
void set(const oper_state_t& state);
+ /**
+ * Set the tag to the interface
+ */
+ void set(const std::string& tag);
+
/**
* Comparison operator - only used for UT
*/
void succeeded() {}
/**
- * add the created interface to the DB
+ * remove the deleted interface from the DB
*/
void remove_interface() { interface::remove(this->item()); }
/**
* Enable stats for this interface
*/
- void enable_stats(stat_listener& el);
+ void enable_stats(stat_listener& el,
+ const stats_type_t& st = stats_type_t::NORMAL);
protected:
/**
/**
* enable the interface stats in the singular instance
*/
- void enable_stats_i(stat_listener& el);
+ void enable_stats_i(stat_listener& el, const stats_type_t& st);
/**
* Commit the acculmulated changes into VPP. i.e. to a 'HW" write.
*/
HW::item<l2_address_t> m_l2_address;
+ /**
+ * The state of the detailed stats collection
+ */
+ HW::item<stats_type_t> m_stats_type;
+
/**
* Operational state of the interface
*/
oper_state_t m_oper;
+ /**
+ * tag of the interface
+ */
+ std::string m_tag;
+
/**
* A map of all interfaces keyed against VPP's handle
*/