X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Fgbp_subnet.hpp;h=f18aa01431ea3814f32dfd98ee98a4f7101bfacd;hp=b4adb40ae453243746894e091bc65ac0dded5c68;hb=b6a4795;hpb=164e5f8c63652028ecb9c3570e1ea8618b163071 diff --git a/extras/vom/vom/gbp_subnet.hpp b/extras/vom/vom/gbp_subnet.hpp index b4adb40ae45..f18aa01431e 100644 --- a/extras/vom/vom/gbp_subnet.hpp +++ b/extras/vom/vom/gbp_subnet.hpp @@ -16,9 +16,11 @@ #ifndef __VOM_GBP_SUBNET_H__ #define __VOM_GBP_SUBNET_H__ +#include + #include "vom/gbp_endpoint_group.hpp" #include "vom/gbp_recirc.hpp" -#include "vom/route.hpp" +#include "vom/gbp_route_domain.hpp" #include "vom/singular_db.hpp" namespace VOM { @@ -31,21 +33,57 @@ public: /** * The key for a GBP subnet; table and prefix */ - typedef std::pair key_t; + typedef std::pair key_t; + + struct type_t : public enum_base + { + /** + * Internal subnet is reachable through the source EPG's + * uplink interface. + */ + const static type_t STITCHED_INTERNAL; + + /** + * External subnet requires NAT translation before egress. + */ + const static type_t STITCHED_EXTERNAL; + + /** + * A transport subnet, sent via the RD's UU-fwd interface + */ + const static type_t TRANSPORT; + + /** + * A transport subnet, sent via the RD's UU-fwd interface + */ + const static type_t L3_OUT; + + private: + type_t(int v, const std::string s); + }; /** - * Construct an internal GBP subnet - */ - gbp_subnet(const route_domain& rd, const route::prefix_t& prefix); + * Construct an internal GBP subnet + */ + gbp_subnet(const gbp_route_domain& rd, + const route::prefix_t& prefix, + const type_t& type); /** - * Construct an external GBP subnet + * Construct an stitched external GBP subnet */ - gbp_subnet(const route_domain& rd, + gbp_subnet(const gbp_route_domain& rd, const route::prefix_t& prefix, const gbp_recirc& recirc, const gbp_endpoint_group& epg); + /** + * Construct an l3-out GBP subnet + */ + gbp_subnet(const gbp_route_domain& rd, + const route::prefix_t& prefix, + const gbp_endpoint_group& epg); + /** * Copy Construct */ @@ -92,23 +130,6 @@ public: std::string to_string() const; private: - struct type_t : public enum_base - { - /** - * Internal subnet is reachable through the source EPG's - * uplink interface. - */ - const static type_t INTERNAL; - - /** - * External subnet requires NAT translation before egress. - */ - const static type_t EXTERNAL; - - private: - type_t(int v, const std::string s); - }; - /** * Class definition for listeners to OM events */ @@ -177,7 +198,7 @@ private: /** * the route domain the prefix is in */ - const std::shared_ptr m_rd; + const std::shared_ptr m_rd; /** * prefix to match @@ -205,6 +226,8 @@ private: static singular_db m_db; }; +std::ostream& operator<<(std::ostream& os, const gbp_subnet::key_t& key); + }; // namespace /*