FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
nat44_ed_inlines.h File Reference
+ Include dependency graph for nat44_ed_inlines.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static u64 calc_nat_key (ip4_address_t addr, u16 port, u32 fib_index, u8 proto)
 The NAT inline functions. More...
 
static void split_nat_key (u64 key, ip4_address_t *addr, u16 *port, u32 *fib_index, nat_protocol_t *proto)
 
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 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)
 
static void init_nat_i2o_k (clib_bihash_kv_8_8_t *kv, snat_session_t *s)
 
static void init_nat_i2o_kv (clib_bihash_kv_8_8_t *kv, snat_session_t *s, u32 thread_index, u32 session_index)
 
static void init_nat_o2i_k (clib_bihash_kv_8_8_t *kv, snat_session_t *s)
 
static void init_nat_o2i_kv (clib_bihash_kv_8_8_t *kv, snat_session_t *s, u32 thread_index, u32 session_index)
 
static u32 nat_value_get_thread_index (clib_bihash_kv_8_8_t *value)
 
static u32 nat_value_get_session_index (clib_bihash_kv_8_8_t *value)
 
static void init_ed_k (clib_bihash_kv_16_8_t *kv, ip4_address_t l_addr, u16 l_port, ip4_address_t r_addr, u16 r_port, u32 fib_index, u8 proto)
 
static void init_ed_kv (clib_bihash_kv_16_8_t *kv, ip4_address_t l_addr, u16 l_port, ip4_address_t r_addr, u16 r_port, u32 fib_index, u8 proto, u32 thread_index, u32 session_index)
 
static u32 ed_value_get_thread_index (clib_bihash_kv_16_8_t *value)
 
static u32 ed_value_get_session_index (clib_bihash_kv_16_8_t *value)
 
static void split_ed_kv (clib_bihash_kv_16_8_t *kv, ip4_address_t *l_addr, ip4_address_t *r_addr, u8 *proto, u32 *fib_index, u16 *l_port, u16 *r_port)
 
static_always_inline int nat_get_icmp_session_lookup_values (vlib_buffer_t *b, ip4_header_t *ip0, ip4_address_t *lookup_saddr, u16 *lookup_sport, ip4_address_t *lookup_daddr, u16 *lookup_dport, u8 *lookup_protocol)
 
static u32 nat44_session_get_timeout (snat_main_t *sm, snat_session_t *s)
 
static_always_inline u8 nat44_ed_maximum_sessions_exceeded (snat_main_t *sm, u32 fib_index, u32 thread_index)
 
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 void nat_6t_flow_to_ed_k (clib_bihash_kv_16_8_t *kv, nat_6t_flow_t *f)
 
static_always_inline void nat_6t_flow_to_ed_kv (clib_bihash_kv_16_8_t *kv, nat_6t_flow_t *f, u32 thread_idx, u32 session_idx)
 
static_always_inline int nat_ed_ses_i2o_flow_hash_add_del (snat_main_t *sm, u32 thread_idx, snat_session_t *s, int is_add)
 
static_always_inline int nat_ed_ses_o2i_flow_hash_add_del (snat_main_t *sm, u32 thread_idx, snat_session_t *s, int is_add)
 
static void nat_ed_session_delete (snat_main_t *sm, snat_session_t *ses, u32 thread_index, int lru_delete)
 
static_always_inline int nat_lru_free_one_with_head (snat_main_t *sm, int thread_index, f64 now, u32 head_index)
 
static_always_inline int nat_lru_free_one (snat_main_t *sm, int thread_index, f64 now)
 
static_always_inline snat_session_t * nat_ed_session_alloc (snat_main_t *sm, u32 thread_index, f64 now, u8 proto)
 
static_always_inline void per_vrf_sessions_cleanup (u32 thread_index)
 
static_always_inline void per_vrf_sessions_register_session (snat_session_t *s, u32 thread_index)
 
static_always_inline void per_vrf_sessions_unregister_session (snat_session_t *s, u32 thread_index)
 
static_always_inline u8 per_vrf_sessions_is_expired (snat_session_t *s, u32 thread_index)
 
static_always_inline void nat_6t_flow_init (nat_6t_flow_t *f, u32 thread_idx, ip4_address_t saddr, u16 sport, ip4_address_t daddr, u16 dport, u32 fib_index, u8 proto, u32 session_idx)
 
static_always_inline void nat_6t_i2o_flow_init (snat_main_t *sm, u32 thread_idx, snat_session_t *s, ip4_address_t saddr, u16 sport, ip4_address_t daddr, u16 dport, u32 fib_index, u8 proto)
 
static_always_inline void nat_6t_o2i_flow_init (snat_main_t *sm, u32 thread_idx, snat_session_t *s, ip4_address_t saddr, u16 sport, ip4_address_t daddr, u16 dport, u32 fib_index, u8 proto)
 
static_always_inline int nat_6t_t_eq (nat_6t_t *t1, nat_6t_t *t2)
 
static uword nat_pre_node_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u32 def_next)
 
static_always_inline u16 snat_random_port (u16 min, u16 max)
 
static u8 is_interface_addr (snat_main_t *sm, vlib_node_runtime_t *node, u32 sw_if_index0, u32 ip4_addr)
 
static void nat44_set_tcp_session_state_i2o (snat_main_t *sm, f64 now, snat_session_t *ses, vlib_buffer_t *b, u32 thread_index)
 
static void nat44_set_tcp_session_state_o2i (snat_main_t *sm, f64 now, snat_session_t *ses, u8 tcp_flags, u32 tcp_ack_number, u32 tcp_seq_number, u32 thread_index)
 
static void nat44_session_update_counters (snat_session_t *s, f64 now, uword bytes, u32 thread_index)
 
static void nat44_session_update_lru (snat_main_t *sm, snat_session_t *s, u32 thread_index)
 Per-user LRU list maintenance. More...
 

Function Documentation

◆ calc_nat_key()

static u64 calc_nat_key ( ip4_address_t  addr,
u16  port,
u32  fib_index,
u8  proto 
)
inlinestatic

The NAT inline functions.

Definition at line 30 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ ed_value_get_session_index()

static u32 ed_value_get_session_index ( clib_bihash_kv_16_8_t value)
inlinestatic

Definition at line 146 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ ed_value_get_thread_index()

static u32 ed_value_get_thread_index ( clib_bihash_kv_16_8_t value)
inlinestatic

Definition at line 140 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ init_ed_k()

static void init_ed_k ( clib_bihash_kv_16_8_t kv,
ip4_address_t  l_addr,
u16  l_port,
ip4_address_t  r_addr,
u16  r_port,
u32  fib_index,
u8  proto 
)
inlinestatic

Definition at line 122 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ init_ed_kv()

static void init_ed_kv ( clib_bihash_kv_16_8_t kv,
ip4_address_t  l_addr,
u16  l_port,
ip4_address_t  r_addr,
u16  r_port,
u32  fib_index,
u8  proto,
u32  thread_index,
u32  session_index 
)
inlinestatic

Definition at line 131 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_nat_i2o_k()

static void init_nat_i2o_k ( clib_bihash_kv_8_8_t kv,
snat_session_t *  s 
)
inlinestatic

Definition at line 78 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:

◆ init_nat_i2o_kv()

static void init_nat_i2o_kv ( clib_bihash_kv_8_8_t kv,
snat_session_t *  s,
u32  thread_index,
u32  session_index 
)
inlinestatic

Definition at line 85 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:

◆ init_nat_k()

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 
)
inlinestatic

Definition at line 61 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_nat_kv()

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 
)
inlinestatic

Definition at line 69 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:

◆ init_nat_o2i_k()

static void init_nat_o2i_k ( clib_bihash_kv_8_8_t kv,
snat_session_t *  s 
)
inlinestatic

Definition at line 94 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:

◆ init_nat_o2i_kv()

static void init_nat_o2i_kv ( clib_bihash_kv_8_8_t kv,
snat_session_t *  s,
u32  thread_index,
u32  session_index 
)
inlinestatic

Definition at line 101 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:

◆ is_interface_addr()

static u8 is_interface_addr ( snat_main_t sm,
vlib_node_runtime_t node,
u32  sw_if_index0,
u32  ip4_addr 
)
inlinestatic

Definition at line 723 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat44_ed_maximum_sessions_exceeded()

static_always_inline u8 nat44_ed_maximum_sessions_exceeded ( snat_main_t sm,
u32  fib_index,
u32  thread_index 
)

Definition at line 262 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat44_session_get_timeout()

static u32 nat44_session_get_timeout ( snat_main_t sm,
snat_session_t *  s 
)
inlinestatic

Definition at line 239 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ nat44_session_update_counters()

static void nat44_session_update_counters ( snat_session_t *  s,
f64  now,
uword  bytes,
u32  thread_index 
)
inlinestatic

Definition at line 848 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ nat44_session_update_lru()

static void nat44_session_update_lru ( snat_main_t sm,
snat_session_t *  s,
u32  thread_index 
)
inlinestatic

Per-user LRU list maintenance.

Definition at line 858 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat44_set_tcp_session_state_i2o()

static void nat44_set_tcp_session_state_i2o ( snat_main_t sm,
f64  now,
snat_session_t *  ses,
vlib_buffer_t b,
u32  thread_index 
)
inlinestatic

Definition at line 757 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat44_set_tcp_session_state_o2i()

static void nat44_set_tcp_session_state_o2i ( snat_main_t sm,
f64  now,
snat_session_t *  ses,
u8  tcp_flags,
u32  tcp_ack_number,
u32  tcp_seq_number,
u32  thread_index 
)
inlinestatic

Definition at line 805 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_6t_flow_init()

static_always_inline void nat_6t_flow_init ( nat_6t_flow_t f,
u32  thread_idx,
ip4_address_t  saddr,
u16  sport,
ip4_address_t  daddr,
u16  dport,
u32  fib_index,
u8  proto,
u32  session_idx 
)

Definition at line 565 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_6t_flow_to_ed_k()

static_always_inline void nat_6t_flow_to_ed_k ( clib_bihash_kv_16_8_t kv,
nat_6t_flow_t f 
)

Definition at line 301 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_6t_flow_to_ed_kv()

static_always_inline void nat_6t_flow_to_ed_kv ( clib_bihash_kv_16_8_t kv,
nat_6t_flow_t f,
u32  thread_idx,
u32  session_idx 
)

Definition at line 308 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_6t_i2o_flow_init()

static_always_inline void nat_6t_i2o_flow_init ( snat_main_t sm,
u32  thread_idx,
snat_session_t *  s,
ip4_address_t  saddr,
u16  sport,
ip4_address_t  daddr,
u16  dport,
u32  fib_index,
u8  proto 
)

Definition at line 579 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_6t_o2i_flow_init()

static_always_inline void nat_6t_o2i_flow_init ( snat_main_t sm,
u32  thread_idx,
snat_session_t *  s,
ip4_address_t  saddr,
u16  sport,
ip4_address_t  daddr,
u16  dport,
u32  fib_index,
u8  proto 
)

Definition at line 590 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_6t_t_eq()

static_always_inline int nat_6t_t_eq ( nat_6t_t t1,
nat_6t_t t2 
)

Definition at line 601 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ nat_ed_lru_insert()

static_always_inline int nat_ed_lru_insert ( snat_main_per_thread_data_t tsm,
snat_session_t *  s,
f64  now,
u8  proto 
)

Definition at line 273 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_ed_ses_i2o_flow_hash_add_del()

static_always_inline int nat_ed_ses_i2o_flow_hash_add_del ( snat_main_t sm,
u32  thread_idx,
snat_session_t *  s,
int  is_add 
)

Definition at line 317 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_ed_ses_o2i_flow_hash_add_del()

static_always_inline int nat_ed_ses_o2i_flow_hash_add_del ( snat_main_t sm,
u32  thread_idx,
snat_session_t *  s,
int  is_add 
)

Definition at line 338 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_ed_session_alloc()

static_always_inline snat_session_t* nat_ed_session_alloc ( snat_main_t sm,
u32  thread_index,
f64  now,
u8  proto 
)

Definition at line 432 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_ed_session_delete()

static void nat_ed_session_delete ( snat_main_t sm,
snat_session_t *  ses,
u32  thread_index,
int  lru_delete 
)
inlinestatic

Definition at line 358 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_get_icmp_session_lookup_values()

static_always_inline int nat_get_icmp_session_lookup_values ( vlib_buffer_t b,
ip4_header_t ip0,
ip4_address_t lookup_saddr,
u16 lookup_sport,
ip4_address_t lookup_daddr,
u16 lookup_dport,
u8 lookup_protocol 
)

Definition at line 183 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_lru_free_one()

static_always_inline int nat_lru_free_one ( snat_main_t sm,
int  thread_index,
f64  now 
)

Definition at line 412 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ nat_lru_free_one_with_head()

static_always_inline int nat_lru_free_one_with_head ( snat_main_t sm,
int  thread_index,
f64  now,
u32  head_index 
)

Definition at line 380 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:

◆ nat_pre_node_fn_inline()

static uword nat_pre_node_fn_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
u32  def_next 
)
inlinestatic

Definition at line 607 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_value_get_session_index()

static u32 nat_value_get_session_index ( clib_bihash_kv_8_8_t value)
inlinestatic

Definition at line 116 of file nat44_ed_inlines.h.

◆ nat_value_get_thread_index()

static u32 nat_value_get_thread_index ( clib_bihash_kv_8_8_t value)
inlinestatic

Definition at line 110 of file nat44_ed_inlines.h.

◆ per_vrf_sessions_cleanup()

static_always_inline void per_vrf_sessions_cleanup ( u32  thread_index)

Definition at line 455 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ per_vrf_sessions_is_expired()

static_always_inline u8 per_vrf_sessions_is_expired ( snat_session_t *  s,
u32  thread_index 
)

Definition at line 550 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ per_vrf_sessions_register_session()

static_always_inline void per_vrf_sessions_register_session ( snat_session_t *  s,
u32  thread_index 
)

Definition at line 487 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ per_vrf_sessions_unregister_session()

static_always_inline void per_vrf_sessions_unregister_session ( snat_session_t *  s,
u32  thread_index 
)

Definition at line 530 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ snat_random_port()

static_always_inline u16 snat_random_port ( u16  min,
u16  max 
)

Definition at line 708 of file nat44_ed_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ split_ed_kv()

static void split_ed_kv ( clib_bihash_kv_16_8_t kv,
ip4_address_t l_addr,
ip4_address_t r_addr,
u8 proto,
u32 fib_index,
u16 l_port,
u16 r_port 
)
inlinestatic

Definition at line 152 of file nat44_ed_inlines.h.

+ Here is the caller graph for this function:

◆ split_nat_key()

static void split_nat_key ( u64  key,
ip4_address_t addr,
u16 port,
u32 fib_index,
nat_protocol_t proto 
)
inlinestatic

Definition at line 39 of file nat44_ed_inlines.h.