X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Fl2_binding.hpp;h=de3608a2626384f350a2b609d435ce81b3649b6a;hb=7c0eb56f40b3ccf8acd8f04e208aa50231aebeba;hp=d24f69ee33dad07b21693c24af6b5ae8d3743510;hpb=164e5f8c63652028ecb9c3570e1ea8618b163071;p=vpp.git diff --git a/extras/vom/vom/l2_binding.hpp b/extras/vom/vom/l2_binding.hpp index d24f69ee33d..de3608a2626 100644 --- a/extras/vom/vom/l2_binding.hpp +++ b/extras/vom/vom/l2_binding.hpp @@ -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 + struct l2_port_type_t : public enum_base { - 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 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 m_vtr_op; + HW::item m_vtr_op; /** * The Dot1q tag for the VTR operation