NAT44: asymmetrical static mapping rule (VPP-1135)
[vpp.git] / test / vpp_papi_provider.py
index acd05a7..13dccc9 100644 (file)
@@ -1235,6 +1235,7 @@ class VppPapiProvider(object):
             vrf_id=0,
             protocol=0,
             twice_nat=0,
+            out2in_only=0,
             is_add=1):
         """Add/delete NAT44 static mapping
 
@@ -1247,6 +1248,7 @@ class VppPapiProvider(object):
         :param vrf_id: VRF ID
         :param protocol: IP protocol (Default value = 0)
         :param twice_nat: 1 if translate external host address and port
+        :param out2in_only: if 1 rule is matching only out2in direction
         :param is_add: 1 if add, 0 if delete (Default value = 1)
         """
         return self.api(
@@ -1260,7 +1262,8 @@ class VppPapiProvider(object):
              'external_sw_if_index': external_sw_if_index,
              'vrf_id': vrf_id,
              'protocol': protocol,
-             'twice_nat': twice_nat})
+             'twice_nat': twice_nat,
+             'out2in_only': out2in_only})
 
     def nat44_add_del_identity_mapping(
             self,
@@ -1420,6 +1423,7 @@ class VppPapiProvider(object):
             protocol,
             vrf_id=0,
             twice_nat=0,
+            out2in_only=0,
             local_num=0,
             locals=[],
             is_add=1):
@@ -1436,6 +1440,7 @@ class VppPapiProvider(object):
              'protocol': protocol,
              'vrf_id': vrf_id,
              'twice_nat': twice_nat,
+             'out2in_only': out2in_only,
              'local_num': local_num,
              'locals': locals})
 
@@ -1818,6 +1823,17 @@ class VppPapiProvider(object):
             {'ip4_addr': ip4,
              'ip6_addr': ip6})
 
+    def dslite_set_b4_addr(self, ip6, ip4):
+        """Set DS-Lite B4 IPv6 address
+
+        :param ip4: IPv4 address
+        :param ip6: IPv6 address
+        """
+        return self.api(
+            self.papi.dslite_set_b4_addr,
+            {'ip4_addr': ip4,
+             'ip6_addr': ip6})
+
     def dslite_add_del_pool_addr_range(
             self,
             start_addr,