vxlan: vxlan/vxlan.api API cleanup
[vpp.git] / extras / vom / vom / l2_binding.hpp
index d24f69e..de3608a 100644 (file)
@@ -20,6 +20,7 @@
 #include "vom/hw.hpp"
 #include "vom/inspect.hpp"
 #include "vom/interface.hpp"
+#include "vom/l2_vtr.hpp"
 #include "vom/object_base.hpp"
 #include "vom/om.hpp"
 #include "vom/singular_db.hpp"
@@ -37,29 +38,26 @@ public:
    */
   typedef interface::key_t key_t;
 
-  struct l2_vtr_op_t : public enum_base<l2_vtr_op_t>
+  struct l2_port_type_t : public enum_base<l2_port_type_t>
   {
-    l2_vtr_op_t(const l2_vtr_op_t& l) = default;
-    ~l2_vtr_op_t() = default;
-
-    const static l2_vtr_op_t L2_VTR_DISABLED;
-    const static l2_vtr_op_t L2_VTR_PUSH_1;
-    const static l2_vtr_op_t L2_VTR_PUSH_2;
-    const static l2_vtr_op_t L2_VTR_POP_1;
-    const static l2_vtr_op_t L2_VTR_POP_2;
-    const static l2_vtr_op_t L2_VTR_TRANSLATE_1_1;
-    const static l2_vtr_op_t L2_VTR_TRANSLATE_1_2;
-    const static l2_vtr_op_t L2_VTR_TRANSLATE_2_1;
-    const static l2_vtr_op_t L2_VTR_TRANSLATE_2_2;
+    l2_port_type_t(const l2_port_type_t& l) = default;
+    ~l2_port_type_t() = default;
+
+    const static l2_port_type_t L2_PORT_TYPE_NORMAL;
+    const static l2_port_type_t L2_PORT_TYPE_BVI;
+    const static l2_port_type_t L2_PORT_TYPE_UU_FWD;
 
   private:
-    l2_vtr_op_t(int v, const std::string s);
+    l2_port_type_t(int v, const std::string s);
   };
 
   /**
    * Construct a new object matching the desried state
    */
   l2_binding(const interface& itf, const bridge_domain& bd);
+  l2_binding(const interface& itf,
+             const bridge_domain& bd,
+             const l2_port_type_t& port_type);
 
   /**
    * Copy Constructor
@@ -100,7 +98,7 @@ public:
   /**
    * Set the VTR operation on the binding/interface
    */
-  void set(const l2_vtr_op_t& op, uint16_t tag);
+  void set(const l2_vtr::option_t& op, uint16_t tag);
 
   /**
    * Static function to find the bridge_domain in the model
@@ -187,6 +185,11 @@ private:
    */
   std::shared_ptr<bridge_domain> m_bd;
 
+  /**
+   * l2 port type i.e. normal, bvi or unknown unicast
+   */
+  l2_port_type_t m_port_type;
+
   /**
    * HW configuration for the binding. The bool representing the
    * do/don't bind.
@@ -196,7 +199,7 @@ private:
   /**
    * HW configuration for the VTR option
    */
-  HW::item<l2_vtr_op_t> m_vtr_op;
+  HW::item<l2_vtr::option_t> m_vtr_op;
 
   /**
    * The Dot1q tag for the VTR operation