DVR: run L3 output features
[vpp.git] / src / vpp-api / vom / prefix.hpp
index 25b188f..3950f6f 100644 (file)
@@ -25,6 +25,27 @@ namespace VOM {
  * Types belonging to Routing
  */
 
+/**
+ * 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