Fix IP feature ordering.
[vpp.git] / test / vpp_ip_route.py
index 7a62b23..faf5f80 100644 (file)
@@ -12,6 +12,23 @@ MPLS_IETF_MAX_LABEL = 0xfffff
 MPLS_LABEL_INVALID = MPLS_IETF_MAX_LABEL + 1
 
 
+class MRouteItfFlags:
+    MFIB_ITF_FLAG_NONE = 0
+    MFIB_ITF_FLAG_NEGATE_SIGNAL = 1
+    MFIB_ITF_FLAG_ACCEPT = 2
+    MFIB_ITF_FLAG_FORWARD = 4
+    MFIB_ITF_FLAG_SIGNAL_PRESENT = 8
+    MFIB_ITF_FLAG_INTERNAL_COPY = 16
+
+
+class MRouteEntryFlags:
+    MFIB_ENTRY_FLAG_NONE = 0
+    MFIB_ENTRY_FLAG_SIGNAL = 1
+    MFIB_ENTRY_FLAG_DROP = 2
+    MFIB_ENTRY_FLAG_CONNECTED = 4
+    MFIB_ENTRY_FLAG_INHERIT_ACCEPT = 8
+
+
 def find_route(test, ip_addr, len, table_id=0, inet=AF_INET):
     if inet == AF_INET:
         s = 4
@@ -79,6 +96,13 @@ class VppIpRoute(VppObject):
         else:
             self.dest_addr = inet_pton(AF_INET, dest_addr)
 
+    def modify(self, paths, is_local=0,
+               is_unreach=0, is_prohibit=0):
+        self.paths = paths
+        self.is_local = is_local
+        self.is_unreach = is_unreach
+        self.is_prohibit = is_prohibit
+
     def add_vpp_config(self):
         if self.is_local or self.is_unreach or self.is_prohibit:
             self._test.vapi.ip_add_del_route(
@@ -126,7 +150,8 @@ class VppIpRoute(VppObject):
                                                  path.nh_addr,
                                                  path.nh_itf,
                                                  table_id=self.table_id,
-                                                 is_add=0)
+                                                 is_add=0,
+                                                 is_ipv6=self.is_ip6)
 
     def query_vpp_config(self):
         return find_route(self._test,