summaryrefslogtreecommitdiffstats
path: root/src/plugins/cnat/cnat_maglev.h
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2022-01-24 17:10:41 +0100
committerDamjan Marion <dmarion@me.com>2022-01-30 15:23:09 +0000
commit6de58f5fd0c9d47a65e24d3617e465b9fa8d8872 (patch)
tree23faefcf17170676d278affcda4df84ee49ba8d4 /src/plugins/cnat/cnat_maglev.h
parentc454e8993d18670f76b03dca780213860c2e19a2 (diff)
cnat: maglev fixes & improvements
This fixes the maglev logic which previously included a wrong simplication. It moves the maglev logic to its own file, and adds a test function in the debug cli. Type: improvement Change-Id: I2790ae2a26fc1c5739ff02f41d436bfcafd5b380 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/cnat/cnat_maglev.h')
-rw-r--r--src/plugins/cnat/cnat_maglev.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/plugins/cnat/cnat_maglev.h b/src/plugins/cnat/cnat_maglev.h
new file mode 100644
index 00000000000..a71dd3ce796
--- /dev/null
+++ b/src/plugins/cnat/cnat_maglev.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2022 Cisco Systems, Inc.
+ */
+
+#ifndef __CNAT_MAGLEV_H__
+#define __CNAT_MAGLEV_H__
+
+#include <cnat/cnat_types.h>
+#include <cnat/cnat_translation.h>
+
+typedef struct
+{
+ /* offset & skip used for sorting, should be first */
+ u32 offset;
+ u32 skip;
+ u32 index;
+} cnat_maglev_perm_t;
+
+extern void cnat_translation_init_maglev (cnat_translation_t *ct);
+
+#endif \ No newline at end of file