|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef __included_nat44_ei_inlines_h__
17 #define __included_nat44_ei_inlines_h__
27 ASSERT (fib_index <= (1 << 14) - 1);
29 return (
u64)
addr.as_u32 << 32 | (
u64)
port << 16 | fib_index << 3 |
47 *fib_index =
key >> 3 & ((1 << 13) - 1);
75 return init_nat_k (kv, s->in2out.addr, s->in2out.port, s->in2out.fib_index,
83 init_nat_k (kv, s->in2out.addr, s->in2out.port, s->in2out.fib_index,
91 return init_nat_k (kv, s->out2in.addr, s->out2in.port, s->out2in.fib_index,
99 init_nat_k (kv, s->out2in.addr, s->out2in.port, s->out2in.fib_index,
107 return value->value >> 32;
118 u32 sw_if_index0,
u32 ip4_addr)
126 im, sw_if_index0, 0 );
127 rt->cached_sw_if_index = sw_if_index0;
129 rt->cached_ip4_address = first_int_addr->as_u32;
131 rt->cached_ip4_address = 0;
146 if (s->last_heard > s->last_lru_update + 1)
151 s->per_user_list_head_index, s->per_user_index);
152 s->last_lru_update = s->last_heard;
163 u->nstaticsessions++;
178 if (u->nstaticsessions == 0 && u->nsessions == 0)
206 s->total_bytes += bytes;
207 nat_ha_sref (&s->out2in.addr, s->out2in.port, &s->ext_host_addr,
208 s->ext_host_port, s->nat_proto, s->out2in.fib_index,
210 &s->ha_last_refreshed,
now);
nat44_ei_main_per_thread_data_t * tnm
static u32 nat_value_get_thread_index(clib_bihash_kv_8_8_t *value)
vnet_interface_main_t * im
void nat_ha_sref(ip4_address_t *out_addr, u16 out_port, ip4_address_t *eh_addr, u16 eh_port, u8 proto, u32 fib_index, u32 total_pkts, u64 total_bytes, u32 thread_index, f64 *last_refreshed, f64 now)
Create session refresh HA event.
vlib_main_t vlib_node_runtime_t * node
#define pool_put(P, E)
Free an object E in pool P.
static void init_nat_i2o_kv(clib_bihash_kv_8_8_t *kv, nat44_ei_session_t *s, u32 thread_index, u32 session_index)
u32 max_translations_per_thread
#define pool_put_index(p, i)
Free pool element with given index.
nat44_ei_session_t * sessions
static void nat44_ei_session_update_lru(nat44_ei_main_t *nm, nat44_ei_session_t *s, u32 thread_index)
Per-user LRU list maintenance.
static u32 nat_value_get_session_index(clib_bihash_kv_8_8_t *value)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void init_nat_kv(clib_bihash_kv_8_8_t *kv, ip4_address_t addr, u16 port, u32 fib_index, nat_protocol_t proto, u32 thread_index, u32 session_index)
#define static_always_inline
u32 max_translations_per_user
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
static void clib_dlist_remove(dlist_elt_t *pool, u32 index)
nat44_ei_main_per_thread_data_t * per_thread_data
static u8 nat44_ei_is_interface_addr(ip4_main_t *im, vlib_node_runtime_t *node, u32 sw_if_index0, u32 ip4_addr)
static void init_nat_o2i_kv(clib_bihash_kv_8_8_t *kv, nat44_ei_session_t *s, u32 thread_index, u32 session_index)
clib_bihash_8_8_t user_hash
static void vlib_set_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 value)
Set a simple counter.
static void nat44_ei_user_session_increment(nat44_ei_main_t *nm, nat44_ei_user_t *u, u8 is_static)
static u64 calc_nat_key(ip4_address_t addr, u16 port, u32 fib_index, u8 proto)
static void nat44_ei_delete_user_with_no_session(nat44_ei_main_t *nm, nat44_ei_user_t *u, u32 thread_index)
8 octet key, 8 octet key value pair
static uword pool_elts(void *v)
Number of active elements in a pool.
static_always_inline u8 nat44_ei_maximum_sessions_exceeded(nat44_ei_main_t *nm, u32 thread_index)
static void init_nat_i2o_k(clib_bihash_kv_8_8_t *kv, nat44_ei_session_t *s)
vnet_interface_output_runtime_t * rt
static void clib_dlist_addtail(dlist_elt_t *pool, u32 head_index, u32 new_index)
static void split_nat_key(u64 key, ip4_address_t *addr, u16 *port, u32 *fib_index, nat_protocol_t *proto)
vlib_simple_counter_main_t total_users
ip4_address_t * ip4_interface_first_address(ip4_main_t *im, u32 sw_if_index, ip_interface_address_t **result_ia)
static void init_nat_o2i_k(clib_bihash_kv_8_8_t *kv, nat44_ei_session_t *s)
static void init_nat_k(clib_bihash_kv_8_8_t *kv, ip4_address_t addr, u16 port, u32 fib_index, nat_protocol_t proto)
static void nat44_ei_session_update_counters(nat44_ei_session_t *s, f64 now, uword bytes, u32 thread_index)