FD.io VPP  v16.12-rc0-308-g931be3a
Vector Packet Processing
cnat_db.h
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * cnat_db.h - translation database definitions
4  *
5  * Copyright (c) 2007-2013 Cisco and/or its affiliates.
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *------------------------------------------------------------------
18  */
19 
20 #ifndef __CNAT_DB_H__
21 #define __CNAT_DB_H__
22 
23 #include "cnat_cli.h"
24 #include "cnat_ports.h"
25 #include "index_list.h"
26 
27 #define VRF_NAME_LEN_STORED 12
28 #define MAX_VRFID 400
29 typedef struct _cnat_svi_params_entry {
30  u16 svi_type;
31  u16 pad;
32 
33  u32 vrf_id;
34  u16 if_num;
35 
36  u32 ipv6_addr[4];
37  u32 ipv4_addr;
38 
39  u8 direction;
40  u32 tbl_id; /* vrf */
41  u32 vrf_override_id; /* tbl_id for override vrf */
42  u8 vrf_override_flag;
43  u8 partition_id;
45 
46 typedef struct _cnat_ingress_vrfid_name_entry {
47  u32 vrf_id;
48  u16 ref_count; /*no# of serviceApps under a single vrf*/
49  u8 vrf_name[VRF_NAME_LEN_STORED];
50  u16 pad1;
52 #define HASH_ENHANCE 4
53 
54 #define CNAT_DB_SIZE (PLATFORM_MAX_NAT_ENTRIES / PLATFORM_CNAT_INSTS)
55 #define CNAT_MAIN_HASH_SIZE (HASH_ENHANCE * PLATFORM_CNAT_MAIN_PRELIM_HASH_SIZE)
56 #define CNAT_MAIN_HASH_MASK (CNAT_MAIN_HASH_SIZE-1)
57 
58 #define CNAT_USER_DB_SIZE (PLATFORM_MAX_USER_ENTRIES / PLATFORM_CNAT_INSTS)
59 #define CNAT_USER_HASH_SIZE (HASH_ENHANCE * PLATFORM_CNAT_USER_PRELIM_HASH_SIZE)
60 #define CNAT_USER_HASH_MASK (CNAT_USER_HASH_SIZE-1)
61 
62 #define CNAT_SESSION_DB_SIZE (PLATFORM_MAX_NAT_ENTRIES / PLATFORM_CNAT_INSTS)
63 #define CNAT_SESSION_HASH_SIZE (HASH_ENHANCE * PLATFORM_CNAT_MAIN_PRELIM_HASH_SIZE)
64 #define CNAT_SESSION_HASH_MASK (CNAT_SESSION_HASH_SIZE-1)
65 
66 
67 #define CNAT_MAX_SESSIONS_PER_BIB 0xFFFF
68 
69 #define NUM_BITS_IN_UWORD (8*sizeof(uword))
70 
71 /* No. of per ip/port config will be limited to 1024 */
72 #define CNAT_TIMEOUT_HASH_SIZE 1024
73 #define CNAT_TIMEOUT_HASH_MASK (CNAT_TIMEOUT_HASH_SIZE - 1)
74 #define CNAT_TIMEOUT_FULL_MASK 0xFFFFFFFFFFFFFFFF
75 #define CNAT_TIMEOUT_IPPROT_MASK PLATFORM_CNAT_TIMEOUT_IPPROT_MASK
76 #define CNAT_TIMEOUT_PORTPROT_MASK PLATFORM_CNAT_TIMEOUT_PORTPROT_MASK
77 
78 #define TRUE 1
79 #define FALSE 0
80 
81 /*
82  * The key structure. All fields are in NETWORK byte order!
83  */
84 typedef struct {
87  u16 vrf; //bit0-12:vrf, bit13:unused, bit14-15:protocol
89 
90 /* bit14-15:protocol in cnat_db_key_t */
91 #define CNAT_INVALID_PROTO 0x0000
92 #define CNAT_PPTP 0x0000
93 #define CNAT_UDP 0x4000
94 #define CNAT_TCP 0x8000
95 #define CNAT_ICMP 0xc000
96 #define CNAT_VRF_MASK 0x3fff
97 #define CNAT_PRO_MASK 0xc000
98 #define CNAT_PRO_SHIFT 14
99 
100 /*
101  * Maximum number of VRF entries supported
102  */
103 #define CNAT_MAX_VRFMAP_ENTRIES (CNAT_VRF_MASK + 1)
104 /*
105  * for hashing purposes, fetch the key in one instr.
106  */
107 typedef union {
110 } cnat_key_t;
111 
112 typedef struct {
116 
117 typedef struct {
118  u32 ipv6[4];
120 } dslite_key_t;
121 
122 typedef struct {
123 /*
124  cnat_db_key_bucket_t ck;
125  u32 ipv6[4];
126 */
130 
131 
132 /* Per port/ip timeout related strucutres */
134 
135 typedef struct {
139 
140 typedef struct {
144 
146 
147 /*
148  * Main translation database entries. Currently 0x5A = 90 bytes in length.
149  * Given 20,000,000 entries, it saves nearly 1gb of SDRAM to pack the entries
150  * and pay the extra prefetch. So, that's what we do.
151  */
152 
153 typedef struct {
154  /* 0x00 */
155  index_slist_t out2in_hash; /* hash-and-chain, x2 */
157 
158  /* 0x08 */
159  u16 flags; /* Always need flags... */
160 #define CNAT_DB_FLAG_PORT_PAIR (1<<0)
161 #define CNAT_DB_FLAG_TCP_ACTIVE (1<<1)
162 #define CNAT_DB_FLAG_ENTRY_FREE (1<<2)
163 #define CNAT_DB_FLAG_UDP_ACTIVE (1<<3)
164 #define CNAT_DB_FLAG_STATIC_PORT (1<<4)
165 /* This alg entry is set for FTP data connection */
166 #define CNAT_DB_FLAG_ALG_ENTRY (1<<5)
167 
168 /* Will be set for TCP connection with destination port - 1723
169  * note - here CNAT_DB_FLAG_TCP_ACTIVE is also set */
170 #define CNAT_DB_FLAG_PPTP_TUNNEL_INIT (1<<6)
171 #define CNAT_DB_FLAG_PPTP_TUNNEL_ACTIVE (1<<7)
172 
173 /* for PPTP GRE packtes */
174 #define CNAT_DB_FLAG_PPTP_GRE_ENTRY (1<<8)
175 
176 /* for PCP support */
177 #define CNAT_DB_FLAG_PCPI (1<<9)
178 #define CNAT_DB_FLAG_PCPE (1<<10)
179 #define CNAT_PCP_FLAG (CNAT_DB_FLAG_PCPI | CNAT_DB_FLAG_PCPE)
180 
181 #define CNAT_TAC_SEQ_MISMATCH (1<<11)
182 /* This alg entry is set for ftp control connection */
183 #define CNAT_DB_FLAG_ALG_CTRL_FLOW (1<<12)
184 
185 /* This is for marking the state where connection is closing */
186 #define CNAT_DB_FLAG_TCP_CLOSING (1<<13)
187 
188 #define CNAT_DB_DSLITE_FLAG (1<<14)
189 #define CNAT_DB_NAT64_FLAG (1<<15)
190 
191  /* 0x0A */
192  u16 vrfmap_index; /* index of vrfmap */
193 
194  /* 0x0C */
195  u32 user_index; /* index of user that owns this entry */
196 
197  /* 0x10 */
198  cnat_key_t out2in_key; /* network-to-user, outside-to-inside key */
199 
200  /* 0x18 */
201  cnat_key_t in2out_key; /* user-to-network, inside-to-outside key */
202 
203  /* 0x20 */
204  index_dlist_t user_ports; /* per-user translation list */
205 
206  /* 0x28 */
207  u32 out2in_pkts; /* pkt counters */
208 
209  /* 0x2C */
211 
212  /* 0x30 */
213  u32 entry_expires; /* timestamp used to expire translations */
214 
215  /* 0x34 */
216  union { /* used by FTP ALG, pkt len delta due to FTP PORT cmd */
218  i8 alg_dlt[2]; /* two delta values, 0 for previous, 1 for current */
219  u16 il; /* Used to indicate if interleaved mode is used
220  in case of RTSP ALG */
221  } alg;
222 
223  /* 0x36 */
225 
226  /* 0x38 */
227  union {
228  struct seq_pcp_t {
229  u32 tcp_seq_num; /* last tcp (FTP) seq # that has pkt len change due to PORT */
230  u32 pcp_lifetime; /* peer and map life time value sent in reply*/
231  } seq_pcp;
232 
233  /* This is for TCP seq check */
234  struct tcp_seq_chk_t {
237  } tcp_seq_chk;
238 
239  /* used for pptp alg entries
240  1. only tunnel : prev and next = 0xFFFFFFFF
241  2. first gre entry : prev = tunnel db, next = next gre db
242  3. last gre entry : prev = previous gre/tunnel db, next= 0xFFFFFFFF;
243 
244  *while adding gre entry- updated at the begining of head
245  *while deleting gre entry - hash look up will be done and prev and next are adjusted
246  * while deleting need not traverse throufgh the list, as done in index_dlist_remelem
247 
248  */
250 
251  } proto_data;
252 
253  /* 0x40 */
254  u32 dst_ipv4; /* pointer to ipv4 dst list, used in evil mode */
255 
256  /* 0x44 */
258 
259  /* 0x46 */
261 
262  /* 0x48 */
264 
265  /* 0x4C */
267 
268  /* 0x4E */
270 
271  /* 0x4F */
273 
274  /* 0x50 */
276 
277  /* Sizeof cnat_main_db_entry_t = 0x54 */
279 
280 /* Caution ...
281  * 1. The size of this structure should be same as that of
282  * nat64_bib_user_entry_t
283  * 2. Do not alter the position of first four fields
284  */
285 typedef struct {
286  /* 0x00 */
287  index_slist_t user_hash; /* hash 'n chain bucket chain */
288 
289  /* 0x04 */
290  u16 ntranslations; /* translations hold by this user */
291 
292  /* 0x06 */
293  u8 icmp_msg_count; /* use to rate limit imcp send to this user */
294 
295  /* 0x07 */
296  u8 flags; /* To identfiy whether it is NAT64 or NAT44 etc */
297 #define CNAT_USER_DB_NAT44_FLAG 0
298 #define CNAT_USER_DB_NAT64_FLAG 1
299 #define CNAT_USER_DB_DSLITE_FLAG 2
300 #define CNAT_USER_DB_PORT_LIMIT_EXCEEDED 0X80
301 
302  /* 0x08 */
304 
305  /* 0x0C */
306  u32 portmap_index; /* index of bound port-map */
307 
308  /* 0x10 */
309  cnat_key_t key; /* For dslite this should store IPv6 address */
310  u32 ipv6[4]; // B4 ipv6 address
311  /* 0x18 */
312 #if 0
313  u32 temp1;
314  u32 temp2;
315  u32 temp3;
316 #endif
317  /* 0x28 same as nat64_user_db */
318 #ifndef NO_BULK_LOGGING
319  /* Now adding 8 more bytes for bulk allocation.. This makes it
320  * 0x30 (48). Added the same to nat64_bib_user_entry_t make the
321  * the sizes equal. For nat64 stful, we may support bulk allocation
322  * later.
323  */
324  /* Indicates the currently used bulk port range */
325  i16 bulk_port_range_cache[BULK_RANGE_CACHE_SIZE];
326 #endif /* #ifndef NO_BULK_LOGGING */
328 
329 /*
330  * cnat_session_entry_t
331  * This structure represents the cnat session table. It maintains the
332  * information about the destination of a given translation (main db)
333  * There would be entry here only if packets are send to more than 1 destn
334  * from the same source.
335  */
336 typedef struct {
337 
338  /* 0x00 */
340 
341  /* 0x04 */
342  u32 main_db_index; /* would point to v4 src transport address */
343 
344  /* 0x08 */
346 
347  /* 0x10 */
348  u16 flags; /* Same as cnat_main_db_t */
349 
350  /* 0x12 */
352 
353  /* 0x14 */
355  /* 0x18 */
357  /* 0x20 = 32 B */
358 
359  union { /* alg same as cnat_main_db_t */
361  i8 alg_dlt[2];
363  } alg;
364 
365  /* 0x22 */
367 
368  /* 0x24 */
370 
371  /* 0x28 */
373 
374  /* 0x2C */
376 
377  /* 0x30 */
379 
380  /* 0x31 */
382 
383  /* 0x32 */
385 
386 
387 
388 /*
389  * out2in and in2out hash bucket arrays are simply arrays of index_slist_t's
390  */
391 
392 typedef enum {
393  CNAT_DB_CREATE_DEFAULT=0, /* honor cnat_main_db_max_ports_per_user */
394  CNAT_DB_CREATE_OVERRIDE, /* just do it. */
396 
397 typedef struct {
400  u32 dst_ipv4; /* evil for mode only */
408 
412 
413 #define S_WAO 0
414 #define S_WA 1 /* waiting for address pool */
415 #define S_WO 2 /* waiting for outside vrf */
416 #define S_RUN 3 /* got everything */
417 #define S_DEL 4 /* just delete */
418 
419 #define INVALID_UIDX 0xffff /*invalid svi app uidb index */
420 #define INVALID_VRFID 0xffffffff /*invalid vrf id */
421 
422 typedef struct {
424  u16 tcp_mss; //tcp max segment size for this inside vrf */
426  u16 i_vrf; //inside SVI uidx
427  u16 o_vrf; //outside SVI uidx
428  u32 i_vrf_id; //inside vrf id
429  u32 o_vrf_id; //outside vrf id
434 #ifndef NO_BULK_LOGGING
436 #endif /* #ifndef NO_BULK_LOGGING */
439 
450 } cnat_vrfmap_t;
451 
452 /*
453  * When creating cnat_vrfmap entry, ensure that any already
454  * configured logging info is taken into account
455  */
456 #define CNAT_SET_VRFMAP_NFV9_LOGGING_INDEX(logging_index, i_vrf) \
457 do { \
458  cnat_nfv9_logging_info_t *my_nfv9_logging_info = 0; \
459  pool_foreach (my_nfv9_logging_info, cnat_nfv9_logging_info, ({ \
460  if (my_nfv9_logging_info->i_vrf == i_vrf) { \
461  logging_index = my_nfv9_logging_info - cnat_nfv9_logging_info; \
462  break; \
463  } \
464  })); \
465 while (0)
466 
467 
468 typedef struct {
469  /*
470  * spp_ctx_alloc() call failed
471  */
473 
474  /*
475  * Cannot send the existing logging pkt, so cannot create
476  * any additional packets for logging purposes
477  */
479 
480  /*
481  * Cannot send the existing logging pkt due to cnat_rewrite_output
482  * superframe being full.
483  */
485 
486  /*
487  * buffer for spp_ctx_alloc() call failed
488  */
490 
492 
493 
495 
499 extern u16 **cnat_portmaps_inuse;
500 
502 
503 /*
504  * Special define to indicate that the VRF map index entry is empty
505  */
506 #define VRF_MAP_ENTRY_EMPTY 0xffff
508 
511 
516 
517 typedef enum {
521 
522 typedef enum {
526 
527 typedef struct {
532 
535 
536 #define CNAT_V4_GET_HASH(key64, hash, mask) \
537  a = key64; \
538  b = c = 0x9e3779b97f4a7c13LL; \
539  /* Jenkins hash, arbitrarily use c as the "answer" */ \
540  hash_mix64(a, b, c); \
541  hash = c & mask;
542 
543 #define CNAT_V4_GET_SESSION_HASH(main_index, in_addr, port, vrf, hash, mask) \
544  a = main_index ^ in_addr ^ port ^ vrf; \
545  b = c = 0x9e3779b9; \
546  /* Jenkins hash, arbitrarily use c as the "answer" */ \
547  hash_mix32(a, b, c); \
548  hash = c & mask;
549 
550 #define CNAT_V4_GET_FRAG_HASH(key64, key32, hash, mask) \
551  a = key64; \
552  b = key32; \
553  c = 0x9e3779b97f4a7c13LL; \
554  hash_mix64(a, b, c); \
555  hash = c % mask;
556 
557 #define CNAT_DB_UPDATE_IN2OUT_TIMER \
558  db->entry_expires = cnat_current_time; \
559  db->in2out_pkts++;
560 
561 #define CNAT_DB_TIMEOUT_RST(db) \
562  if(PREDICT_TRUE(db->entry_expires != 0 )) \
563  db->entry_expires = cnat_current_time;
564 
565 #define DEBUG_I2O_DROP(debug_flag) \
566 if (debug_i_flag & debug_flag) { \
567  cnat_db_debug_i2o_drop(&ki); \
568 }
569 
570 
573 
576 
577 
580  port_pair_t port_type,
581  cnat_errno_t *error,
582  cnat_user_db_entry_t ** user_db_entry);
583 
586  port_pair_t port_pair_type,
587  port_type_t port_type,
588  cnat_gen_icmp_info *info,
589  cnat_key_t *dest_info);
590 
594  cnat_vrfmap_t *my_vrfmap,
595  cnat_gen_icmp_info *info);
596 
600  cnat_user_db_entry_t *udb);
601 
604  u32 portmap_index);
605 
608 
611 
614 
620 
621 /*
622  * Function to dump the Hash Table that maps if_num to uidb_index
623  */
624 extern void cnat_if_num_hash_table_dump(void);
625 
626 #define MAIN_DB_TYPE 0
627 #define SESSION_DB_TYPE 1
628 u16 query_and_update_db_timeout(void *db, u8 db_type);
629 
632 
635  cnat_main_db_entry_t *bdb, u8 log);
636 
638  cnat_session_entry_t *sdb);
639 
642  cnat_key_t *dest_info);
643 
646  cnat_key_t *dest_info);
647 
649  cnat_session_db_lookup_entry(cnat_key_t *ko,u32 main_db_index);
650 
653  u32 session_head_index,
654  u32 main_db_index);
655 
656 
657 typedef struct{
670 
671 typedef struct {
676 
677 typedef struct {
683 
684 #define NAT44_STATS 0
685 #define DSLITE_STATS 1
686 extern nat44_dslite_common_stats_t nat44_dslite_common_stats[255]; /* 0 is for nat44 */
687 extern nat44_dslite_global_stats_t nat44_dslite_global_stats[2]; /* 0 for nat44 and 1 for dslite */
688 extern nat44_counters_stats_t nat44_counters_stats[CNAT_MAX_VRFMAP_ENTRIES];/*For displaying show cgn <cgn-name> inside-vrf <vrf-name> counters */
689 
690 #define NAT44_COMMON_STATS nat44_dslite_common_stats[NAT44_RESERVED_INST_ID]
691 #define NAT44_GLOBAL_STATS nat44_dslite_global_stats[NAT44_STATS]
692 #define DSLITE_GLOBAL_STATS nat44_dslite_global_stats[DSLITE_STATS]
693 #define SESSION_LOG_ENABLE 1
694 #define ALG_ENABLED_DB(db) \
695  ((db->flags & CNAT_PCP_FLAG) || \
696  (db->flags & CNAT_DB_FLAG_ALG_CTRL_FLOW) || \
697  (db->flags & (CNAT_DB_FLAG_PPTP_TUNNEL_INIT | \
698  CNAT_DB_FLAG_PPTP_TUNNEL_ACTIVE)))
699 
700 
701 #endif /* __CNAT_DB_H__ */
u8 unused
Definition: cnat_db.h:269
u32 main_db_index
Definition: cnat_db.h:342
u32 diff_window
Definition: cnat_db.h:275
u16 flags
Definition: cnat_db.h:159
cnat_main_db_entry_t * cnat_main_db
Definition: cnat_db_v2.c:201
u8 pad[3]
log2 (size of the packing page block)
Definition: bihash_doc.h:61
u16 query_and_update_db_timeout(void *db, u8 db_type)
Definition: cnat_db_v2.c:2325
u32 i_vrf_id
Definition: cnat_db.h:428
cnat_session_entry_t * cnat_create_session_db_entry(cnat_key_t *ko, cnat_main_db_entry_t *bdb, u8 log)
Definition: cnat_db_v2.c:2643
u64 v4_to_v6_out2in_session_create_count
Definition: cnat_db.h:680
u64 v4_to_v6_tcp_seq_mismatch_drop_count
Definition: cnat_db.h:678
a
Definition: bitmap.h:516
u8 ignore_port
Definition: cnat_db.h:449
u32 user_index
Definition: cnat_db.h:195
u16 delta
Definition: cnat_db.h:360
u64 nfv9_logging_context_buffer_allocation_fail_count
Definition: cnat_db.h:489
u32 tcp_seq_num
Definition: cnat_db.h:369
u32 session_head_index
Definition: cnat_db.h:263
u16 tcp_flags
Definition: cnat_db.h:366
cnat_vrfmap_t * cnat_portmap_by_vrf
u64 key64
Definition: cnat_db.h:109
u32 pcp_server_addr
Definition: cnat_db.h:437
cnat_session_entry_t * cnat_session_db
Definition: cnat_db_v2.c:203
u64 v4_to_v6_end_point_filter_drop_count
Definition: cnat_db.h:681
u32 ack_no
Definition: cnat_db.h:372
void cnat_delete_main_db_entry(cnat_main_db_entry_t *ep)
Definition: cnat_db.h:153
u64 nfv9_logging_context_creation_fail_count
Definition: cnat_db.h:472
index_slist_t in2out_hash
Definition: cnat_db.h:156
cnat_errno_t
Definition: cnat_cli.h:26
cnat_db_create_policy_t policy
Definition: cnat_db.h:405
cnat_session_entry_t * cnat_handle_1to2_session(cnat_main_db_entry_t *mdb, cnat_key_t *dest_info)
Definition: cnat_db_v2.c:1027
u8 flags
Definition: cnat_db.h:296
u32 seq_no
Definition: cnat_db.h:235
cnat_errno_t error
Definition: cnat_db.h:528
port_type_t
Definition: cnat_ports.h:89
cnat_key_t v4_dest_key
Definition: cnat_db.h:345
u32 o_vrf_id
Definition: cnat_db.h:429
cnat_portmap_v2_t * portmap_list
Definition: cnat_db.h:430
cnat_key_t timeout_key
Definition: cnat_db.h:136
u16 cnat_timeout_db_create(cnat_timeout_t t_entry)
Definition: cnat_db_v2.c:2450
index_slist_t out2in_hash
Definition: cnat_db.h:155
index_slist_t * cnat_in2out_hash
Definition: cnat_db_v2.c:196
#define MAX_VRFID
Definition: cnat_db.h:28
cnat_main_db_entry_t * cnat_get_main_db_entry_v2(cnat_db_key_bucket_t *ki, port_pair_t port_pair_type, port_type_t port_type, cnat_gen_icmp_info *info, cnat_key_t *dest_info)
Definition: cnat_db_v2.c:1647
index_dlist_t main_list
Definition: cnat_db.h:356
#define BULK_RANGE_CACHE_SIZE
char i8
Definition: types.h:45
cnat_key_t k
Definition: cnat_db.h:113
u8 scale
Definition: cnat_db.h:378
unsigned long u64
Definition: types.h:89
void cnat_if_num_hash_table_dump(void)
vhost_user_log_t log
Definition: vhost-user.h:83
u16 port_limit
Definition: cnat_db.h:444
cnat_global_counters_t cnat_global_counters
Definition: cnat_db_v2.c:190
u16 dst_port
Definition: cnat_db.h:257
u16 timeout
Definition: cnat_db.h:224
cnat_main_db_entry_t * cnat_create_static_main_db_entry_v2(cnat_db_key_bucket_t *ki, cnat_db_key_bucket_t *ko, cnat_vrfmap_t *my_vrfmap, cnat_gen_icmp_info *info)
Definition: cnat_db_v2.c:1669
u16 * cnat_portmap_indices_by_vrf
u16 ntranslations
Definition: cnat_db.h:290
#define CNAT_MAX_VRFMAP_ENTRIES
Definition: cnat_db.h:103
index_slist_t * cnat_user_hash
Definition: cnat_db_v2.c:197
u32 syslog_logging_index
Definition: cnat_db.h:432
index_slist_t user_hash
Definition: cnat_db.h:287
cnat_key_t key
Definition: cnat_db.h:309
u32 pcp_lifetime
Definition: cnat_db.h:230
u8 nf_logging_policy
Definition: cnat_db.h:440
u16 ** cnat_portmaps_inuse
cnat_svi_params_entry svi_params_array[CNAT_MAX_VRFMAP_ENTRIES]
Definition: cnat_db_v2.c:226
u32 pcp_server_port
Definition: cnat_db.h:438
index_slist_t t_hash
Definition: cnat_db.h:142
u32 nfv9_logging_index
Definition: cnat_db.h:431
void cnat_user_db_delete(cnat_user_db_entry_t *up)
Definition: cnat_db_v2.c:541
u16 vrf_map_array[CNAT_MAX_VRFMAP_ENTRIES]
Definition: cnat_db_v2.c:225
index_slist_t cnat_session_hash
Definition: cnat_db.h:339
u32 tcp_seq_num
Definition: cnat_db.h:229
cnat_db_which_t
Definition: cnat_db.h:517
void cnat_db_in2out_hash_delete(cnat_main_db_entry_t *ep, cnat_user_db_entry_t *up)
Definition: cnat_db_v2.c:433
u16 timeout
Definition: cnat_db.h:351
cnat_user_db_entry_t * cnat_user_db
Definition: cnat_db_v2.c:202
u32 entry_expires
Definition: cnat_db.h:354
index_dlist_t pptp_list
Definition: cnat_db.h:249
u16 flags
Definition: cnat_db.h:348
u64 nfv9_downstream_constipation_count
Definition: cnat_db.h:484
cnat_portmap_v2_t nat64_portmap_v2_t
Definition: cnat_db.h:534
void cnat_timeout_db_delete(cnat_key_t t_key)
Definition: cnat_db_v2.c:2496
u32 portmap_index
Definition: cnat_db.h:306
cnat_timeout_db_entry_t * cnat_timeout_db
Definition: cnat_db_v2.c:204
u32 translation_list_head_index
Definition: cnat_db.h:303
u8 icmp_msg_count
Definition: cnat_db.h:293
void cnat_main_db_entry_dump(cnat_main_db_entry_t *db)
Definition: cnat_show.c:108
void cnat_main_db_entry_delete(cnat_main_db_entry_t *ep)
u8 filter_policy
Definition: cnat_db.h:448
void cnat_db_debug_i2o_drop(cnat_db_key_bucket_t *ki)
Definition: cnat_db_v2.c:417
u8 tcp_seq_check_enable
Definition: cnat_db.h:445
cnat_key_t in2out_key
Definition: cnat_db.h:398
bulk_alloc_size_t bulk_size
Definition: cnat_db.h:435
cnat_db_key_t k
Definition: cnat_db.h:108
#define VRF_NAME_LEN_STORED
Definition: cnat_db.h:27
u8 pad
Definition: cnat_db.h:381
u16 timeout_value
Definition: cnat_db.h:137
cnat_key_t ipv4_key
Definition: cnat_db.h:119
cnat_ingress_vrfid_name_entry vrfid_name_map[MAX_VRFID]
Definition: cnat_db_v2.c:227
Definition: cnat_db.h:285
u32 tcp_seq_user_window
Definition: cnat_db.h:447
cnat_main_db_entry_t * cnat_main_db_lookup_entry_out2in(cnat_db_key_bucket_t *ko)
Definition: cnat_db_v2.c:996
void cnat_add_dest_n_log(cnat_main_db_entry_t *mdb, cnat_key_t *dest_info)
Definition: cnat_db_v2.c:1083
index_slist_t * cnat_session_hash
Definition: cnat_db_v2.c:199
unsigned int u32
Definition: types.h:88
u32 entry_expires
Definition: cnat_db.h:213
Definition: cnat_db.h:140
cnat_main_db_entry_t * cnat_get_main_db_entry(cnat_db_key_bucket_t *ki, port_pair_t port_type, cnat_errno_t *error, cnat_user_db_entry_t **user_db_entry)
cnat_icmp_msg_t
Definition: cnat_db.h:522
u64 v4_to_v6_tcp_seq_mismatch_count
Definition: cnat_db.h:679
cnat_vrfmap_t nat64_vrfmap_t
Definition: cnat_db.h:533
index_dlist_t user_ports
Definition: cnat_db.h:204
cnat_key_t out2in_key
Definition: cnat_db.h:198
index_slist_t * cnat_out2in_hash
Definition: cnat_db_v2.c:195
u32 rseed_ip
Definition: cnat_db.h:443
u16 il
Definition: cnat_db.h:362
port_pair_t
Definition: cnat_ports.h:82
cnat_session_entry_t * cnat_session_db_lookup_entry(cnat_key_t *ko, u32 main_db_index)
Definition: cnat_db_v2.c:2612
cnat_portmap_t ** cnat_portmaps
u16 nsessions
Definition: cnat_db.h:266
u32 window
Definition: cnat_db.h:375
void cnat_delete_main_db_entry_v2(cnat_main_db_entry_t *ep)
Definition: cnat_db_v2.c:763
u8 scale
Definition: cnat_db.h:272
Definition: cnat_db.h:336
u16 ip_n_to_1
Definition: cnat_db.h:433
unsigned short u16
Definition: types.h:57
u8 syslog_logging_policy
Definition: cnat_db.h:441
u16 il
Definition: cnat_db.h:219
cnat_vrfmap_t * cnat_map_by_vrf
Definition: cnat_db_v2.c:218
u32 delete_time
Definition: cnat_db.h:425
struct _cnat_svi_params_entry cnat_svi_params_entry
u16 dslite_nat44_inst_id
Definition: cnat_db.h:260
void cnat_dest_update_main2session(cnat_main_db_entry_t *mdb, cnat_session_entry_t *sdb)
Definition: cnat_db_v2.c:2743
cnat_user_db_entry_t * cnat_user_db_lookup_entry(cnat_db_key_bucket_t *uki)
Definition: cnat_db_v2.c:603
unsigned char u8
Definition: types.h:56
u16 delta
Definition: cnat_db.h:217
u32 dst_ipv4
Definition: cnat_db.h:254
u16 vrfmap_index
Definition: cnat_db.h:192
bulk_alloc_size_t
u32 out2in_pkts
Definition: cnat_db.h:207
cnat_portmap_t * portmap
Definition: cnat_db.h:402
cnat_main_db_entry_t * db
Definition: cnat_db.h:404
cnat_key_t out2in_key
Definition: cnat_db.h:399
short i16
Definition: types.h:46
cnat_main_db_entry_t * cnat_create_main_db_entry_and_hash(cnat_db_key_bucket_t *ki, cnat_db_key_bucket_t *ko, cnat_user_db_entry_t *udb)
Definition: cnat_db_v2.c:653
void cnat_db_out2in_hash_delete(cnat_main_db_entry_t *ep)
Definition: cnat_db_v2.c:482
cnat_session_entry_t * cnat_session_db_edm_lookup_entry(cnat_key_t *ko, u32 session_head_index, u32 main_db_index)
Definition: cnat_db_v2.c:2583
cnat_db_create_policy_t
Definition: cnat_db.h:392
cnat_user_db_entry_t * cnat_user_db_create_entry(cnat_db_key_bucket_t *uki, u32 portmap_index)
Definition: cnat_db_v2.c:628
u64 nfv9_logging_context_creation_deferred_count
Definition: cnat_db.h:478
struct _cnat_ingress_vrfid_name_entry cnat_ingress_vrfid_name_entry
dslite_key_t dk
Definition: cnat_db.h:127
index_slist_t * cnat_timeout_hash
Definition: cnat_db_v2.c:198
cnat_timeout_t t_key
Definition: cnat_db.h:141
cnat_main_db_entry_t * cnat_main_db_lookup_entry(cnat_db_key_bucket_t *ki)
Definition: cnat_db_v2.c:515
port_pair_t pair_of_ports
Definition: cnat_db.h:406
cnat_main_db_entry_t * cnat_main_db_create(cnat_db_create_args_t *a)
cnat_key_t in2out_key
Definition: cnat_db.h:201
u32 in2out_pkts
Definition: cnat_db.h:210
cnat_icmp_msg_t gen_icmp_msg
Definition: cnat_db.h:529
u32 ack_no
Definition: cnat_db.h:236