For DHCP client configuration control the setting of the broadcast flag in the
[vpp.git] / test / vpp_papi_provider.py
index aa06cfe..db0f8e6 100644 (file)
@@ -603,6 +603,18 @@ class VppPapiProvider(object):
                          'tag1': tag1,
                          'tag2': tag2})
 
+    def sw_interface_set_l2_emulation(
+            self,
+            sw_if_index,
+            enable=1):
+        """L2 Emulation
+        :param sw_if_index - interface the operation is applied to
+
+        """
+        return self.api(self.papi.l2_emulation,
+                        {'sw_if_index': sw_if_index,
+                         'enable': enable})
+
     def sw_interface_set_flags(self, sw_if_index, admin_up_down):
         """
 
@@ -747,7 +759,7 @@ class VppPapiProvider(object):
             is_local=0,
             is_classify=0,
             is_multipath=0,
-            is_l2_bridged=0,
+            is_dvr=0,
             is_udp_encap=0,
             is_source_lookup=0):
         """
@@ -768,7 +780,7 @@ class VppPapiProvider(object):
         :param is_multipath:  (Default value = 0)
         :param is_resolve_host:  (Default value = 0)
         :param is_resolve_attached:  (Default value = 0)
-        :param is_l2_bridged:  (Default value = 0)
+        :param is_dvr:  (Default value = 0)
         :param is_source_lookup:  (Default value = 0)
         :param next_hop_weight:  (Default value = 1)
 
@@ -790,7 +802,7 @@ class VppPapiProvider(object):
              'is_multipath': is_multipath,
              'is_resolve_host': is_resolve_host,
              'is_resolve_attached': is_resolve_attached,
-             'is_l2_bridged': is_l2_bridged,
+             'is_dvr': is_dvr,
              'is_source_lookup': is_source_lookup,
              'is_udp_encap': is_udp_encap,
              'next_hop_weight': next_hop_weight,
@@ -1223,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
 
@@ -1235,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(
@@ -1248,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,
@@ -1408,6 +1423,7 @@ class VppPapiProvider(object):
             protocol,
             vrf_id=0,
             twice_nat=0,
+            out2in_only=0,
             local_num=0,
             locals=[],
             is_add=1):
@@ -1424,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})
 
@@ -1806,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,
@@ -2104,6 +2132,7 @@ class VppPapiProvider(object):
                     hostname,
                     client_id='',
                     is_add=1,
+                    set_broadcast_flag=1,
                     want_dhcp_events=0):
         return self.api(
             self.papi.dhcp_client_config,
@@ -2113,6 +2142,7 @@ class VppPapiProvider(object):
                 'client_id': client_id,
                 'is_add': is_add,
                 'want_dhcp_event': want_dhcp_events,
+                'set_broadcast_flag': set_broadcast_flag,
                 'pid': os.getpid(),
             })
 
@@ -2303,6 +2333,7 @@ class VppPapiProvider(object):
                        psid_offset=0,
                        psid_length=0,
                        is_translation=0,
+                       is_rfc6052=0,
                        mtu=1280):
         return self.api(
             self.papi.map_add_domain,
@@ -2317,6 +2348,7 @@ class VppPapiProvider(object):
                 'psid_offset': psid_offset,
                 'psid_length': psid_length,
                 'is_translation': is_translation,
+                'is_rfc6052': is_rfc6052,
                 'mtu': mtu
             })
 
@@ -2998,3 +3030,18 @@ class VppPapiProvider(object):
              'is_outbound': is_outbound,
              'sa_id': sa_id,
              'is_ip_any': is_ip_any})
+
+    def app_namespace_add(self,
+                          namespace_id,
+                          ip4_fib_id=0,
+                          ip6_fib_id=0,
+                          sw_if_index=0xFFFFFFFF,
+                          secret=0):
+        return self.api(
+            self.papi.app_namespace_add_del,
+            {'secret': secret,
+             'sw_if_index': sw_if_index,
+             'ip4_fib_id': ip4_fib_id,
+             'ip6_fib_id': ip6_fib_id,
+             'namespace_id': namespace_id,
+             'namespace_id_len': len(namespace_id)})