FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
nat_inlines.h File Reference
+ Include dependency graph for nat_inlines.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static uword nat_pre_node_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u32 def_next)
 The NAT inline functions. More...
 
static u32 ip_proto_to_snat_proto (u8 ip_proto)
 
static u8 snat_proto_to_ip_proto (snat_protocol_t snat_proto)
 
static_always_inline u8 icmp_type_is_error_message (u8 icmp_type)
 
static u8 is_interface_addr (snat_main_t *sm, vlib_node_runtime_t *node, u32 sw_if_index0, u32 ip4_addr)
 
static u8 maximum_sessions_exceeded (snat_main_t *sm, u32 thread_index)
 
static void nat_send_all_to_node (vlib_main_t *vm, u32 *bi_vector, vlib_node_runtime_t *node, vlib_error_t *error, u32 next)
 
static void user_session_increment (snat_main_t *sm, snat_user_t *u, u8 is_static)
 
static void nat44_delete_user_with_no_session (snat_main_t *sm, snat_user_t *u, u32 thread_index)
 
static void nat44_delete_session (snat_main_t *sm, snat_session_t *ses, u32 thread_index)
 
static int nat44_set_tcp_session_state_i2o (snat_main_t *sm, snat_session_t *ses, vlib_buffer_t *b, u32 thread_index)
 Set TCP session state. More...
 
static int nat44_set_tcp_session_state_o2i (snat_main_t *sm, snat_session_t *ses, u8 tcp_flags, u32 tcp_ack_number, u32 tcp_seq_number, u32 thread_index)
 
static u32 nat44_session_get_timeout (snat_main_t *sm, snat_session_t *s)
 
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...
 
static void make_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 void make_sm_kv (clib_bihash_kv_8_8_t *kv, ip4_address_t *addr, u8 proto, u32 fib_index, u16 port)
 
static_always_inline int get_icmp_i2o_ed_key (vlib_buffer_t *b, ip4_header_t *ip0, nat_ed_ses_key_t *p_key0)
 
static_always_inline int get_icmp_o2i_ed_key (vlib_buffer_t *b, ip4_header_t *ip0, nat_ed_ses_key_t *p_key0)
 
static void mss_clamping (snat_main_t *sm, tcp_header_t *tcp, ip_csum_t *sum)
 
static int snat_not_translate_fast (snat_main_t *sm, vlib_node_runtime_t *node, u32 sw_if_index0, ip4_header_t *ip0, u32 proto0, u32 rx_fib_index0)
 Check if packet should be translated. More...
 

Function Documentation

◆ get_icmp_i2o_ed_key()

static_always_inline int get_icmp_i2o_ed_key ( vlib_buffer_t b,
ip4_header_t ip0,
nat_ed_ses_key_t p_key0 
)

Definition at line 473 of file nat_inlines.h.

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

◆ get_icmp_o2i_ed_key()

static_always_inline int get_icmp_o2i_ed_key ( vlib_buffer_t b,
ip4_header_t ip0,
nat_ed_ses_key_t p_key0 
)

Definition at line 525 of file nat_inlines.h.

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

◆ icmp_type_is_error_message()

static_always_inline u8 icmp_type_is_error_message ( u8  icmp_type)

Definition at line 174 of file nat_inlines.h.

+ Here is the caller graph for this function:

◆ ip_proto_to_snat_proto()

static u32 ip_proto_to_snat_proto ( u8  ip_proto)
inlinestatic

Definition at line 147 of file nat_inlines.h.

◆ 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 190 of file nat_inlines.h.

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

◆ make_ed_kv()

static void make_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 441 of file nat_inlines.h.

+ Here is the caller graph for this function:

◆ make_sm_kv()

static void make_sm_kv ( clib_bihash_kv_8_8_t kv,
ip4_address_t addr,
u8  proto,
u32  fib_index,
u16  port 
)
inlinestatic

Definition at line 458 of file nat_inlines.h.

+ Here is the caller graph for this function:

◆ maximum_sessions_exceeded()

static u8 maximum_sessions_exceeded ( snat_main_t sm,
u32  thread_index 
)
inlinestatic

Definition at line 215 of file nat_inlines.h.

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

◆ mss_clamping()

static void mss_clamping ( snat_main_t sm,
tcp_header_t tcp,
ip_csum_t sum 
)
inlinestatic

Definition at line 576 of file nat_inlines.h.

+ Here is the caller graph for this function:

◆ nat44_delete_session()

static void nat44_delete_session ( snat_main_t sm,
snat_session_t *  ses,
u32  thread_index 
)
inlinestatic

Definition at line 289 of file nat_inlines.h.

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

◆ nat44_delete_user_with_no_session()

static void nat44_delete_user_with_no_session ( snat_main_t sm,
snat_user_t u,
u32  thread_index 
)
inlinestatic

Definition at line 267 of file nat_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 394 of file nat_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 417 of file nat_inlines.h.

+ Here is the call graph for this function:
+ 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 431 of file nat_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 int nat44_set_tcp_session_state_i2o ( snat_main_t sm,
snat_session_t *  ses,
vlib_buffer_t b,
u32  thread_index 
)
inlinestatic

Set TCP session state.

Returns
1 if session was closed, otherwise 0

Definition at line 325 of file nat_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 int nat44_set_tcp_session_state_o2i ( snat_main_t sm,
snat_session_t *  ses,
u8  tcp_flags,
u32  tcp_ack_number,
u32  tcp_seq_number,
u32  thread_index 
)
inlinestatic

Definition at line 361 of file nat_inlines.h.

+ Here is the call graph for this function:
+ Here is the caller 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

The NAT inline functions.

Definition at line 27 of file nat_inlines.h.

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

◆ nat_send_all_to_node()

static void nat_send_all_to_node ( vlib_main_t vm,
u32 bi_vector,
vlib_node_runtime_t node,
vlib_error_t error,
u32  next 
)
inlinestatic

Definition at line 225 of file nat_inlines.h.

+ Here is the call graph for this function:

◆ snat_not_translate_fast()

static int snat_not_translate_fast ( snat_main_t sm,
vlib_node_runtime_t node,
u32  sw_if_index0,
ip4_header_t ip0,
u32  proto0,
u32  rx_fib_index0 
)
inlinestatic

Check if packet should be translated.

Packets aimed at outside interface and external address with active session should be translated.

Parameters
smNAT main
rtNAT runtime data
sw_if_index0index of the inside interface
ip0IPv4 header
proto0NAT protocol
rx_fib_index0RX FIB index
Returns
0 if packet should be translated otherwise 1

Definition at line 639 of file nat_inlines.h.

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

◆ snat_proto_to_ip_proto()

static u8 snat_proto_to_ip_proto ( snat_protocol_t  snat_proto)
inlinestatic

Definition at line 162 of file nat_inlines.h.

+ Here is the caller graph for this function:

◆ user_session_increment()

static void user_session_increment ( snat_main_t sm,
snat_user_t u,
u8  is_static 
)
inlinestatic

Definition at line 255 of file nat_inlines.h.

+ Here is the caller graph for this function: