aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_provider.py
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-09-04 03:55:45 -0700
committerDamjan Marion <dmarion@me.com>2018-09-04 17:50:51 +0000
commit5d28c7afbc0abd172d0053768b2ebe37b7a6c348 (patch)
treeafdef90641a9fc25c9d24e166488e66d3e9049b7 /test/vpp_papi_provider.py
parentb17cd37bb9c86ea5d8b43efad7ce5b7fc808e528 (diff)
NAT: add support for configurable port range (VPP-1346)
Change-Id: I6882b6daa05db866fe6e78a62b380ec331507f74 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r--test/vpp_papi_provider.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index e0d55c16cee..9a3a9741ed9 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -1797,6 +1797,36 @@ class VppPapiProvider(object):
"""
return self.api(self.papi.nat_get_timeouts, {})
+ def nat_set_addr_and_port_alloc_alg(
+ self,
+ alg=0,
+ psid_offset=0,
+ psid_length=0,
+ psid=0,
+ start_port=0,
+ end_port=0):
+ """Set address and port assignment algorithm
+
+ :param alg: algorithm: 0 - default, 1 - MAP-E, 2 - port range
+ :param psid_offset: number of offset bits (valid only for MAP-E alg)
+ :param psid_length: length of PSID (valid only for MAP-E alg)
+ :param psid: Port Set Identifier value (valid only for MAP-E alg)
+ :param start_port: beginning of the port range
+ :param end_port: end of the port range
+ """
+ return self.api(
+ self.papi.nat_set_addr_and_port_alloc_alg,
+ {'alg': alg,
+ 'psid_offset': psid_offset,
+ 'psid_length': psid_length,
+ 'psid': psid,
+ 'start_port': start_port,
+ 'end_port': end_port})
+
+ def nat_get_addr_and_port_alloc_alg(self):
+ """Get address and port assignment algorithm"""
+ return self.api(self.papi.nat_get_addr_and_port_alloc_alg, {})
+
def nat_det_close_session_out(
self,
out_addr,