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

Go to the source code of this file.

Data Structures

struct  nat64_bib_entry_t
 
struct  nat64_bib_user_entry_t
 
struct  nat64_session_entry_t
 
struct  nat64_session_tcp_init_entry_t
 
struct  nat64_in_v6_frag_entry_t
 
struct  nat64_out_v4_frag_entry_t
 
struct  nat64_timeout_t
 
struct  nat64_timeout_db_entry_t
 
union  cgse_nat_db_entry_t
 
union  cgse_nat_session_db_entry_t
 
union  cgse_nat_user_db_entry_t
 

Macros

#define SESSION_OPT
 
#define HASH_ENHANCE   4
 
#define NAT64_MAIN_DB_SIZE   (PLATFORM_NAT64_MAX_SESSIONS / PLATFORM_CNAT_INSTS)
 
#define NAT64_MAIN_HASH_SIZE   (HASH_ENHANCE * PLATFORM_CNAT_MAIN_PRELIM_HASH_SIZE)
 
#define NAT64_MAIN_HASH_MASK   (NAT64_MAIN_HASH_SIZE-1)
 
#define NAT64_USER_HASH_SIZE   CNAT_USER_HASH_SIZE
 
#define NAT64_USER_HASH_MASK   (NAT64_USER_HASH_SIZE-1)
 
#define NAT64_MAX_SESSIONS_PER_BIB   0xFFFF
 
#define NAT64_TIMEOUT_HASH_SIZE   PLATFORM_NAT64_TIMEOUT_HASH_SIZE
 
#define NAT64_TIMEOUT_HASH_MASK   (NAT64_TIMEOUT_HASH_SIZE - 1)
 
#define NAT64_TIMEOUT_FULL_MASK   0xFFFFFFFFFFFFFFFF
 
#define FORCE_DEL   1 /* Delete static BIB entries as well */
 
#define NAT64_UDP_DEFAULT   300 /* 5 min */
 
#define NAT64_UDP_MIN   120 /* 2 min */
 
#define NAT64_TCP_TRANS   240 /* 4 min */
 
#define NAT64_TCP_EST   7200 /* 2 hrs */
 
#define NAT64_TCP_V4_SYN   6 /* 6 sec */
 
#define NAT64_FRAG_MIN   2 /* 2 sec */
 
#define NAT64_ICMP_DEFAULT   60 /* 1 min */
 
#define NAT64_V6_GET_HASH(in_key, hash, mask)
 
#define NAT64_V4_GET_HASH(in_key, hash, mask)
 
#define NAT64_V6_GET_SESSION_HASH(bib_index, in_addr, port, vrf, hash, mask)
 
#define NAT64_V4_GET_SESSION_HASH(bib_index, in_addr, port, vrf, hash, mask)
 
#define NAT64_DB_FLAG_STATIC_PORT   CNAT_DB_FLAG_STATIC_PORT
 
#define NAT64_DB_NAT64_FLAG   CNAT_DB_NAT64_FLAG
 
#define NAT64_DB_FLAG_ALG_ENTRY   CNAT_DB_FLAG_ALG_ENTRY
 
#define NAT64_DB_FLAG_PCPI   CNAT_DB_FLAG_PCPI
 
#define NAT64_DB_FLAG_PCPE   CNAT_DB_FLAG_PCPE
 
#define NAT64_USER_DB_NAT64_FLAG   CNAT_USER_DB_NAT64_FLAG
 
#define NAT64_CMP_V6_KEY(key1, key2)   memcmp(key1, key2, sizeof(nat64_v6_key_t))
 
#define NAT64_CMP_V4_KEY(key1, key2)   memcmp(key1, key2, sizeof(nat64_v4_key_t))
 
#define NAT64_CMP_V6_IP(ip1, ip2)   memcmp(ip1, ip2, (sizeof(u32) * 4))
 
#define NAT64_CMP_V6_KEY1(key1, key2)
 
#define NAT64_CMP_V6_IP1(ip1, ip2)
 
#define NAT64_CMP_V4_KEY1(key1, key2)   (key1.key64 == key2.key64)
 

Functions

void nat64_bib_user_db_delete (nat64_bib_user_entry_t *up)
 
nat64_bib_user_entry_tnat64_bib_user_db_create_entry (nat64_v6_key_t *uki, u32 bucket, u32 portmap_index)
 
nat64_bib_user_entry_tnat64_bib_user_db_lookup_entry (nat64_v6_key_t *uki, u32 *bucket)
 
nat64_bib_entry_tnat64_bib_db_lookup_entry (nat64_v6_key_t *ki)
 
void nat64_bib_db_in2out_hash_delete (nat64_bib_entry_t *ep)
 
void nat64_bib_db_out2in_hash_delete (nat64_bib_entry_t *ep)
 
nat64_bib_entry_tnat64_create_bib_db_entry_and_hash (nat64_v6_key_t *ki, nat64_v4_key_t *ko, nat64_bib_user_entry_t *udb)
 
void nat64_delete_bib_db_entry (nat64_bib_entry_t *ep, u8 force)
 
nat64_bib_entry_tnat64_bib_db_lookup_entry_out2in (nat64_v4_key_t *ko)
 
nat64_bib_entry_tnat64_get_bib_db_entry (nat64_v6_key_t *ki, port_pair_t port_pair_type, port_type_t port_type, cnat_gen_icmp_info *info)
 
nat64_bib_entry_tnat64_create_static_bib_db_entry (nat64_v6_key_t *ki, nat64_v4_key_t *ko, nat64_table_entry_t *my_table, cnat_gen_icmp_info *info)
 
void nat64_session_db_out2in_hash_delete (nat64_session_entry_t *ep)
 
nat64_session_entry_tnat64_session_db_lookup_entry_out2in (nat64_v4_key_t *ko, u32 bib_index)
 
nat64_session_entry_tnat64_create_session_db_entry_v2 (nat64_v4_key_t *ko, nat64_bib_entry_t *bdb)
 
void nat64_delete_session_db_entry_v2 (nat64_session_entry_t *ep, u8 force)
 
u32 nat64_timeout_db_hash_lookup (nat64_v4_key_t t_key)
 
u16 query_and_update_db_timeout_nat64 (nat64_session_entry_t *db)
 
void nat64_timeout_db_hash_add (nat64_timeout_db_entry_t *t_entry)
 
u16 nat64_timeout_db_create (nat64_timeout_t t_entry)
 
void nat64_timeout_db_delete (nat64_v4_key_t t_key)
 

Variables

nat64_vrfmap_tnat64_map_by_vrf
 
index_slist_tnat64_bib_out2in_hash
 
index_slist_tnat64_bib_in2out_hash
 
index_slist_tnat64_bib_user_hash
 
index_slist_tnat64_session_out2in_hash
 
index_slist_tnat64_frag_out2in_hash
 
index_slist_tnat64_frag_in2out_hash
 
index_slist_tnat64_timeout_hash
 
index_slist_tnat64_session_in2out_hash
 
nat64_bib_entry_tnat64_bib_db
 
nat64_bib_user_entry_tnat64_bib_user_db
 
nat64_session_entry_tnat64_session_db
 
nat64_in_v6_frag_entry_tnat64_in_frag_db
 
nat64_out_v4_frag_entry_tnat64_out_frag_db
 
nat64_session_tcp_init_entry_tnat64_tcp_init_db
 
nat64_timeout_db_entry_tnat64_timeout_db
 
nat64_table_entry_t nat64_table_array [NAT64_MAX_NAT64_ENTRIES]
 
nat64_table_entry_tnat64_table_ptr
 
cgse_nat_db_entry_tcgse_nat_db
 
cgse_nat_user_db_entry_tcgse_user_db
 
cgse_nat_session_db_entry_tcgse_session_db
 
u8 nat64_timeout_dirty_flag [NAT64_MAX_NAT64_ENTRIES]
 

Macro Definition Documentation

#define FORCE_DEL   1 /* Delete static BIB entries as well */

Definition at line 63 of file nat64_db.h.

#define HASH_ENHANCE   4

Definition at line 33 of file nat64_db.h.

#define NAT64_CMP_V4_KEY (   key1,
  key2 
)    memcmp(key1, key2, sizeof(nat64_v4_key_t))

Definition at line 456 of file nat64_db.h.

#define NAT64_CMP_V4_KEY1 (   key1,
  key2 
)    (key1.key64 == key2.key64)

Definition at line 474 of file nat64_db.h.

#define NAT64_CMP_V6_IP (   ip1,
  ip2 
)    memcmp(ip1, ip2, (sizeof(u32) * 4))

Definition at line 460 of file nat64_db.h.

#define NAT64_CMP_V6_IP1 (   ip1,
  ip2 
)
Value:
((ip1[0] == ip2[0]) && (ip1[1] == ip2[1]) && \
(ip1[2] == ip2[2]) && (ip1[3] == ip2[3]))

Definition at line 470 of file nat64_db.h.

#define NAT64_CMP_V6_KEY (   key1,
  key2 
)    memcmp(key1, key2, sizeof(nat64_v6_key_t))

Definition at line 453 of file nat64_db.h.

#define NAT64_CMP_V6_KEY1 (   key1,
  key2 
)
Value:
(key1.ipv6[0] == key2.ipv6[0]) && (key1.ipv6[1] == key2.ipv6[1]) && \
(key1.ipv6[2] == key2.ipv6[2]) && (key1.ipv6[3] == key2.ipv6[3]) && \
(key1.port == key2.port) && (key1.vrf == key2.vrf)

Definition at line 464 of file nat64_db.h.

#define NAT64_DB_FLAG_ALG_ENTRY   CNAT_DB_FLAG_ALG_ENTRY

Definition at line 137 of file nat64_db.h.

#define NAT64_DB_FLAG_PCPE   CNAT_DB_FLAG_PCPE

Definition at line 139 of file nat64_db.h.

#define NAT64_DB_FLAG_PCPI   CNAT_DB_FLAG_PCPI

Definition at line 138 of file nat64_db.h.

#define NAT64_DB_FLAG_STATIC_PORT   CNAT_DB_FLAG_STATIC_PORT

Definition at line 135 of file nat64_db.h.

#define NAT64_DB_NAT64_FLAG   CNAT_DB_NAT64_FLAG

Definition at line 136 of file nat64_db.h.

#define NAT64_FRAG_MIN   2 /* 2 sec */

Definition at line 71 of file nat64_db.h.

#define NAT64_ICMP_DEFAULT   60 /* 1 min */

Definition at line 72 of file nat64_db.h.

#define NAT64_MAIN_DB_SIZE   (PLATFORM_NAT64_MAX_SESSIONS / PLATFORM_CNAT_INSTS)

Definition at line 36 of file nat64_db.h.

#define NAT64_MAIN_HASH_MASK   (NAT64_MAIN_HASH_SIZE-1)

Definition at line 41 of file nat64_db.h.

#define NAT64_MAIN_HASH_SIZE   (HASH_ENHANCE * PLATFORM_CNAT_MAIN_PRELIM_HASH_SIZE)

Definition at line 38 of file nat64_db.h.

#define NAT64_MAX_SESSIONS_PER_BIB   0xFFFF

Definition at line 52 of file nat64_db.h.

#define NAT64_TCP_EST   7200 /* 2 hrs */

Definition at line 69 of file nat64_db.h.

#define NAT64_TCP_TRANS   240 /* 4 min */

Definition at line 68 of file nat64_db.h.

#define NAT64_TCP_V4_SYN   6 /* 6 sec */

Definition at line 70 of file nat64_db.h.

#define NAT64_TIMEOUT_FULL_MASK   0xFFFFFFFFFFFFFFFF

Definition at line 60 of file nat64_db.h.

#define NAT64_TIMEOUT_HASH_MASK   (NAT64_TIMEOUT_HASH_SIZE - 1)

Definition at line 59 of file nat64_db.h.

#define NAT64_TIMEOUT_HASH_SIZE   PLATFORM_NAT64_TIMEOUT_HASH_SIZE

Definition at line 56 of file nat64_db.h.

#define NAT64_UDP_DEFAULT   300 /* 5 min */

Definition at line 66 of file nat64_db.h.

#define NAT64_UDP_MIN   120 /* 2 min */

Definition at line 67 of file nat64_db.h.

#define NAT64_USER_DB_NAT64_FLAG   CNAT_USER_DB_NAT64_FLAG

Definition at line 198 of file nat64_db.h.

#define NAT64_USER_HASH_MASK   (NAT64_USER_HASH_SIZE-1)

Definition at line 46 of file nat64_db.h.

#define NAT64_USER_HASH_SIZE   CNAT_USER_HASH_SIZE

Definition at line 45 of file nat64_db.h.

#define NAT64_V4_GET_HASH (   in_key,
  hash,
  mask 
)
Value:
a = in_key.ipv4 ^ ((in_key.port << 16) | in_key.vrf); \
b = c = 0x9e3779b9; \
/* Jenkins hash, arbitrarily use c as the "answer" */ \
hash_mix32(a, b, c); \
hash = c & mask;
a
Definition: bitmap.h:516
svmdb_client_t * c
#define hash_mix32(a0, b0, c0)
Definition: hash.h:515

Definition at line 84 of file nat64_db.h.

#define NAT64_V4_GET_SESSION_HASH (   bib_index,
  in_addr,
  port,
  vrf,
  hash,
  mask 
)
Value:
a = bib_index ^ in_addr ^ port ^ vrf; \
b = c = 0x9e3779b9; \
/* Jenkins hash, arbitrarily use c as the "answer" */ \
hash_mix32(a, b, c); \
hash = c & mask;
a
Definition: bitmap.h:516
svmdb_client_t * c
#define hash_mix32(a0, b0, c0)
Definition: hash.h:515

Definition at line 101 of file nat64_db.h.

#define NAT64_V6_GET_HASH (   in_key,
  hash,
  mask 
)
Value:
a = in_key->ipv6[0] ^ in_key->ipv6[1] ^ in_key->ipv6[2] ^ in_key->ipv6[3] \
^ ((in_key->port << 16) | in_key->vrf); \
b = c = 0x9e3779b9;\
/* Jenkins hash, arbitrarily use c as the "answer" */ \
hash_mix32(a, b, c); \
hash = c & mask; \
a
Definition: bitmap.h:516
svmdb_client_t * c
#define hash_mix32(a0, b0, c0)
Definition: hash.h:515

Definition at line 75 of file nat64_db.h.

#define NAT64_V6_GET_SESSION_HASH (   bib_index,
  in_addr,
  port,
  vrf,
  hash,
  mask 
)
Value:
a = bib_index ^ in_addr[0] ^ in_addr[1] ^ in_addr[2] ^ in_addr[3] \
^ port ^ vrf; \
b = c = 0x9e3779b9; \
/* Jenkins hash, arbitrarily use c as the "answer" */ \
hash_mix32(a, b, c); \
hash = c & mask;
a
Definition: bitmap.h:516
svmdb_client_t * c
#define hash_mix32(a0, b0, c0)
Definition: hash.h:515

Definition at line 93 of file nat64_db.h.

#define SESSION_OPT

Definition at line 31 of file nat64_db.h.

Function Documentation

void nat64_bib_db_in2out_hash_delete ( nat64_bib_entry_t ep)
nat64_bib_entry_t* nat64_bib_db_lookup_entry ( nat64_v6_key_t ki)
nat64_bib_entry_t* nat64_bib_db_lookup_entry_out2in ( nat64_v4_key_t ko)
void nat64_bib_db_out2in_hash_delete ( nat64_bib_entry_t ep)
nat64_bib_user_entry_t* nat64_bib_user_db_create_entry ( nat64_v6_key_t uki,
u32  bucket,
u32  portmap_index 
)
void nat64_bib_user_db_delete ( nat64_bib_user_entry_t up)
nat64_bib_user_entry_t* nat64_bib_user_db_lookup_entry ( nat64_v6_key_t uki,
u32 bucket 
)
nat64_bib_entry_t* nat64_create_bib_db_entry_and_hash ( nat64_v6_key_t ki,
nat64_v4_key_t ko,
nat64_bib_user_entry_t udb 
)
nat64_session_entry_t* nat64_create_session_db_entry_v2 ( nat64_v4_key_t ko,
nat64_bib_entry_t bdb 
)
nat64_bib_entry_t* nat64_create_static_bib_db_entry ( nat64_v6_key_t ki,
nat64_v4_key_t ko,
nat64_table_entry_t my_table,
cnat_gen_icmp_info info 
)
void nat64_delete_bib_db_entry ( nat64_bib_entry_t ep,
u8  force 
)
void nat64_delete_session_db_entry_v2 ( nat64_session_entry_t ep,
u8  force 
)
nat64_bib_entry_t* nat64_get_bib_db_entry ( nat64_v6_key_t ki,
port_pair_t  port_pair_type,
port_type_t  port_type,
cnat_gen_icmp_info info 
)
nat64_session_entry_t* nat64_session_db_lookup_entry_out2in ( nat64_v4_key_t ko,
u32  bib_index 
)
void nat64_session_db_out2in_hash_delete ( nat64_session_entry_t ep)
u16 nat64_timeout_db_create ( nat64_timeout_t  t_entry)
void nat64_timeout_db_delete ( nat64_v4_key_t  t_key)
void nat64_timeout_db_hash_add ( nat64_timeout_db_entry_t t_entry)
u32 nat64_timeout_db_hash_lookup ( nat64_v4_key_t  t_key)
u16 query_and_update_db_timeout_nat64 ( nat64_session_entry_t db)

Variable Documentation

cgse_nat_db_entry_t* cgse_nat_db

Definition at line 206 of file cnat_db_v2.c.

cgse_nat_session_db_entry_t* cgse_session_db

Definition at line 208 of file cnat_db_v2.c.

cgse_nat_user_db_entry_t* cgse_user_db

Definition at line 207 of file cnat_db_v2.c.

nat64_bib_entry_t* nat64_bib_db
index_slist_t * nat64_bib_in2out_hash

Definition at line 353 of file nat64_db.h.

index_slist_t * nat64_bib_out2in_hash

Definition at line 352 of file nat64_db.h.

nat64_bib_user_entry_t* nat64_bib_user_db
index_slist_t * nat64_bib_user_hash

Definition at line 354 of file nat64_db.h.

index_slist_t * nat64_frag_in2out_hash

Definition at line 358 of file nat64_db.h.

index_slist_t * nat64_frag_out2in_hash

Definition at line 357 of file nat64_db.h.

nat64_in_v6_frag_entry_t* nat64_in_frag_db
nat64_vrfmap_t* nat64_map_by_vrf

Definition at line 29 of file nat64_db.h.

nat64_out_v4_frag_entry_t* nat64_out_frag_db
nat64_session_entry_t* nat64_session_db
index_slist_t* nat64_session_in2out_hash
index_slist_t * nat64_session_out2in_hash

Definition at line 355 of file nat64_db.h.

nat64_table_entry_t* nat64_table_ptr
nat64_session_tcp_init_entry_t* nat64_tcp_init_db
nat64_timeout_db_entry_t* nat64_timeout_db
u8 nat64_timeout_dirty_flag[NAT64_MAX_NAT64_ENTRIES]
index_slist_t * nat64_timeout_hash

Definition at line 359 of file nat64_db.h.