SPAN:add l2 mirror
[vpp.git] / test / vpp_papi_provider.py
index 51c359e..204d9e3 100644 (file)
@@ -847,17 +847,20 @@ class VppPapiProvider(object):
         )
 
     def sw_interface_span_enable_disable(
-            self, sw_if_index_from, sw_if_index_to, state=1):
+            self, sw_if_index_from, sw_if_index_to, state=1, is_l2=0):
         """
 
         :param sw_if_index_from:
         :param sw_if_index_to:
         :param state:
+        :param is_l2:
         """
         return self.api(self.papi.sw_interface_span_enable_disable,
                         {'sw_if_index_from': sw_if_index_from,
                          'sw_if_index_to': sw_if_index_to,
-                         'state': state})
+                         'state': state,
+                         'is_l2': is_l2,
+                         })
 
     def gre_tunnel_add_del(self,
                            src_address,
@@ -1055,6 +1058,23 @@ class VppPapiProvider(object):
              'is_inside': is_inside,
              'sw_if_index': sw_if_index})
 
+    def snat_interface_add_del_output_feature(
+            self,
+            sw_if_index,
+            is_inside=1,
+            is_add=1):
+        """Enable/disable S-NAT output feature on the interface
+
+        :param sw_if_index: Software index of the interface
+        :param is_inside: 1 if inside, 0 if outside (Default value = 1)
+        :param is_add: 1 if add, 0 if delete (Default value = 1)
+        """
+        return self.api(
+            self.papi.snat_interface_add_del_output_feature,
+            {'is_add': is_add,
+             'is_inside': is_inside,
+             'sw_if_index': sw_if_index})
+
     def snat_add_static_mapping(
             self,
             local_ip,
@@ -1128,6 +1148,12 @@ class VppPapiProvider(object):
         """
         return self.api(self.papi.snat_interface_dump, {})
 
+    def snat_interface_output_feature_dump(self):
+        """Dump interfaces with S-NAT output feature
+        :return: Dictionary of interfaces with S-NAT output feature
+        """
+        return self.api(self.papi.snat_interface_output_feature_dump, {})
+
     def snat_static_mapping_dump(self):
         """Dump S-NAT static mappings
         :return: Dictionary of S-NAT static mappings
@@ -1755,6 +1781,23 @@ class VppPapiProvider(object):
                 'oui': oui,
             })
 
+    def dhcp_client(self,
+                    sw_if_index,
+                    hostname,
+                    client_id='',
+                    is_add=1,
+                    want_dhcp_events=0):
+        return self.api(
+            self.papi.dhcp_client_config,
+            {
+                'sw_if_index': sw_if_index,
+                'hostname': hostname,
+                'client_id': client_id,
+                'is_add': is_add,
+                'want_dhcp_event': want_dhcp_events,
+                'pid': os.getpid(),
+            })
+
     def ip_mroute_add_del(self,
                           src_address,
                           grp_address,