X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Fvxlan_tunnel.hpp;h=136f0380e6dbd65af6762d9f387c4dc0c3012eb0;hb=refs%2Fchanges%2F20%2F16420%2F4;hp=a0b3e9afa3ea22c6b3d839df27a112048b2a3be5;hpb=be2286b0a4ff0cd31791b86d38a5e72b06bc17c2;p=vpp.git diff --git a/extras/vom/vom/vxlan_tunnel.hpp b/extras/vom/vom/vxlan_tunnel.hpp index a0b3e9afa3e..136f0380e6d 100644 --- a/extras/vom/vom/vxlan_tunnel.hpp +++ b/extras/vom/vom/vxlan_tunnel.hpp @@ -49,11 +49,6 @@ public: const boost::asio::ip::address& dst, uint32_t vni); - /** - * less-than operator for map storage - */ - bool operator<(const endpoint_t& o) const; - /** * Comparison operator */ @@ -80,12 +75,28 @@ public: uint32_t vni; }; + /** + * mode for the tunnel + */ + struct mode_t : public enum_base + { + ~mode_t() = default; + const static mode_t STANDARD; + const static mode_t GBP; + const static mode_t GPE; + + private: + mode_t(int v, const std::string s); + mode_t() = default; + }; + /** * Construct a new object matching the desried state */ vxlan_tunnel(const boost::asio::ip::address& src, const boost::asio::ip::address& dst, - uint32_t vni); + uint32_t vni, + const mode_t& mode = mode_t::STANDARD); /** * Construct a new object matching the desried state with a handle @@ -94,7 +105,8 @@ public: vxlan_tunnel(const handle_t& hdl, const boost::asio::ip::address& src, const boost::asio::ip::address& dst, - uint32_t vni); + uint32_t vni, + const mode_t& mode = mode_t::STANDARD); /* * Destructor @@ -122,9 +134,9 @@ public: const handle_t& handle() const; /** - * Dump all L3Configs into the stream provided + * Fond the singular instance of the interface in the DB by key */ - static void dump(std::ostream& os); + static std::shared_ptr find(const interface::key_t& k); private: /** @@ -204,15 +216,16 @@ private: endpoint_t m_tep; /** - * A map of all VLAN tunnela against thier key + * The tunnel mode */ - static singular_db m_db; + mode_t m_mode; /** * Construct a unique name for the tunnel */ static std::string mk_name(const boost::asio::ip::address& src, const boost::asio::ip::address& dst, + const mode_t& mode, uint32_t vni); };