diff options
Diffstat (limited to 'src/vpp-api/vom/prefix.hpp')
-rw-r--r-- | src/vpp-api/vom/prefix.hpp | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/src/vpp-api/vom/prefix.hpp b/src/vpp-api/vom/prefix.hpp index 25b188ff86c..3950f6fd036 100644 --- a/src/vpp-api/vom/prefix.hpp +++ b/src/vpp-api/vom/prefix.hpp @@ -26,6 +26,27 @@ namespace VOM { */ /** + * A next-hop protocol describes the protocol of a peer to which packets + * are sent after matching a route. + */ +class nh_proto_t : public enum_base<nh_proto_t> +{ +public: + const static nh_proto_t IPV4; + const static nh_proto_t IPV6; + const static nh_proto_t MPLS; + const static nh_proto_t ETHERNET; + + static const nh_proto_t& from_address(const boost::asio::ip::address& addr); + +private: + /** + * Private constructor taking the value and the string name + */ + nh_proto_t(int v, const std::string& s); +}; + +/** * An L3 protocol can be used to construct a prefix that is used * to match packets are part of a route. */ @@ -41,6 +62,8 @@ public: static const l3_proto_t& from_address(const boost::asio::ip::address& addr); + const nh_proto_t& to_nh_proto() const; + private: /** * Private constructor taking the value and the string name @@ -53,27 +76,6 @@ private: */ std::ostream& operator<<(std::ostream& os, const l3_proto_t& l3p); -/** - * A next-hop protocol describes the protocol of a peer to which packets - * are sent after matching a route. - */ -class nh_proto_t : public enum_base<nh_proto_t> -{ -public: - const static nh_proto_t IPV4; - const static nh_proto_t IPV6; - const static nh_proto_t MPLS; - const static nh_proto_t ETHERNET; - - static const nh_proto_t& from_address(const boost::asio::ip::address& addr); - -private: - /** - * Private constructor taking the value and the string name - */ - nh_proto_t(int v, const std::string& s); -}; - namespace route { /** * type def the table-id |