nat: move deterministic nat to det44 sub feature
[vpp.git] / src / plugins / nat / nat44 / inlines.h
index a5118ea..459bada 100644 (file)
@@ -26,7 +26,7 @@ static_always_inline u8
 nat44_maximum_sessions_exceeded (snat_main_t * sm, u32 thread_index)
 {
   if (pool_elts (sm->per_thread_data[thread_index].sessions) >=
-      sm->max_translations)
+      sm->max_translations_per_thread)
     return 1;
   return 0;
 }
@@ -59,46 +59,11 @@ nat44_session_reuse_old (snat_main_t * sm, snat_user_t * u,
   s->ext_host_port = 0;
   s->ext_host_nat_addr.as_u32 = 0;
   s->ext_host_nat_port = 0;
-  s->tcp_close_timestamp = 0;
+  s->tcp_closed_timestamp = 0;
   s->ha_last_refreshed = now;
   return s;
 }
 
-static_always_inline void
-nat44_global_lru_insert (snat_main_per_thread_data_t * tsm,
-                        snat_session_t * s, f64 now)
-{
-  dlist_elt_t *lru_list_elt;
-  pool_get (tsm->global_lru_pool, lru_list_elt);
-  s->global_lru_index = lru_list_elt - tsm->global_lru_pool;
-  clib_dlist_addtail (tsm->global_lru_pool, tsm->global_lru_head_index,
-                     s->global_lru_index);
-  lru_list_elt->value = s - tsm->sessions;
-  s->last_lru_update = now;
-}
-
-static_always_inline void
-nat44_sessions_clear ()
-{
-  snat_main_t *sm = &snat_main;
-  snat_main_per_thread_data_t *tsm;
-
-  /* *INDENT-OFF* */
-  vec_foreach (tsm, sm->per_thread_data)
-    {
-      u32 ti;
-
-      nat44_db_free (tsm);
-      nat44_db_init (tsm);
-
-      ti = tsm->snat_thread_index;
-      // clear per thread session counters
-      vlib_set_simple_counter (&sm->total_users, ti, 0, 0);
-      vlib_set_simple_counter (&sm->total_sessions, ti, 0, 0);
-    }
-  /* *INDENT-ON* */
-}
-
 static_always_inline void
 nat44_user_del_sessions (snat_user_t * u, u32 thread_index)
 {
@@ -135,7 +100,7 @@ nat44_user_del (ip4_address_t * addr, u32 fib_index)
   snat_user_key_t user_key;
   clib_bihash_kv_8_8_t kv, value;
 
-  if (sm->deterministic || sm->endpoint_dependent)
+  if (sm->endpoint_dependent)
     return rv;
 
   user_key.addr.as_u32 = addr->as_u32;