aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.h
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-11-09 01:43:47 -0800
committerOle Trøan <otroan@employees.org>2017-11-09 14:41:22 +0000
commit2769710f9f25f7881aeac75419c2ae817da0bc82 (patch)
tree917e9733ed5548e2fb81bda7da931751b2e2e10c /src/plugins/nat/nat.h
parentc36ee5ffd99e7ed688566293251317771c174d51 (diff)
Port restricted NAT44 (VPP-1048)
For the MAP-E CE limit port choice based on PSID CLI: nat44 addr-port-assignment-alg map-e psid <n> psid-offset <n> psid-len <n> Change-Id: Iecceee61fca372cb5790c16993a82fbdc9930f0f Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat.h')
-rw-r--r--src/plugins/nat/nat.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/nat/nat.h b/src/plugins/nat/nat.h
index 5bd0a119f38..8178d76a4ac 100644
--- a/src/plugins/nat/nat.h
+++ b/src/plugins/nat/nat.h
@@ -269,6 +269,15 @@ typedef u32 snat_icmp_match_function_t (struct snat_main_s *sm,
typedef u32 (snat_get_worker_function_t) (ip4_header_t * ip, u32 rx_fib_index);
+typedef int nat_alloc_out_addr_and_port_function_t (snat_address_t * addresses,
+ u32 fib_index,
+ u32 thread_index,
+ snat_session_key_t * k,
+ u32 * address_indexp,
+ u8 vrf_mode,
+ u16 port_per_thread,
+ u32 snat_thread_index);
+
typedef struct snat_main_s {
/* Endpoint address dependent sessions lookup tables */
clib_bihash_16_8_t out2in_ed;
@@ -304,6 +313,10 @@ typedef struct snat_main_s {
/* Vector of outside addresses */
snat_address_t * addresses;
+ nat_alloc_out_addr_and_port_function_t *alloc_addr_and_port;
+ u8 psid_offset;
+ u8 psid_length;
+ u16 psid;
/* sw_if_indices whose intfc addresses should be auto-added */
u32 * auto_add_sw_if_indices;