+interface::set(const counter_t& count, const std::string& stat_type)
+{
+ if ("rx" == stat_type)
+ m_stats.m_rx = count;
+ else if ("tx" == stat_type)
+ m_stats.m_tx = count;
+ else if ("drops" == stat_type)
+ m_stats.m_drop = count;
+ else if ("rx-unicast" == stat_type)
+ m_stats.m_rx_unicast = count;
+ else if ("tx-unicast" == stat_type)
+ m_stats.m_tx_unicast = count;
+ else if ("rx-multicast" == stat_type)
+ m_stats.m_rx_multicast = count;
+ else if ("tx-multicast" == stat_type)
+ m_stats.m_tx_multicast = count;
+ else if ("rx-broadcast" == stat_type)
+ m_stats.m_rx_broadcast = count;
+ else if ("tx-broadcast" == stat_type)
+ m_stats.m_rx_broadcast = count;
+}
+
+const interface::stats_t&
+interface::get_stats(void) const
+{
+ return m_stats;
+}
+
+void
+interface::publish_stats()
+{
+ m_listener->handle_interface_stat(*this);
+}
+
+std::ostream&
+operator<<(std::ostream& os, const interface::stats_t& stats)
+{
+ os << "["
+ << "rx " << stats.m_rx << " rx-unicast " << stats.m_rx_unicast
+ << " rx-multicast " << stats.m_rx_multicast << " rx-broadcast "
+ << stats.m_rx_broadcast << " tx " << stats.m_tx << " tx-unicast "
+ << stats.m_tx_unicast << " tx-multicast " << stats.m_tx_multicast
+ << " tx-broadcast " << stats.m_tx_broadcast << " drops " << stats.m_drop
+ << "]" << std::endl;
+
+ return (os);
+}
+
+void
+interface::enable_stats_i(interface::stat_listener* el, const stats_type_t& st)