aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_provider.py
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-11-28 04:29:41 -0800
committerOle Trøan <otroan@employees.org>2017-11-30 12:09:11 +0000
commitab7a805fbb99661b2c125268aa9d7b96c435c1d1 (patch)
tree3ef2b821274642bf959682761a77a9a2faddac17 /test/vpp_papi_provider.py
parent8389fb9112bcf96def69539fa1de13a7a08923f5 (diff)
NAT44: identity NAT (VPP-1073)
Identity mapping translate an IP address to itself. Change-Id: Icc0ca5102d32547a4b0c75720b5f5bf41ed69c71 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r--test/vpp_papi_provider.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index 3dd348286de..f8bca821631 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -1247,6 +1247,35 @@ class VppPapiProvider(object):
'vrf_id': vrf_id,
'protocol': protocol})
+ def nat44_add_del_identity_mapping(
+ self,
+ ip='0',
+ sw_if_index=0xFFFFFFFF,
+ port=0,
+ addr_only=1,
+ vrf_id=0,
+ protocol=0,
+ is_add=1):
+ """Add/delete NAT44 identity mapping
+
+ :param ip: IP address (Default value = 0)
+ :param sw_if_index: Interface instead of IP address
+ :param port: Port number (Default value = 0)
+ :param addr_only: 1 if address only mapping, 0 if address and port
+ :param vrf_id: VRF ID
+ :param protocol: IP protocol (Default value = 0)
+ :param is_add: 1 if add, 0 if delete (Default value = 1)
+ """
+ return self.api(
+ self.papi.nat44_add_del_identity_mapping,
+ {'is_add': is_add,
+ 'addr_only': addr_only,
+ 'ip_address': ip,
+ 'port': port,
+ 'sw_if_index': sw_if_index,
+ 'vrf_id': vrf_id,
+ 'protocol': protocol})
+
def nat44_add_del_address_range(
self,
first_ip_address,
@@ -1291,6 +1320,12 @@ class VppPapiProvider(object):
"""
return self.api(self.papi.nat44_static_mapping_dump, {})
+ def nat44_identity_mapping_dump(self):
+ """Dump NAT44 identity mappings
+ :return: Dictionary of NAT44 identity mappings
+ """
+ return self.api(self.papi.nat44_identity_mapping_dump, {})
+
def nat_show_config(self):
"""Show NAT plugin config
:return: NAT plugin config parameters