X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Finterface_types.cpp;h=239c3e6abf6d8441e78a08a781508e2fce854edc;hb=7c0eb56f4;hp=73400373743ee42f3dfc4274ab3c1214332a67d9;hpb=208c29aac523231af2420a95ba7e5d361698780b;p=vpp.git diff --git a/extras/vom/vom/interface_types.cpp b/extras/vom/vom/interface_types.cpp index 73400373743..239c3e6abf6 100644 --- a/extras/vom/vom/interface_types.cpp +++ b/extras/vom/vom/interface_types.cpp @@ -25,12 +25,11 @@ const interface::type_t interface::type_t::VXLAN(3, "VXLAN"); const interface::type_t interface::type_t::AFPACKET(4, "AFPACKET"); const interface::type_t interface::type_t::LOOPBACK(5, "LOOPBACK"); 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::TAPV2(8, "TAPV2"); -const interface::type_t interface::type_t::VHOST(9, "VHOST"); -const interface::type_t interface::type_t::BOND(10, "Bond"); -const interface::type_t interface::type_t::PIPE(11, "Pipe"); -const interface::type_t interface::type_t::PIPE_END(12, "Pipe-end"); +const interface::type_t interface::type_t::TAPV2(7, "TAPV2"); +const interface::type_t interface::type_t::VHOST(8, "VHOST"); +const interface::type_t interface::type_t::BOND(9, "Bond"); +const interface::type_t interface::type_t::PIPE(10, "Pipe"); +const interface::type_t interface::type_t::PIPE_END(11, "Pipe-end"); const interface::oper_state_t interface::oper_state_t::DOWN(0, "down"); const interface::oper_state_t interface::oper_state_t::UP(1, "up"); @@ -46,29 +45,30 @@ interface::type_t::from_string(const std::string& str) { if ((str.find("Virtual") != std::string::npos) || (str.find("vhost") != std::string::npos) || - (str.find("vhu") != std::string::npos)) { + (str.find("vhu") != std::string::npos) || + (str.find("vhost-user") != std::string::npos)) { return interface::type_t::VHOST; - } else if (str.find("Bond") != std::string::npos) { + } else if (str.find("bond") != std::string::npos) { return interface::type_t::BOND; - } else if (str.find("Ethernet") != std::string::npos) { + } else if (str.find("dpdk") != std::string::npos) { return interface::type_t::ETHERNET; - } else if (str.find("vxlan") != std::string::npos) { + } 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("Loopback") != std::string::npos) || (str.find("recirc") != std::string::npos)) { return interface::type_t::LOOPBACK; - } else if (str.find("host-") != std::string::npos) { + } else if (str.find("af-packet") != std::string::npos) { return interface::type_t::AFPACKET; } else if (str.find("local") != std::string::npos) { return interface::type_t::LOCAL; } else if ((str.find("tapcli") != std::string::npos) || (str.find("tuntap") != std::string::npos)) { - return interface::type_t::TAP; - } else if (str.find("tap") != std::string::npos) { + return interface::type_t::UNKNOWN; + } else if (str.find("virtio") != std::string::npos) { return interface::type_t::TAPV2; - } else if (str.find("bvi") != std::string::npos) { + } else if (str.find("BVI") != std::string::npos) { return interface::type_t::BVI; - } else if (str.find("pipe") != std::string::npos) { + } else if (str.find("Pipe") != std::string::npos) { return interface::type_t::PIPE; } @@ -77,23 +77,19 @@ interface::type_t::from_string(const std::string& str) interface::type_t::type_t(int v, const std::string& s) : enum_base(v, s) -{ -} +{} interface::oper_state_t::oper_state_t(int v, const std::string& s) : enum_base(v, s) -{ -} +{} interface::admin_state_t::admin_state_t(int v, const std::string& s) : enum_base(v, s) -{ -} +{} interface::stats_type_t::stats_type_t(int v, const std::string& s) : enum_base(v, s) -{ -} +{} interface::admin_state_t interface::admin_state_t::from_int(uint8_t v)