X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp-api%2Fvom%2Finterface_types.cpp;h=139bdd52f9bd96da8097dcbf17b254c7a9f07b19;hb=25b049484fcf9161edb2c19250066b893c38c264;hp=6d3dcae57f2776df97d6df68b13158af4bdfd485;hpb=4ef4226282685a049aad439080ca5478da09ac06;p=vpp.git diff --git a/src/vpp-api/vom/interface_types.cpp b/src/vpp-api/vom/interface_types.cpp index 6d3dcae57f2..139bdd52f9b 100644 --- a/src/vpp-api/vom/interface_types.cpp +++ b/src/vpp-api/vom/interface_types.cpp @@ -14,7 +14,6 @@ */ #include "vom/interface.hpp" - namespace VOM { /* * constants and enums @@ -28,6 +27,7 @@ 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::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"); @@ -35,17 +35,24 @@ 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; @@ -75,6 +82,11 @@ interface::admin_state_t::admin_state_t(int v, const std::string& 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) {