19 #ifndef included_nat44_inlines_h__ 20 #define included_nat44_inlines_h__ 36 u32 fib_index,
u32 thread_index)
47 snat_session_t * s,
u32 thread_index,
f64 now)
58 s->ext_host_addr.as_u32 = 0;
60 s->ext_host_nat_addr.as_u32 = 0;
61 s->ext_host_nat_port = 0;
62 s->tcp_closed_timestamp = 0;
63 s->ha_last_refreshed = now;
104 while (elt->
value != ~0)
137 if (!clib_bihash_search_8_8 (&tsm->
user_hash, &kv, &value))
151 if (!clib_bihash_search_8_8 (&tsm->
user_hash, &kv, &value))
u32 * max_translations_per_fib
#define snat_is_session_static(s)
Check if SNAT session is created from static mapping.
u32 sessions_per_user_list_head_index
void nat44_db_init(snat_main_per_thread_data_t *tsm)
Initialize NAT44 data.
static_always_inline snat_session_t * nat44_session_reuse_old(snat_main_t *sm, snat_user_t *u, snat_session_t *s, u32 thread_index, f64 now)
static_always_inline void nat44_user_del_sessions(snat_user_t *u, u32 thread_index)
void nat44_db_free(snat_main_per_thread_data_t *tsm)
Free NAT44 data.
clib_bihash_8_8_t user_hash
#define static_always_inline
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void nat44_delete_session(snat_main_t *sm, snat_session_t *ses, u32 thread_index)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static_always_inline int nat44_user_del(ip4_address_t *addr, u32 fib_index)
static void vlib_set_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 value)
Set a simple counter.
8 octet key, 8 octet key value pair
void nat44_free_session_data(snat_main_t *sm, snat_session_t *s, u32 thread_index, u8 is_ha)
Free NAT44 ED session data (lookup keys, external address port)
static_always_inline u8 nat44_maximum_sessions_exceeded(snat_main_t *sm, u32 thread_index)
The NAT44 inline functions.
static_always_inline u8 nat44_ed_maximum_sessions_exceeded(snat_main_t *sm, u32 fib_index, u32 thread_index)
vlib_simple_counter_main_t total_users
static_always_inline void nat44_sessions_clear()
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
snat_main_per_thread_data_t * per_thread_data
#define vec_foreach(var, vec)
Vector iterator.
vlib_simple_counter_main_t total_sessions
snat_session_t * sessions
static uword pool_elts(void *v)
Number of active elements in a pool.