NAT64: multi-thread support (VPP-891)
[vpp.git] / src / plugins / nat / nat.h
index 5bd0a11..e82c230 100644 (file)
@@ -269,6 +269,14 @@ 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,
+                                                    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 +312,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;
@@ -342,9 +354,6 @@ typedef struct snat_main_s {
   u32 inside_vrf_id;
   u32 inside_fib_index;
 
-  /* tenant VRF aware address pool activation flag */
-  u8 vrf_mode;
-
   /* values of various timeouts */
   u32 udp_timeout;
   u32 tcp_established_timeout;
@@ -386,7 +395,6 @@ int snat_alloc_outside_address_and_port (snat_address_t * addresses,
                                          u32 thread_index,
                                          snat_session_key_t * k,
                                          u32 * address_indexp,
-                                         u8 vrf_mode,
                                          u16 port_per_thread,
                                          u32 snat_thread_index);