aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cnat/cnat_types.h
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2021-02-25 17:39:03 +0100
committerDave Barach <openvpp@barachs.net>2021-03-04 12:35:15 +0000
commit3fd77f7dea1ac91c5b4c9ede69b992a4e2243153 (patch)
tree21550f5d6e28f55f4e64ee1ddb7697c9e261dd85 /src/plugins/cnat/cnat_types.h
parent8786a4cd4a62f2817da7060afd8523857f504912 (diff)
cnat: Prepare extended snat policies
Type: refactor Change-Id: I9ca3333274d6f32b6aff57f0fb3d2049c066337a Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/cnat/cnat_types.h')
-rw-r--r--src/plugins/cnat/cnat_types.h31
1 files changed, 5 insertions, 26 deletions
diff --git a/src/plugins/cnat/cnat_types.h b/src/plugins/cnat/cnat_types.h
index f0911d22d75..47e34e1f232 100644
--- a/src/plugins/cnat/cnat_types.h
+++ b/src/plugins/cnat/cnat_types.h
@@ -37,6 +37,7 @@
#define CNAT_DEFAULT_SESSION_BUCKETS 1024
#define CNAT_DEFAULT_TRANSLATION_BUCKETS 1024
#define CNAT_DEFAULT_SNAT_BUCKETS 1024
+#define CNAT_DEFAULT_SNAT_IF_MAP_LEN 4096
#define CNAT_DEFAULT_SESSION_MEMORY (1 << 20)
#define CNAT_DEFAULT_TRANSLATION_MEMORY (256 << 10)
@@ -81,23 +82,6 @@ typedef struct
u16 sequence;
} cnat_echo_header_t;
-typedef struct
-{
- u32 dst_address_length_refcounts[129];
- u16 *prefix_lengths_in_search_order;
- uword *non_empty_dst_address_length_bitmap;
-} cnat_snat_pfx_table_meta_t;
-
-typedef struct
-{
- /* Stores (ip family, prefix & mask) */
- clib_bihash_24_8_t ip_hash;
- /* family dependant cache */
- cnat_snat_pfx_table_meta_t meta[2];
- /* Precomputed ip masks (ip4 & ip6) */
- ip6_address_t ip_masks[129];
-} cnat_snat_pfx_table_t;
-
typedef struct cnat_main_
{
/* Memory size of the session bihash */
@@ -118,6 +102,10 @@ typedef struct cnat_main_
/* Number of buckets of the source NAT prefix bihash */
u32 snat_hash_buckets;
+ /* Bit map for include / exclude sw_if_index
+ * so max number of expected interfaces */
+ u32 snat_if_map_length;
+
/* Timeout after which to clear sessions (in seconds) */
u32 session_max_age;
@@ -131,15 +119,6 @@ typedef struct cnat_main_
/* Lock for the timestamp pool */
clib_rwlock_t ts_lock;
- /* Ip4 Address to use for source NATing */
- cnat_endpoint_t snat_ip4;
-
- /* Ip6 Address to use for source NATing */
- cnat_endpoint_t snat_ip6;
-
- /* Longest prefix Match table for source NATing */
- cnat_snat_pfx_table_t snat_pfx_table;
-
/* Index of the scanner process node */
uword scanner_node_index;