FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
nat_det.h File Reference

deterministic NAT definitions More...

+ Include dependency graph for nat_det.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SNAT_DET_SES_PER_USER   1000
 

Functions

int snat_det_add_map (snat_main_t *sm, ip4_address_t *in_addr, u8 in_plen, ip4_address_t *out_addr, u8 out_plen, int is_add)
 Add/delete deterministic NAT mapping. More...
 
static int is_addr_in_net (ip4_address_t *addr, ip4_address_t *net, u8 plen)
 
static snat_det_map_tsnat_det_map_by_user (snat_main_t *sm, ip4_address_t *user_addr)
 
static snat_det_map_tsnat_det_map_by_out (snat_main_t *sm, ip4_address_t *out_addr)
 
static void snat_det_forward (snat_det_map_t *dm, ip4_address_t *in_addr, ip4_address_t *out_addr, u16 *lo_port)
 
static void snat_det_reverse (snat_det_map_t *dm, ip4_address_t *out_addr, u16 out_port, ip4_address_t *in_addr)
 
static u32 snat_det_user_ses_offset (ip4_address_t *addr, u8 plen)
 
static snat_det_session_tsnat_det_get_ses_by_out (snat_det_map_t *dm, ip4_address_t *in_addr, u64 out_key)
 
static snat_det_session_tsnat_det_find_ses_by_in (snat_det_map_t *dm, ip4_address_t *in_addr, u16 in_port, snat_det_out_key_t out_key)
 
static snat_det_session_tsnat_det_ses_create (u32 thread_index, snat_det_map_t *dm, ip4_address_t *in_addr, u16 in_port, snat_det_out_key_t *out)
 
static void snat_det_ses_close (snat_det_map_t *dm, snat_det_session_t *ses)
 

Detailed Description

deterministic NAT definitions

Definition in file nat_det.h.

Macro Definition Documentation

◆ SNAT_DET_SES_PER_USER

#define SNAT_DET_SES_PER_USER   1000

Definition at line 30 of file nat_det.h.

Function Documentation

◆ is_addr_in_net()

static int is_addr_in_net ( ip4_address_t addr,
ip4_address_t net,
u8  plen 
)
inlinestatic

Definition at line 37 of file nat_det.h.

◆ snat_det_add_map()

int snat_det_add_map ( snat_main_t sm,
ip4_address_t in_addr,
u8  in_plen,
ip4_address_t out_addr,
u8  out_plen,
int  is_add 
)

Add/delete deterministic NAT mapping.

Create bijective mapping of inside address to outside address and port range pairs, with the purpose of enabling deterministic NAT to reduce logging in CGN deployments.

Parameters
smSNAT main.
in_addrInside network address.
in_plenInside network prefix length.
out_addrOutside network address.
out_plenOutside network prefix length.
is_addIf 0 delete, otherwise add.

Definition at line 40 of file nat_det.c.

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

◆ snat_det_find_ses_by_in()

static snat_det_session_t* snat_det_find_ses_by_in ( snat_det_map_t dm,
ip4_address_t in_addr,
u16  in_port,
snat_det_out_key_t  out_key 
)
inlinestatic

Definition at line 129 of file nat_det.h.

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

◆ snat_det_forward()

static void snat_det_forward ( snat_det_map_t dm,
ip4_address_t in_addr,
ip4_address_t out_addr,
u16 lo_port 
)
inlinestatic

Definition at line 75 of file nat_det.h.

+ Here is the caller graph for this function:

◆ snat_det_get_ses_by_out()

static snat_det_session_t* snat_det_get_ses_by_out ( snat_det_map_t dm,
ip4_address_t in_addr,
u64  out_key 
)
inlinestatic

Definition at line 112 of file nat_det.h.

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

◆ snat_det_map_by_out()

static snat_det_map_t* snat_det_map_by_out ( snat_main_t sm,
ip4_address_t out_addr 
)
inlinestatic

Definition at line 60 of file nat_det.h.

+ Here is the caller graph for this function:

◆ snat_det_map_by_user()

static snat_det_map_t* snat_det_map_by_user ( snat_main_t sm,
ip4_address_t user_addr 
)
inlinestatic

Definition at line 45 of file nat_det.h.

+ Here is the caller graph for this function:

◆ snat_det_reverse()

static void snat_det_reverse ( snat_det_map_t dm,
ip4_address_t out_addr,
u16  out_port,
ip4_address_t in_addr 
)
inlinestatic

Definition at line 90 of file nat_det.h.

+ Here is the caller graph for this function:

◆ snat_det_ses_close()

static void snat_det_ses_close ( snat_det_map_t dm,
snat_det_session_t ses 
)
inlinestatic

Definition at line 182 of file nat_det.h.

+ Here is the caller graph for this function:

◆ snat_det_ses_create()

static snat_det_session_t* snat_det_ses_create ( u32  thread_index,
snat_det_map_t dm,
ip4_address_t in_addr,
u16  in_port,
snat_det_out_key_t out 
)
inlinestatic

Definition at line 150 of file nat_det.h.

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

◆ snat_det_user_ses_offset()

static u32 snat_det_user_ses_offset ( ip4_address_t addr,
u8  plen 
)
inlinestatic

Definition at line 105 of file nat_det.h.

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