nat: static mappings in flow hash
[vpp.git] / src / plugins / nat / nat44-ei / nat44_ei.h
index 29c92e9..2e95b14 100644 (file)
 #include <vppinfra/dlist.h>
 #include <vppinfra/error.h>
 #include <vppinfra/bihash_8_8.h>
+#include <vppinfra/hash.h>
 
 #include <nat/lib/lib.h>
 #include <nat/lib/inlines.h>
+#include <nat/lib/nat_proto.h>
 
 /* default number of worker handoff frame queue elements */
 #define NAT_FQ_NELTS_DEFAULT 64
@@ -71,7 +73,7 @@ typedef struct
 #define _(N, i, n, s)                                                         \
   u32 busy_##n##_ports;                                                       \
   u32 *busy_##n##_ports_per_thread;                                           \
-  u32 busy_##n##_port_refcounts[65535];
+  u32 busy_##n##_port_refcounts[0xffff + 1];
   foreach_nat_protocol
 #undef _
 } nat44_ei_address_t;
@@ -160,7 +162,7 @@ typedef struct
 
 typedef struct
 {
-  /* prefered pool address */
+  /* preferred pool address */
   ip4_address_t pool_addr;
   /* local IP address */
   ip4_address_t local_addr;
@@ -304,7 +306,7 @@ typedef struct
 typedef struct
 {
   u32 cached_sw_if_index;
-  u32 cached_ip4_address;
+  uword *cached_presence_by_ip4_address;
 } nat44_ei_runtime_t;
 
 typedef struct