*/
#include "vom/interface.hpp"
-
namespace VOM {
/*
* constants and enums
const interface::type_t interface::type_t::LOCAL(6, "LOCAL");
const interface::type_t interface::type_t::TAP(7, "TAP");
const interface::type_t interface::type_t::VHOST(8, "VHOST");
+const interface::type_t interface::type_t::BOND(9, "Bond");
const interface::oper_state_t interface::oper_state_t::DOWN(0, "down");
const interface::oper_state_t interface::oper_state_t::UP(1, "up");
const interface::admin_state_t interface::admin_state_t::DOWN(0, "down");
const interface::admin_state_t interface::admin_state_t::UP(1, "up");
+const interface::stats_type_t interface::stats_type_t::DETAILED(0, "detailed");
+const interface::stats_type_t interface::stats_type_t::NORMAL(1, "normal");
+
interface::type_t
interface::type_t::from_string(const std::string& str)
{
if ((str.find("Virtual") != std::string::npos) ||
- (str.find("vhost") != std::string::npos)) {
+ (str.find("vhost") != std::string::npos) ||
+ (str.find("vhu") != std::string::npos)) {
return interface::type_t::VHOST;
+ } else if (str.find("Bond") != std::string::npos) {
+ return interface::type_t::BOND;
} else if (str.find("Ethernet") != std::string::npos) {
return interface::type_t::ETHERNET;
} else if (str.find("vxlan") != std::string::npos) {
return interface::type_t::VXLAN;
- } else if (str.find("loop") != std::string::npos) {
+ } else if ((str.find("loop") != std::string::npos) ||
+ (str.find("recirc") != std::string::npos)) {
return interface::type_t::LOOPBACK;
} else if (str.find("host-") != std::string::npos) {
return interface::type_t::AFPACKET;
{
}
+interface::stats_type_t::stats_type_t(int v, const std::string& s)
+ : enum_base<interface::stats_type_t>(v, s)
+{
+}
+
interface::admin_state_t
interface::admin_state_t::from_int(uint8_t v)
{