vxlan: vxlan/vxlan.api API cleanup
[vpp.git] / extras / vom / vom / interface_types.cpp
index 7340037..239c3e6 100644 (file)
@@ -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<interface::type_t>(v, s)
-{
-}
+{}
 
 interface::oper_state_t::oper_state_t(int v, const std::string& s)
   : enum_base<interface::oper_state_t>(v, s)
-{
-}
+{}
 
 interface::admin_state_t::admin_state_t(int v, const std::string& s)
   : enum_base<interface::admin_state_t>(v, s)
-{
-}
+{}
 
 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)