18 #ifndef __included_ed_inlines_h__ 19 #define __included_ed_inlines_h__ 32 s->lru_index = lru_list_elt - tsm->
lru_pool;
41 case IP_PROTOCOL_ICMP:
50 s->last_lru_update = now;
56 u32 thread_index,
int lru_delete
77 snat_session_t *s = NULL;
79 f64 sess_timeout_time;
83 if (~0 != oldest_index)
90 if (now >= sess_timeout_time
91 || (s->tcp_closed_timestamp && now >= s->tcp_closed_timestamp))
111 if ((rc = nat_lru_free_one_with_head (sm, thread_index, now, \ 112 tsm->p##_lru_head_index))) \ 138 s->ha_last_refreshed = now;
static u32 nat44_session_get_timeout(snat_main_t *sm, snat_session_t *s)
static_always_inline int nat_lru_free_one_with_head(snat_main_t *sm, int thread_index, f64 now, u32 head_index)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
void nat_free_session_data(snat_main_t *sm, snat_session_t *s, u32 thread_index, u8 is_ha)
Free NAT44 session data (lookup keys, external address port)
static void nat_ed_session_delete(snat_main_t *sm, snat_session_t *ses, u32 thread_index, int lru_delete)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define static_always_inline
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void clib_dlist_addtail(dlist_elt_t *pool, u32 head_index, u32 new_index)
#define pool_put(P, E)
Free an object E in pool P.
static void vlib_set_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 value)
Set a simple counter.
static_always_inline int nat_ed_lru_insert(snat_main_per_thread_data_t *tsm, snat_session_t *s, f64 now, u8 proto)
static_always_inline snat_session_t * nat_ed_session_alloc(snat_main_t *sm, u32 thread_index, f64 now, u8 proto)
static void clib_dlist_addhead(dlist_elt_t *pool, u32 head_index, u32 new_index)
#define pool_put_index(p, i)
Free pool element with given index.
static void clib_dlist_remove(dlist_elt_t *pool, u32 index)
u32 unk_proto_lru_head_index
u32 tcp_trans_lru_head_index
snat_main_per_thread_data_t * per_thread_data
static_always_inline int nat_lru_free_one(snat_main_t *sm, int thread_index, f64 now)
vlib_simple_counter_main_t total_sessions
snat_session_t * sessions
static u32 clib_dlist_remove_head(dlist_elt_t *pool, u32 head_index)
static uword pool_elts(void *v)
Number of active elements in a pool.