X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Fprefix.hpp;h=fada1d3e2749c080f4713f0dd693991bd299ef81;hb=038e1dfbd;hp=1b6a06874d3aac94f4f6d2c60db25dedb9ff2ec0;hpb=7c03ed47d5acfa39820f9553999caa01cf47dba4;p=vpp.git diff --git a/extras/vom/vom/prefix.hpp b/extras/vom/vom/prefix.hpp index 1b6a06874d3..fada1d3e274 100644 --- a/extras/vom/vom/prefix.hpp +++ b/extras/vom/vom/prefix.hpp @@ -56,8 +56,8 @@ public: const static l3_proto_t IPV6; const static l3_proto_t MPLS; - bool is_ipv4(); - bool is_ipv6(); + bool is_ipv4() const; + bool is_ipv6() const; static const l3_proto_t& from_address(const boost::asio::ip::address& addr); @@ -75,6 +75,45 @@ private: */ std::ostream& operator<<(std::ostream& os, const l3_proto_t& l3p); +/** + * IP DSCP values + */ +class ip_dscp_t : public enum_base +{ +public: + /* unfortunately some of the CSX names are defined in terminos.h + * as macros, hence the longer names */ + const static ip_dscp_t DSCP_CS0; + const static ip_dscp_t DSCP_CS1; + const static ip_dscp_t DSCP_CS2; + const static ip_dscp_t DSCP_CS3; + const static ip_dscp_t DSCP_CS4; + const static ip_dscp_t DSCP_CS5; + const static ip_dscp_t DSCP_CS6; + const static ip_dscp_t DSCP_CS7; + const static ip_dscp_t DSCP_AF11; + const static ip_dscp_t DSCP_AF12; + const static ip_dscp_t DSCP_AF13; + const static ip_dscp_t DSCP_AF21; + const static ip_dscp_t DSCP_AF22; + const static ip_dscp_t DSCP_AF23; + const static ip_dscp_t DSCP_AF31; + const static ip_dscp_t DSCP_AF32; + const static ip_dscp_t DSCP_AF33; + const static ip_dscp_t DSCP_AF41; + const static ip_dscp_t DSCP_AF42; + const static ip_dscp_t DSCP_AF43; + const static ip_dscp_t DSCP_EF; + + /** + * Constructor allows the creation of any DSCP value + */ + ip_dscp_t(int v); + +private: + ip_dscp_t(int v, const std::string& s); +}; + namespace route { /** * type def the table-id @@ -233,8 +272,8 @@ public: mprefix_t(const boost::asio::ip::address& gaddr, uint8_t len); /** -*Constructor for (S,G) -*/ + *Constructor for (S,G) + */ mprefix_t(const boost::asio::ip::address& saddr, const boost::asio::ip::address& gaddr, uint16_t len); @@ -300,11 +339,6 @@ public: */ l3_proto_t l3_proto() const; - void to_vpp(uint8_t* is_ip6, - uint8_t* saddr, - uint8_t* gaddr, - uint16_t* len) const; - private: /** * The address