FD.io VPP  v16.06
Vector Packet Processing
dslite_db.h File Reference
+ Include dependency graph for dslite_db.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DSLITE_PRINTF(level, ...)   if (dslite_debug_level > level) PLATFORM_DEBUG_PRINT(__VA_ARGS__);
 
#define HASH_ENHANCE   4
 
#define DSLITE_MAIN_DB_SIZE   (20000000 / PLATFORM_CNAT_INSTS)
 
#define DSLITE_MAIN_HASH_SIZE   (HASH_ENHANCE * PLATFORM_CNAT_MAIN_PRELIM_HASH_SIZE)
 
#define DSLITE_MAIN_HASH_MASK   (DSLITE_MAIN_HASH_SIZE-1)
 
#define DSLITE_USER_HASH_SIZE   CNAT_USER_HASH_SIZE
 
#define DSLITE_USER_HASH_MASK   (DSLITE_USER_HASH_SIZE-1)
 
#define DSLITE_TIMEOUT_HASH_SIZE   1000
 
#define DSLITE_TIMEOUT_HASH_MASK   (DSLITE_TIMEOUT_HASH_SIZE - 1)
 
#define DSLITE_TIMEOUT_FULL_MASK   0xFFFFFFFFFFFFFFFF
 
#define CNAT_MAX_SESSIONS_PER_BIB   0xFFFF
 
#define FORCE_DEL   1 /* Delete static BIB entries as well */
 
#define DSLITE_UDP_DEFAULT   300 /* 5 min */
 
#define DSLITE_UDP_MIN   120 /* 2 min */
 
#define DSLITE_TCP_TRANS   240 /* 4 min */
 
#define DSLITE_TCP_EST   7200 /* 2 hrs */
 
#define DSLITE_TCP_V4_SYN   6 /* 6 sec */
 
#define DSLITE_FRAG_MIN   2 /* 2 sec */
 
#define DSLITE_ICMP_DEFAULT   60 /* 1 min */
 
#define DSLITE_V6_GET_HASH(in_key, hash, mask)
 
#define DSLITE_V6_GET_USER_HASH(ipv6, hash, mask)
 
#define DSLITE_V4_GET_HASH(in_key, hash, mask)
 
#define PRIVATE_V4_ADDR_CHECK(addr, invalid)
 
#define V4_MAPPED_V6_CHECK(v6_addr, invalid)
 
#define DSLITE_CMP_V6_KEY(key1, key2)   memcmp(key1, key2, sizeof(dslite_v6_key_t))
 
#define DSLITE_CMP_V4_KEY(key1, key2)   memcmp(key1, key2, sizeof(dslite_v4_key_t))
 
#define DSLITE_CMP_V6_IP(ip1, ip2)   memcmp(ip1, ip2, (sizeof(u32) * 4))
 
#define DSLITE_CMP_V6_KEY1(key1, key2)
 
#define DSLITE_CMP_V6_IP1(ip1, ip2)
 
#define DSLITE_CMP_V4_KEY1(key1, key2)   (key1.key64 == key2.key64)
 

Functions

cnat_main_db_entry_tdslite_get_main_db_entry_v2 (dslite_db_key_bucket_t *ki, port_pair_t port_pair_type, port_type_t port_type, cnat_gen_icmp_info *info, dslite_table_entry_t *dslite_entry_ptr, cnat_key_t *dest_info)
 
cnat_main_db_entry_tdslite_main_db_lookup_entry (dslite_db_key_bucket_t *ki)
 
cnat_user_db_entry_tdslite_user_db_lookup_entry (dslite_db_key_bucket_t *uki)
 
cnat_user_db_entry_tdslite_user_db_create_entry (dslite_db_key_bucket_t *uki, u32 portmap_index)
 
cnat_main_db_entry_tdslite_create_main_db_entry_and_hash (dslite_db_key_bucket_t *ki, cnat_db_key_bucket_t *ko, cnat_user_db_entry_t *udb)
 

Variables

u32 dslite_translation_create_count
 
u32 dslite_translation_delete_count
 
u32 dslite_translation_create_rate
 
u32 dslite_translation_delete_rate
 
u32 dslite_in2out_forwarding_count
 
u32 dslite_in2out_forwarding_rate
 
u32 dslite_out2in_forwarding_count
 
u32 dslite_out2in_forwarding_rate
 
dslite_table_entry_t dslite_table_array [DSLITE_MAX_DSLITE_ENTRIES]
 
dslite_table_entry_tdslite_table_ptr
 

Macro Definition Documentation

#define CNAT_MAX_SESSIONS_PER_BIB   0xFFFF

Definition at line 55 of file dslite_db.h.

#define DSLITE_CMP_V4_KEY (   key1,
  key2 
)    memcmp(key1, key2, sizeof(dslite_v4_key_t))

Definition at line 126 of file dslite_db.h.

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

Definition at line 144 of file dslite_db.h.

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

Definition at line 130 of file dslite_db.h.

#define DSLITE_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 140 of file dslite_db.h.

#define DSLITE_CMP_V6_KEY (   key1,
  key2 
)    memcmp(key1, key2, sizeof(dslite_v6_key_t))

Definition at line 123 of file dslite_db.h.

#define DSLITE_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 134 of file dslite_db.h.

#define DSLITE_FRAG_MIN   2 /* 2 sec */

Definition at line 65 of file dslite_db.h.

#define DSLITE_ICMP_DEFAULT   60 /* 1 min */

Definition at line 66 of file dslite_db.h.

#define DSLITE_MAIN_DB_SIZE   (20000000 / PLATFORM_CNAT_INSTS)

Definition at line 39 of file dslite_db.h.

#define DSLITE_MAIN_HASH_MASK   (DSLITE_MAIN_HASH_SIZE-1)

Definition at line 43 of file dslite_db.h.

#define DSLITE_MAIN_HASH_SIZE   (HASH_ENHANCE * PLATFORM_CNAT_MAIN_PRELIM_HASH_SIZE)

Definition at line 40 of file dslite_db.h.

#define DSLITE_PRINTF (   level,
  ... 
)    if (dslite_debug_level > level) PLATFORM_DEBUG_PRINT(__VA_ARGS__);

Definition at line 28 of file dslite_db.h.

#define DSLITE_TCP_EST   7200 /* 2 hrs */

Definition at line 63 of file dslite_db.h.

#define DSLITE_TCP_TRANS   240 /* 4 min */

Definition at line 62 of file dslite_db.h.

#define DSLITE_TCP_V4_SYN   6 /* 6 sec */

Definition at line 64 of file dslite_db.h.

#define DSLITE_TIMEOUT_FULL_MASK   0xFFFFFFFFFFFFFFFF

Definition at line 53 of file dslite_db.h.

#define DSLITE_TIMEOUT_HASH_MASK   (DSLITE_TIMEOUT_HASH_SIZE - 1)

Definition at line 52 of file dslite_db.h.

#define DSLITE_TIMEOUT_HASH_SIZE   1000

Definition at line 51 of file dslite_db.h.

#define DSLITE_UDP_DEFAULT   300 /* 5 min */

Definition at line 60 of file dslite_db.h.

#define DSLITE_UDP_MIN   120 /* 2 min */

Definition at line 61 of file dslite_db.h.

#define DSLITE_USER_HASH_MASK   (DSLITE_USER_HASH_SIZE-1)

Definition at line 48 of file dslite_db.h.

#define DSLITE_USER_HASH_SIZE   CNAT_USER_HASH_SIZE

Definition at line 47 of file dslite_db.h.

#define DSLITE_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:393
#define hash_mix32(a0, b0, c0)
Definition: hash.h:474

Definition at line 95 of file dslite_db.h.

#define DSLITE_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->ipv4_key.k.ipv4 ^ ((in_key->ipv4_key.k.port << 16) | in_key->ipv4_key.k.vrf); \
DSLITE_PRINTF(1, "%x:%x:%x:%x:%x:%x:%x\n", in_key->ipv6[0], in_key->ipv6[1], in_key->ipv6[2], in_key->ipv6[3], \
in_key->ipv4_key.k.ipv4, in_key->ipv4_key.k.port, in_key->ipv4_key.k.vrf); \
b = c = 0x9e3779b9;\
/* Jenkins hash, arbitrarily use c as the "answer" */ \
hash_mix32(a, b, c); \
hash = c & mask; \
#define DSLITE_PRINTF(level,...)
Definition: dslite_db.h:28
a
Definition: bitmap.h:393
#define hash_mix32(a0, b0, c0)
Definition: hash.h:474

Definition at line 77 of file dslite_db.h.

#define DSLITE_V6_GET_USER_HASH (   ipv6,
  hash,
  mask 
)
Value:
a = ipv6[0] ^ ipv6[1] ^ ipv6[2] ^ ipv6[3]; \
b = c = 0x9e3779b9;\
/* Jenkins hash, arbitrarily use c as the "answer" */ \
hash_mix32(a, b, c); \
hash = c & mask; \
a
Definition: bitmap.h:393
#define hash_mix32(a0, b0, c0)
Definition: hash.h:474

Definition at line 88 of file dslite_db.h.

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

Definition at line 57 of file dslite_db.h.

#define HASH_ENHANCE   4

Definition at line 37 of file dslite_db.h.

#define PRIVATE_V4_ADDR_CHECK (   addr,
  invalid 
)
Value:
invalid = 0; \
int range1 = ((addr & 0xFF000000) >> 24); \
int range2 = ((addr & 0xFFF00000) >> 20); \
int range3 = ((addr & 0xFFFF0000) >> 16); \
int range4 = ((addr & 0xFFFFFFF8) >> 3); \
if(range1 != 0xa && range2 != 0xac1 && range3 != 0xc0a8 && range4 != 0x18000000) \
invalid = 1;
vhost_vring_addr_t addr
Definition: vhost-user.h:78

Definition at line 102 of file dslite_db.h.

#define V4_MAPPED_V6_CHECK (   v6_addr,
  invalid 
)
Value:
invalid = 0; \
int word1 = v6_addr[0]; \
int word2 = v6_addr[1]; \
int word3 = v6_addr[2]; \
if(!((word1 == 0) && (word2 == 0) && (word3 == 0x0000FFFF))) \
invalid = 1;

Definition at line 111 of file dslite_db.h.

Function Documentation

cnat_main_db_entry_t* dslite_create_main_db_entry_and_hash ( dslite_db_key_bucket_t ki,
cnat_db_key_bucket_t ko,
cnat_user_db_entry_t udb 
)

Definition at line 2930 of file cnat_db_v2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

cnat_main_db_entry_t* dslite_get_main_db_entry_v2 ( dslite_db_key_bucket_t ki,
port_pair_t  port_pair_type,
port_type_t  port_type,
cnat_gen_icmp_info info,
dslite_table_entry_t dslite_entry_ptr,
cnat_key_t dest_info 
)

Definition at line 3047 of file cnat_db_v2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

cnat_main_db_entry_t* dslite_main_db_lookup_entry ( dslite_db_key_bucket_t ki)

Definition at line 2821 of file cnat_db_v2.c.

+ Here is the caller graph for this function:

cnat_user_db_entry_t* dslite_user_db_create_entry ( dslite_db_key_bucket_t uki,
u32  portmap_index 
)

Definition at line 2897 of file cnat_db_v2.c.

+ Here is the caller graph for this function:

cnat_user_db_entry_t* dslite_user_db_lookup_entry ( dslite_db_key_bucket_t uki)

Definition at line 2863 of file cnat_db_v2.c.

+ Here is the caller graph for this function:

Variable Documentation

u32 dslite_in2out_forwarding_count
u32 dslite_in2out_forwarding_rate
u32 dslite_out2in_forwarding_count
u32 dslite_out2in_forwarding_rate
dslite_table_entry_t* dslite_table_ptr
u32 dslite_translation_create_count
u32 dslite_translation_create_rate
u32 dslite_translation_delete_count
u32 dslite_translation_delete_rate