FD.io VPP  v17.01.1-3-gc6833f8
Vector Packet Processing
snat.h File Reference
+ Include dependency graph for snat.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  snat_session_key_t
 
struct  snat_user_key_t
 
struct  snat_static_mapping_key_t
 
struct  snat_user_t
 
struct  snat_address_t
 
struct  snat_static_mapping_t
 
struct  snat_interface_t
 
struct  snat_main_per_thread_data_t
 
struct  snat_main_t
 
struct  snat_runtime_t
 
struct  icmp_echo_header_t
 

Macros

#define SNAT_SESSION_FLAG_STATIC_MAPPING   1
 
#define snat_is_session_static(s)   s->flags & SNAT_SESSION_FLAG_STATIC_MAPPING
 Check if SNAT session is created from static mapping. More...
 

Enumerations

enum  snat_protocol_t { SNAT_PROTOCOL_UDP = 0, SNAT_PROTOCOL_TCP, SNAT_PROTOCOL_ICMP }
 

Functions

typedef CLIB_PACKED (struct{snat_session_key_t out2in;snat_session_key_t in2out;u32 flags;u32 per_user_index;u32 per_user_list_head_index;f64 last_heard;u64 total_bytes;u32 total_pkts;u32 outside_address_index;}) snat_session_t
 
void snat_free_outside_address_and_port (snat_main_t *sm, snat_session_key_t *k, u32 address_index)
 
int snat_alloc_outside_address_and_port (snat_main_t *sm, snat_session_key_t *k, u32 *address_indexp)
 
int snat_static_mapping_match (snat_main_t *sm, snat_session_key_t match, snat_session_key_t *mapping, u8 by_external)
 Match SNAT static mapping. More...
 

Variables

snat_main_t snat_main
 
vlib_node_registration_t snat_in2out_node
 (constructor) VLIB_REGISTER_NODE (snat_in2out_node) More...
 
vlib_node_registration_t snat_out2in_node
 (constructor) VLIB_REGISTER_NODE (snat_out2in_node) More...
 
vlib_node_registration_t snat_in2out_fast_node
 (constructor) VLIB_REGISTER_NODE (snat_in2out_fast_node) More...
 
vlib_node_registration_t snat_out2in_fast_node
 (constructor) VLIB_REGISTER_NODE (snat_out2in_fast_node) More...
 
vlib_node_registration_t snat_in2out_worker_handoff_node
 (constructor) VLIB_REGISTER_NODE (snat_in2out_worker_handoff_node) More...
 
vlib_node_registration_t snat_out2in_worker_handoff_node
 (constructor) VLIB_REGISTER_NODE (snat_out2in_worker_handoff_node) More...
 
format_function_t format_snat_user
 

Macro Definition Documentation

#define snat_is_session_static (   s)    s->flags & SNAT_SESSION_FLAG_STATIC_MAPPING

Check if SNAT session is created from static mapping.

Parameters
sSNAT session
Returns
1 if SNAT session is created from static mapping otherwise 0

Definition at line 246 of file snat.h.

#define SNAT_SESSION_FLAG_STATIC_MAPPING   1

Definition at line 79 of file snat.h.

Enumeration Type Documentation

Enumerator
SNAT_PROTOCOL_UDP 
SNAT_PROTOCOL_TCP 
SNAT_PROTOCOL_ICMP 

Definition at line 72 of file snat.h.

Function Documentation

typedef CLIB_PACKED ( struct{snat_session_key_t out2in;snat_session_key_t in2out;u32 flags;u32 per_user_index;u32 per_user_list_head_index;f64 last_heard;u64 total_bytes;u32 total_pkts;u32 outside_address_index;}  )
int snat_alloc_outside_address_and_port ( snat_main_t sm,
snat_session_key_t k,
u32 address_indexp 
)

Definition at line 1292 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void snat_free_outside_address_and_port ( snat_main_t sm,
snat_session_key_t k,
u32  address_index 
)

Definition at line 1213 of file snat.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int snat_static_mapping_match ( snat_main_t sm,
snat_session_key_t  match,
snat_session_key_t mapping,
u8  by_external 
)

Match SNAT static mapping.

Parameters
smSNAT main.
matchAddress and port to match.
mappingExternal or local address and port of the matched mapping.
by_externalIf 0 match by local address otherwise match by external address.
Returns
0 if match found otherwise 1.

Definition at line 1242 of file snat.c.

+ Here is the caller graph for this function:

Variable Documentation

format_function_t format_snat_user

Definition at line 235 of file snat.h.

vlib_node_registration_t snat_in2out_fast_node

(constructor) VLIB_REGISTER_NODE (snat_in2out_fast_node)

Definition at line 86 of file in2out.c.

vlib_node_registration_t snat_in2out_node

(constructor) VLIB_REGISTER_NODE (snat_in2out_node)

Definition at line 84 of file in2out.c.

vlib_node_registration_t snat_in2out_worker_handoff_node

(constructor) VLIB_REGISTER_NODE (snat_in2out_worker_handoff_node)

Definition at line 87 of file in2out.c.

snat_main_t snat_main

Definition at line 42 of file jvpp_snat.h.

vlib_node_registration_t snat_out2in_fast_node

(constructor) VLIB_REGISTER_NODE (snat_out2in_fast_node)

Definition at line 79 of file out2in.c.

vlib_node_registration_t snat_out2in_node

(constructor) VLIB_REGISTER_NODE (snat_out2in_node)

Definition at line 78 of file out2in.c.

vlib_node_registration_t snat_out2in_worker_handoff_node

(constructor) VLIB_REGISTER_NODE (snat_out2in_worker_handoff_node)

Definition at line 80 of file out2in.c.