FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
nat44_ei.c File Reference
+ Include dependency graph for nat44_ei.c:

Go to the source code of this file.

Data Structures

struct  nat44_ei_classify_trace_t
 

Macros

#define skip_if_disabled()
 
#define fail_if_enabled()
 
#define fail_if_disabled()
 
#define foreach_nat44_ei_classify_error
 
#define nat_validate_simple_counter(c, i)
 
#define nat_init_simple_counter(c, n, sn)
 

Enumerations

enum  nat44_ei_classify_error_t { NAT44_EI_CLASSIFY_N_ERROR }
 
enum  nat44_ei_classify_next_t { NAT44_EI_CLASSIFY_NEXT_IN2OUT, NAT44_EI_CLASSIFY_NEXT_OUT2IN, NAT44_EI_CLASSIFY_NEXT_DROP, NAT44_EI_CLASSIFY_N_NEXT }
 

Functions

 VNET_FEATURE_INIT (ip4_nat_classify, static)
 
 VNET_FEATURE_INIT (ip4_nat_handoff_classify, static)
 
 VNET_FEATURE_INIT (ip4_nat44_ei_in2out, static)
 
 VNET_FEATURE_INIT (ip4_nat44_ei_out2in, static)
 
 VNET_FEATURE_INIT (ip4_nat44_ei_in2out_output, static)
 
 VNET_FEATURE_INIT (ip4_nat44_ei_in2out_fast, static)
 
 VNET_FEATURE_INIT (ip4_nat44_ei_out2in_fast, static)
 
 VNET_FEATURE_INIT (ip4_nat44_ei_hairpin_dst, static)
 
 VNET_FEATURE_INIT (ip4_nat44_ei_hairpin_src, static)
 
 VNET_FEATURE_INIT (ip4_nat44_ei_hairpinning, static)
 
 VNET_FEATURE_INIT (ip4_nat44_ei_in2out_worker_handoff, static)
 
 VNET_FEATURE_INIT (ip4_nat44_ei_out2in_worker_handoff, static)
 
 VNET_FEATURE_INIT (ip4_nat44_ei_in2out_output_worker_handoff, static)
 
 VLIB_PLUGIN_REGISTER ()
 
void nat44_ei_add_del_addr_to_fib (ip4_address_t *addr, u8 p_len, u32 sw_if_index, int is_add)
 
static u8format_nat44_ei_classify_trace (u8 *s, va_list *args)
 
static void nat44_ei_db_free ()
 
static void nat44_ei_db_init (u32 translations, u32 translation_buckets, u32 user_buckets)
 
static void nat44_ei_ip4_add_del_interface_address_cb (ip4_main_t *im, uword opaque, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 if_address_index, u32 is_delete)
 
static void nat44_ei_ip4_add_del_addr_only_sm_cb (ip4_main_t *im, uword opaque, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 if_address_index, u32 is_delete)
 
static void nat44_ei_update_outside_fib (ip4_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
 
void nat44_ei_set_node_indexes (nat44_ei_main_t *nm, vlib_main_t *vm)
 
int nat44_ei_set_workers (uword *bitmap)
 
static_always_inline void nat_validate_interface_counters (nat44_ei_main_t *nm, u32 sw_if_index)
 
clib_error_tnat44_ei_init (vlib_main_t *vm)
 
int nat44_ei_plugin_enable (nat44_ei_config_t c)
 
void nat44_ei_addresses_free (nat44_ei_address_t **addresses)
 
int nat44_ei_interface_add_del (u32 sw_if_index, u8 is_inside, int is_del)
 
int nat44_ei_interface_add_del_output_feature (u32 sw_if_index, u8 is_inside, int is_del)
 
int nat44_ei_plugin_disable ()
 
int nat44_ei_set_outside_address_and_port (nat44_ei_address_t *addresses, u32 thread_index, ip4_address_t addr, u16 port, nat_protocol_t protocol)
 
void nat44_ei_add_del_address_dpo (ip4_address_t addr, u8 is_add)
 
void nat44_ei_free_outside_address_and_port (nat44_ei_address_t *addresses, u32 thread_index, ip4_address_t *addr, u16 port, nat_protocol_t protocol)
 
void nat44_ei_free_session_data_v2 (nat44_ei_main_t *nm, nat44_ei_session_t *s, u32 thread_index, u8 is_ha)
 
nat44_ei_user_t * nat44_ei_user_get_or_create (nat44_ei_main_t *nm, ip4_address_t *addr, u32 fib_index, u32 thread_index)
 
nat44_ei_session_t * nat44_ei_session_alloc_or_recycle (nat44_ei_main_t *nm, nat44_ei_user_t *u, u32 thread_index, f64 now)
 
void nat44_ei_free_session_data (nat44_ei_main_t *nm, nat44_ei_session_t *s, u32 thread_index, u8 is_ha)
 
static_always_inline void nat44_ei_user_del_sessions (nat44_ei_user_t *u, u32 thread_index)
 
int nat44_ei_user_del (ip4_address_t *addr, u32 fib_index)
 Delete specific NAT44 EI user and his sessions. More...
 
void nat44_ei_static_mapping_del_sessions (nat44_ei_main_t *nm, nat44_ei_main_per_thread_data_t *tnm, nat44_ei_user_key_t u_key, int addr_only, ip4_address_t e_addr, u16 e_port)
 Delete session for static mapping. More...
 
u32 nat44_ei_get_in2out_worker_index (ip4_header_t *ip0, u32 rx_fib_index0, u8 is_output)
 
u32 nat44_ei_get_out2in_worker_index (vlib_buffer_t *b, ip4_header_t *ip0, u32 rx_fib_index0, u8 is_output)
 
static int nat44_ei_alloc_default_cb (nat44_ei_address_t *addresses, u32 fib_index, u32 thread_index, nat_protocol_t proto, ip4_address_t s_addr, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index)
 
static int nat44_ei_alloc_range_cb (nat44_ei_address_t *addresses, u32 fib_index, u32 thread_index, nat_protocol_t proto, ip4_address_t s_addr, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index)
 
static int nat44_ei_alloc_mape_cb (nat44_ei_address_t *addresses, u32 fib_index, u32 thread_index, nat_protocol_t proto, ip4_address_t s_addr, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index)
 
void nat44_ei_set_alloc_default ()
 Set address and port assignment algorithm to default/standard. More...
 
void nat44_ei_set_alloc_range (u16 start_port, u16 end_port)
 Set address and port assignment algorithm for port range. More...
 
void nat44_ei_set_alloc_mape (u16 psid, u16 psid_offset, u16 psid_length)
 Set address and port assignment algorithm for MAP-E CE. More...
 
static void nat44_ei_add_static_mapping_when_resolved (ip4_address_t l_addr, u16 l_port, u16 e_port, nat_protocol_t proto, u32 sw_if_index, u32 vrf_id, int addr_only, int identity_nat, u8 *tag)
 
void nat44_ei_delete_session (nat44_ei_main_t *nm, nat44_ei_session_t *ses, u32 thread_index)
 
int nat44_ei_del_session (nat44_ei_main_t *nm, ip4_address_t *addr, u16 port, nat_protocol_t proto, u32 vrf_id, int is_in)
 Delete NAT44-EI session. More...
 
u32 nat44_ei_get_thread_idx_by_port (u16 e_port)
 
int nat44_ei_add_del_static_mapping (ip4_address_t l_addr, ip4_address_t e_addr, u16 l_port, u16 e_port, nat_protocol_t proto, u32 sw_if_index, u32 vrf_id, u8 addr_only, u8 identity_nat, u8 *tag, u8 is_add)
 Add/delete NAT44-EI static mapping. More...
 
int nat44_ei_static_mapping_match (ip4_address_t match_addr, u16 match_port, u32 match_fib_index, nat_protocol_t match_protocol, ip4_address_t *mapping_addr, u16 *mapping_port, u32 *mapping_fib_index, u8 by_external, u8 *is_addr_only, u8 *is_identity_nat)
 Match NAT44-EI static mapping. More...
 
static void nat44_ei_worker_db_free (nat44_ei_main_per_thread_data_t *tnm)
 
u8format_nat44_ei_key (u8 *s, va_list *args)
 
u8format_nat44_ei_user_kvp (u8 *s, va_list *args)
 
u8format_nat44_ei_session_kvp (u8 *s, va_list *args)
 
u8format_nat44_ei_static_mapping_kvp (u8 *s, va_list *args)
 
static void nat44_ei_worker_db_init (nat44_ei_main_per_thread_data_t *tnm, u32 translations, u32 translation_buckets, u32 user_buckets)
 
void nat44_ei_sessions_clear ()
 Clear all active NAT44-EI sessions. More...
 
int nat44_ei_add_address (nat44_ei_main_t *nm, ip4_address_t *addr, u32 vrf_id)
 
int nat44_ei_add_interface_address (nat44_ei_main_t *nm, u32 sw_if_index, int is_del)
 
static int nat44_ei_is_address_used_in_static_mapping (ip4_address_t addr)
 
int nat44_ei_del_address (nat44_ei_main_t *nm, ip4_address_t addr, u8 delete_sm)
 
int nat44_ei_set_frame_queue_nelts (u32 frame_queue_nelts)
 
static_always_inline uword nat44_ei_classify_inline_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

nat44_ei_main_t nat44_ei_main
 
vlib_node_registration_t nat44_ei_hairpinning_node
 (constructor) VLIB_REGISTER_NODE (nat44_ei_hairpinning_node) More...
 
vlib_node_registration_t nat44_ei_hairpin_dst_node
 (constructor) VLIB_REGISTER_NODE (nat44_ei_hairpin_dst_node) More...
 
vlib_node_registration_t nat44_ei_in2out_hairpinning_finish_ip4_lookup_node
 (constructor) VLIB_REGISTER_NODE (nat44_ei_in2out_hairpinning_finish_ip4_lookup_node) More...
 
vlib_node_registration_t nat44_ei_in2out_hairpinning_finish_interface_output_node
 (constructor) VLIB_REGISTER_NODE (nat44_ei_in2out_hairpinning_finish_interface_output_node) More...
 
static char * nat44_ei_classify_error_strings []
 
vlib_main_tvm
 X-connect all packets from the HOST to the PHY. More...
 
vlib_main_t vlib_node_runtime_tnode
 
vlib_main_t vlib_node_runtime_t vlib_frame_tframe
 
vlib_node_registration_t nat44_ei_classify_node
 (constructor) VLIB_REGISTER_NODE (nat44_ei_classify_node) More...
 
vlib_node_registration_t nat44_ei_handoff_classify_node
 (constructor) VLIB_REGISTER_NODE (nat44_ei_handoff_classify_node) More...
 

Macro Definition Documentation

◆ fail_if_disabled

#define fail_if_disabled ( )
Value:
do \
{ \
nat44_ei_main_t *nm = &nat44_ei_main; \
{ \
nat44_ei_log_err ("plugin disabled"); \
return 1; \
} \
} \
while (0)

Definition at line 70 of file nat44_ei.c.

◆ fail_if_enabled

#define fail_if_enabled ( )
Value:
do \
{ \
nat44_ei_main_t *nm = &nat44_ei_main; \
{ \
nat44_ei_log_err ("plugin enabled"); \
return 1; \
} \
} \
while (0)

Definition at line 58 of file nat44_ei.c.

◆ foreach_nat44_ei_classify_error

#define foreach_nat44_ei_classify_error
Value:
_ (NEXT_IN2OUT, "next in2out") \
_ (NEXT_OUT2IN, "next out2in") \
_ (FRAG_CACHED, "fragment cached")

Definition at line 167 of file nat44_ei.c.

◆ nat_init_simple_counter

#define nat_init_simple_counter (   c,
  n,
  sn 
)
Value:
do \
{ \
c.name = n; \
c.stat_segment_name = sn; \
nat_validate_simple_counter (c, 0); \
} \
while (0);

Definition at line 285 of file nat44_ei.c.

◆ nat_validate_simple_counter

#define nat_validate_simple_counter (   c,
  i 
)
Value:
do \
{ \
vlib_validate_simple_counter (&c, i); \
vlib_zero_simple_counter (&c, i); \
} \
while (0);

Definition at line 277 of file nat44_ei.c.

◆ skip_if_disabled

#define skip_if_disabled ( )
Value:
do \
{ \
nat44_ei_main_t *nm = &nat44_ei_main; \
return; \
} \
while (0)

Definition at line 49 of file nat44_ei.c.

Enumeration Type Documentation

◆ nat44_ei_classify_error_t

Enumerator
NAT44_EI_CLASSIFY_N_ERROR 

Definition at line 172 of file nat44_ei.c.

◆ nat44_ei_classify_next_t

Enumerator
NAT44_EI_CLASSIFY_NEXT_IN2OUT 
NAT44_EI_CLASSIFY_NEXT_OUT2IN 
NAT44_EI_CLASSIFY_NEXT_DROP 
NAT44_EI_CLASSIFY_N_NEXT 

Definition at line 186 of file nat44_ei.c.

Function Documentation

◆ format_nat44_ei_classify_trace()

static u8* format_nat44_ei_classify_trace ( u8 s,
va_list *  args 
)
static

Definition at line 204 of file nat44_ei.c.

◆ format_nat44_ei_key()

u8* format_nat44_ei_key ( u8 s,
va_list *  args 
)

Definition at line 2329 of file nat44_ei.c.

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

◆ format_nat44_ei_session_kvp()

u8* format_nat44_ei_session_kvp ( u8 s,
va_list *  args 
)

Definition at line 2361 of file nat44_ei.c.

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

◆ format_nat44_ei_static_mapping_kvp()

u8* format_nat44_ei_static_mapping_kvp ( u8 s,
va_list *  args 
)

Definition at line 2373 of file nat44_ei.c.

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

◆ format_nat44_ei_user_kvp()

u8* format_nat44_ei_user_kvp ( u8 s,
va_list *  args 
)

Definition at line 2347 of file nat44_ei.c.

+ Here is the caller graph for this function:

◆ nat44_ei_add_address()

int nat44_ei_add_address ( nat44_ei_main_t nm,
ip4_address_t addr,
u32  vrf_id 
)

Definition at line 2575 of file nat44_ei.c.

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

◆ nat44_ei_add_del_addr_to_fib()

void nat44_ei_add_del_addr_to_fib ( ip4_address_t addr,
u8  p_len,
u32  sw_if_index,
int  is_add 
)

Definition at line 1829 of file nat44_ei.c.

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

◆ nat44_ei_add_del_address_dpo()

void nat44_ei_add_del_address_dpo ( ip4_address_t  addr,
u8  is_add 
)

Definition at line 1019 of file nat44_ei.c.

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

◆ nat44_ei_add_del_static_mapping()

int nat44_ei_add_del_static_mapping ( ip4_address_t  l_addr,
ip4_address_t  e_addr,
u16  l_port,
u16  e_port,
nat_protocol_t  proto,
u32  sw_if_index,
u32  vrf_id,
u8  addr_only,
u8  identity_nat,
u8 tag,
u8  is_add 
)

Add/delete NAT44-EI static mapping.

Parameters
l_addrlocal IPv4 address
e_addrexternal IPv4 address
l_portlocal port number
e_portexternal port number
protoL4 protocol
sw_if_indexuse interface address as external IPv4 address
vrf_idlocal VRF ID
addr_only1 = 1:1NAT, 0 = 1:1NAPT
identity_natidentity NAT
tagopaque string tag
is_add1 = add, 0 = delete
Returns
0 on success, non-zero value otherwise

Definition at line 1853 of file nat44_ei.c.

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

◆ nat44_ei_add_interface_address()

int nat44_ei_add_interface_address ( nat44_ei_main_t nm,
u32  sw_if_index,
int  is_del 
)

Definition at line 2632 of file nat44_ei.c.

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

◆ nat44_ei_add_static_mapping_when_resolved()

static void nat44_ei_add_static_mapping_when_resolved ( ip4_address_t  l_addr,
u16  l_port,
u16  e_port,
nat_protocol_t  proto,
u32  sw_if_index,
u32  vrf_id,
int  addr_only,
int  identity_nat,
u8 tag 
)
static

Definition at line 1729 of file nat44_ei.c.

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

◆ nat44_ei_addresses_free()

void nat44_ei_addresses_free ( nat44_ei_address_t **  addresses)

Definition at line 482 of file nat44_ei.c.

+ Here is the caller graph for this function:

◆ nat44_ei_alloc_default_cb()

static int nat44_ei_alloc_default_cb ( nat44_ei_address_t addresses,
u32  fib_index,
u32  thread_index,
nat_protocol_t  proto,
ip4_address_t  s_addr,
ip4_address_t addr,
u16 port,
u16  port_per_thread,
u32  snat_thread_index 
)
static

Definition at line 1512 of file nat44_ei.c.

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

◆ nat44_ei_alloc_mape_cb()

static int nat44_ei_alloc_mape_cb ( nat44_ei_address_t addresses,
u32  fib_index,
u32  thread_index,
nat_protocol_t  proto,
ip4_address_t  s_addr,
ip4_address_t addr,
u16 port,
u16  port_per_thread,
u32  snat_thread_index 
)
static

Definition at line 1648 of file nat44_ei.c.

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

◆ nat44_ei_alloc_range_cb()

static int nat44_ei_alloc_range_cb ( nat44_ei_address_t addresses,
u32  fib_index,
u32  thread_index,
nat_protocol_t  proto,
ip4_address_t  s_addr,
ip4_address_t addr,
u16 port,
u16  port_per_thread,
u32  snat_thread_index 
)
static

Definition at line 1601 of file nat44_ei.c.

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

◆ nat44_ei_classify_inline_fn()

static_always_inline uword nat44_ei_classify_inline_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 2946 of file nat44_ei.c.

+ Here is the call graph for this function:

◆ nat44_ei_db_free()

static void nat44_ei_db_free ( )
static

Definition at line 2421 of file nat44_ei.c.

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

◆ nat44_ei_db_init()

static void nat44_ei_db_init ( u32  translations,
u32  translation_buckets,
u32  user_buckets 
)
static

Definition at line 2442 of file nat44_ei.c.

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

◆ nat44_ei_del_address()

int nat44_ei_del_address ( nat44_ei_main_t nm,
ip4_address_t  addr,
u8  delete_sm 
)

Definition at line 2708 of file nat44_ei.c.

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

◆ nat44_ei_del_session()

int nat44_ei_del_session ( nat44_ei_main_t nm,
ip4_address_t addr,
u16  port,
nat_protocol_t  proto,
u32  vrf_id,
int  is_in 
)

Delete NAT44-EI session.

Parameters
addrIPv4 address
portL4 port number
protoL4 protocol
vrf_idVRF ID
is_in1 = inside network address and port pair, 0 = outside
Returns
0 on success, non-zero value otherwise

Definition at line 1785 of file nat44_ei.c.

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

◆ nat44_ei_delete_session()

void nat44_ei_delete_session ( nat44_ei_main_t nm,
nat44_ei_session_t *  ses,
u32  thread_index 
)

Definition at line 1753 of file nat44_ei.c.

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

◆ nat44_ei_free_outside_address_and_port()

void nat44_ei_free_outside_address_and_port ( nat44_ei_address_t addresses,
u32  thread_index,
ip4_address_t addr,
u16  port,
nat_protocol_t  protocol 
)

Definition at line 1043 of file nat44_ei.c.

+ Here is the caller graph for this function:

◆ nat44_ei_free_session_data()

void nat44_ei_free_session_data ( nat44_ei_main_t nm,
nat44_ei_session_t *  s,
u32  thread_index,
u8  is_ha 
)

Definition at line 1252 of file nat44_ei.c.

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

◆ nat44_ei_free_session_data_v2()

void nat44_ei_free_session_data_v2 ( nat44_ei_main_t nm,
nat44_ei_session_t *  s,
u32  thread_index,
u8  is_ha 
)

Definition at line 1079 of file nat44_ei.c.

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

◆ nat44_ei_get_in2out_worker_index()

u32 nat44_ei_get_in2out_worker_index ( ip4_header_t ip0,
u32  rx_fib_index0,
u8  is_output 
)

Definition at line 1408 of file nat44_ei.c.

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

◆ nat44_ei_get_out2in_worker_index()

u32 nat44_ei_get_out2in_worker_index ( vlib_buffer_t b,
ip4_header_t ip0,
u32  rx_fib_index0,
u8  is_output 
)

Definition at line 1428 of file nat44_ei.c.

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

◆ nat44_ei_get_thread_idx_by_port()

u32 nat44_ei_get_thread_idx_by_port ( u16  e_port)

Definition at line 1816 of file nat44_ei.c.

◆ nat44_ei_init()

clib_error_t* nat44_ei_init ( vlib_main_t vm)

Definition at line 308 of file nat44_ei.c.

+ Here is the call graph for this function:

◆ nat44_ei_interface_add_del()

int nat44_ei_interface_add_del ( u32  sw_if_index,
u8  is_inside,
int  is_del 
)

Definition at line 496 of file nat44_ei.c.

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

◆ nat44_ei_interface_add_del_output_feature()

int nat44_ei_interface_add_del_output_feature ( u32  sw_if_index,
u8  is_inside,
int  is_del 
)

Definition at line 747 of file nat44_ei.c.

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

◆ nat44_ei_ip4_add_del_addr_only_sm_cb()

static void nat44_ei_ip4_add_del_addr_only_sm_cb ( ip4_main_t im,
uword  opaque,
u32  sw_if_index,
ip4_address_t address,
u32  address_length,
u32  if_address_index,
u32  is_delete 
)
static

Definition at line 2883 of file nat44_ei.c.

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

◆ nat44_ei_ip4_add_del_interface_address_cb()

static void nat44_ei_ip4_add_del_interface_address_cb ( ip4_main_t im,
uword  opaque,
u32  sw_if_index,
ip4_address_t address,
u32  address_length,
u32  if_address_index,
u32  is_delete 
)
static

Definition at line 2807 of file nat44_ei.c.

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

◆ nat44_ei_is_address_used_in_static_mapping()

static int nat44_ei_is_address_used_in_static_mapping ( ip4_address_t  addr)
static

Definition at line 2692 of file nat44_ei.c.

+ Here is the caller graph for this function:

◆ nat44_ei_plugin_disable()

int nat44_ei_plugin_disable ( )

Definition at line 920 of file nat44_ei.c.

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

◆ nat44_ei_plugin_enable()

int nat44_ei_plugin_enable ( nat44_ei_config_t  c)

Definition at line 419 of file nat44_ei.c.

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

◆ nat44_ei_session_alloc_or_recycle()

nat44_ei_session_t* nat44_ei_session_alloc_or_recycle ( nat44_ei_main_t nm,
nat44_ei_user_t *  u,
u32  thread_index,
f64  now 
)

Definition at line 1180 of file nat44_ei.c.

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

◆ nat44_ei_sessions_clear()

void nat44_ei_sessions_clear ( )

Clear all active NAT44-EI sessions.

Definition at line 2478 of file nat44_ei.c.

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

◆ nat44_ei_set_alloc_default()

void nat44_ei_set_alloc_default ( )

Set address and port assignment algorithm to default/standard.

Definition at line 1697 of file nat44_ei.c.

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

◆ nat44_ei_set_alloc_mape()

void nat44_ei_set_alloc_mape ( u16  psid,
u16  psid_offset,
u16  psid_length 
)

Set address and port assignment algorithm for MAP-E CE.

Parameters
psidPort Set Identifier value
psid_offsetnumber of offset bits
psid_lengthlength of PSID

Definition at line 1717 of file nat44_ei.c.

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

◆ nat44_ei_set_alloc_range()

void nat44_ei_set_alloc_range ( u16  start_port,
u16  end_port 
)

Set address and port assignment algorithm for port range.

Parameters
start_portbeginning of the port range
end_portend of the port range

Definition at line 1706 of file nat44_ei.c.

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

◆ nat44_ei_set_frame_queue_nelts()

int nat44_ei_set_frame_queue_nelts ( u32  frame_queue_nelts)

Definition at line 2874 of file nat44_ei.c.

+ Here is the caller graph for this function:

◆ nat44_ei_set_node_indexes()

void nat44_ei_set_node_indexes ( nat44_ei_main_t nm,
vlib_main_t vm 
)

Definition at line 240 of file nat44_ei.c.

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

◆ nat44_ei_set_outside_address_and_port()

int nat44_ei_set_outside_address_and_port ( nat44_ei_address_t addresses,
u32  thread_index,
ip4_address_t  addr,
u16  port,
nat_protocol_t  protocol 
)

Definition at line 983 of file nat44_ei.c.

+ Here is the caller graph for this function:

◆ nat44_ei_set_workers()

int nat44_ei_set_workers ( uword bitmap)

Definition at line 252 of file nat44_ei.c.

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

◆ nat44_ei_static_mapping_del_sessions()

void nat44_ei_static_mapping_del_sessions ( nat44_ei_main_t nm,
nat44_ei_main_per_thread_data_t tnm,
nat44_ei_user_key_t  u_key,
int  addr_only,
ip4_address_t  e_addr,
u16  e_port 
)

Delete session for static mapping.

Parameters
addrIPv4 address
fib_indexFIB table index

Definition at line 1356 of file nat44_ei.c.

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

◆ nat44_ei_static_mapping_match()

int nat44_ei_static_mapping_match ( ip4_address_t  match_addr,
u16  match_port,
u32  match_fib_index,
nat_protocol_t  match_protocol,
ip4_address_t mapping_addr,
u16 mapping_port,
u32 mapping_fib_index,
u8  by_external,
u8 is_addr_only,
u8 is_identity_nat 
)

Match NAT44-EI static mapping.

Parameters
keyaddress and port to match
addrexternal/local address of the matched mapping
portport of the matched mapping
fib_indexfib index of the matched mapping
by_externalif 0 match by local address otherwise match by external address
is_addr_only1 if matched mapping is address only
is_identity_nat1 if indentity mapping
Returns
0 if match found otherwise 1.

Definition at line 2253 of file nat44_ei.c.

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

◆ nat44_ei_update_outside_fib()

static void nat44_ei_update_outside_fib ( ip4_main_t im,
uword  opaque,
u32  sw_if_index,
u32  new_fib_index,
u32  old_fib_index 
)
static

Definition at line 2507 of file nat44_ei.c.

+ Here is the caller graph for this function:

◆ nat44_ei_user_del()

int nat44_ei_user_del ( ip4_address_t addr,
u32  fib_index 
)

Delete specific NAT44 EI user and his sessions.

Parameters
addrIPv4 address
fib_indexFIB table index

Definition at line 1314 of file nat44_ei.c.

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

◆ nat44_ei_user_del_sessions()

static_always_inline void nat44_ei_user_del_sessions ( nat44_ei_user_t *  u,
u32  thread_index 
)

Definition at line 1289 of file nat44_ei.c.

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

◆ nat44_ei_user_get_or_create()

nat44_ei_user_t* nat44_ei_user_get_or_create ( nat44_ei_main_t nm,
ip4_address_t addr,
u32  fib_index,
u32  thread_index 
)

Definition at line 1121 of file nat44_ei.c.

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

◆ nat44_ei_worker_db_free()

static void nat44_ei_worker_db_free ( nat44_ei_main_per_thread_data_t tnm)
static

Definition at line 2318 of file nat44_ei.c.

+ Here is the caller graph for this function:

◆ nat44_ei_worker_db_init()

static void nat44_ei_worker_db_init ( nat44_ei_main_per_thread_data_t tnm,
u32  translations,
u32  translation_buckets,
u32  user_buckets 
)
static

Definition at line 2384 of file nat44_ei.c.

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

◆ nat_validate_interface_counters()

static_always_inline void nat_validate_interface_counters ( nat44_ei_main_t nm,
u32  sw_if_index 
)

Definition at line 295 of file nat44_ei.c.

+ Here is the caller graph for this function:

◆ VLIB_PLUGIN_REGISTER()

VLIB_PLUGIN_REGISTER ( )

◆ VNET_FEATURE_INIT() [1/13]

VNET_FEATURE_INIT ( ip4_nat44_ei_hairpin_dst  ,
static   
)

◆ VNET_FEATURE_INIT() [2/13]

VNET_FEATURE_INIT ( ip4_nat44_ei_hairpin_src  ,
static   
)

◆ VNET_FEATURE_INIT() [3/13]

VNET_FEATURE_INIT ( ip4_nat44_ei_hairpinning  ,
static   
)

◆ VNET_FEATURE_INIT() [4/13]

VNET_FEATURE_INIT ( ip4_nat44_ei_in2out  ,
static   
)

◆ VNET_FEATURE_INIT() [5/13]

VNET_FEATURE_INIT ( ip4_nat44_ei_in2out_fast  ,
static   
)

◆ VNET_FEATURE_INIT() [6/13]

VNET_FEATURE_INIT ( ip4_nat44_ei_in2out_output  ,
static   
)

◆ VNET_FEATURE_INIT() [7/13]

VNET_FEATURE_INIT ( ip4_nat44_ei_in2out_output_worker_handoff  ,
static   
)

◆ VNET_FEATURE_INIT() [8/13]

VNET_FEATURE_INIT ( ip4_nat44_ei_in2out_worker_handoff  ,
static   
)

◆ VNET_FEATURE_INIT() [9/13]

VNET_FEATURE_INIT ( ip4_nat44_ei_out2in  ,
static   
)

◆ VNET_FEATURE_INIT() [10/13]

VNET_FEATURE_INIT ( ip4_nat44_ei_out2in_fast  ,
static   
)

◆ VNET_FEATURE_INIT() [11/13]

VNET_FEATURE_INIT ( ip4_nat44_ei_out2in_worker_handoff  ,
static   
)

◆ VNET_FEATURE_INIT() [12/13]

VNET_FEATURE_INIT ( ip4_nat_classify  ,
static   
)

◆ VNET_FEATURE_INIT() [13/13]

VNET_FEATURE_INIT ( ip4_nat_handoff_classify  ,
static   
)

Variable Documentation

◆ frame

Initial value:

Definition at line 3048 of file nat44_ei.c.

◆ nat44_ei_classify_error_strings

char* nat44_ei_classify_error_strings[]
static
Initial value:
= {
#define _(sym, string)
}

Definition at line 180 of file nat44_ei.c.

◆ nat44_ei_classify_node

vlib_node_registration_t nat44_ei_classify_node
Initial value:
= {
.name = "nat44-ei-classify",
.vector_size = sizeof (u32),
.n_next_nodes = NAT44_EI_CLASSIFY_N_NEXT,
.next_nodes = {
[NAT44_EI_CLASSIFY_NEXT_IN2OUT] = "nat44-ei-in2out",
[NAT44_EI_CLASSIFY_NEXT_OUT2IN] = "nat44-ei-out2in",
[NAT44_EI_CLASSIFY_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (nat44_ei_classify_node)

Definition at line 3052 of file nat44_ei.c.

◆ nat44_ei_hairpin_dst_node

vlib_node_registration_t nat44_ei_hairpin_dst_node

(constructor) VLIB_REGISTER_NODE (nat44_ei_hairpin_dst_node)

Definition at line 727 of file nat44_ei_hairpinning.c.

◆ nat44_ei_hairpinning_node

vlib_node_registration_t nat44_ei_hairpinning_node

(constructor) VLIB_REGISTER_NODE (nat44_ei_hairpinning_node)

Definition at line 740 of file nat44_ei_hairpinning.c.

◆ nat44_ei_handoff_classify_node

vlib_node_registration_t nat44_ei_handoff_classify_node
Initial value:
= {
.name = "nat44-ei-handoff-classify",
.vector_size = sizeof (u32),
.n_next_nodes = NAT44_EI_CLASSIFY_N_NEXT,
.next_nodes = {
[NAT44_EI_CLASSIFY_NEXT_IN2OUT] = "nat44-ei-in2out-worker-handoff",
[NAT44_EI_CLASSIFY_NEXT_OUT2IN] = "nat44-ei-out2in-worker-handoff",
[NAT44_EI_CLASSIFY_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (nat44_ei_handoff_classify_node)

Definition at line 3073 of file nat44_ei.c.

◆ nat44_ei_in2out_hairpinning_finish_interface_output_node

vlib_node_registration_t nat44_ei_in2out_hairpinning_finish_interface_output_node

(constructor) VLIB_REGISTER_NODE (nat44_ei_in2out_hairpinning_finish_interface_output_node)

Definition at line 2193 of file nat44_ei_in2out.c.

◆ nat44_ei_in2out_hairpinning_finish_ip4_lookup_node

vlib_node_registration_t nat44_ei_in2out_hairpinning_finish_ip4_lookup_node

(constructor) VLIB_REGISTER_NODE (nat44_ei_in2out_hairpinning_finish_ip4_lookup_node)

Definition at line 2167 of file nat44_ei_in2out.c.

◆ nat44_ei_main

nat44_ei_main_t nat44_ei_main

Definition at line 40 of file nat44_ei.c.

◆ node

Definition at line 3047 of file nat44_ei.c.

◆ vm

X-connect all packets from the HOST to the PHY.

x-connect ARP packets from the host to the phy

punt ARP replies to the host

Definition at line 3047 of file nat44_ei.c.

foreach_nat44_ei_classify_error
#define foreach_nat44_ei_classify_error
Definition: nat44_ei.c:167
frame
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
Definition: nat44_ei.c:3048
NAT44_EI_CLASSIFY_NEXT_DROP
@ NAT44_EI_CLASSIFY_NEXT_DROP
Definition: nat44_ei.c:190
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
NAT44_EI_CLASSIFY_N_NEXT
@ NAT44_EI_CLASSIFY_N_NEXT
Definition: nat44_ei.c:191
NAT44_EI_CLASSIFY_NEXT_IN2OUT
@ NAT44_EI_CLASSIFY_NEXT_IN2OUT
Definition: nat44_ei.c:188
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
nat44_ei_classify_inline_fn
static_always_inline uword nat44_ei_classify_inline_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: nat44_ei.c:2946
nat44_ei_main_s::enabled
u8 enabled
Definition: nat44_ei.h:471
nat44_ei_main
nat44_ei_main_t nat44_ei_main
Definition: nat44_ei.c:40
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
NAT44_EI_CLASSIFY_NEXT_OUT2IN
@ NAT44_EI_CLASSIFY_NEXT_OUT2IN
Definition: nat44_ei.c:189
c
svmdb_client_t * c
Definition: vpp_get_metrics.c:48
format_nat44_ei_classify_trace
static u8 * format_nat44_ei_classify_trace(u8 *s, va_list *args)
Definition: nat44_ei.c:204
u32
unsigned int u32
Definition: types.h:88
nm
nat44_ei_main_t * nm
Definition: nat44_ei_hairpinning.c:413
nat44_ei_classify_error_strings
static char * nat44_ei_classify_error_strings[]
Definition: nat44_ei.c:180
i
int i
Definition: flowhash_template.h:376
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123