summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_spd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ipsec/ipsec_spd.h')
-rw-r--r--src/vnet/ipsec/ipsec_spd.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/vnet/ipsec/ipsec_spd.h b/src/vnet/ipsec/ipsec_spd.h
index 757a1b72d51..887ae99c101 100644
--- a/src/vnet/ipsec/ipsec_spd.h
+++ b/src/vnet/ipsec/ipsec_spd.h
@@ -15,6 +15,8 @@
#ifndef __IPSEC_SPD_H__
#define __IPSEC_SPD_H__
+#include <vppinfra/bihash_40_8.h>
+#include <vppinfra/bihash_16_8.h>
#include <vlib/vlib.h>
#define foreach_ipsec_spd_policy_type \
@@ -41,7 +43,23 @@ typedef enum ipsec_spd_policy_t_
extern u8 *format_ipsec_policy_type (u8 * s, va_list * args);
/**
- * @brief A Secruity Policy Database
+ * @brief A fast path Security Policy Database
+ */
+typedef struct
+{
+ /** vectors for each of the policy types */
+ u32 *fp_policies[IPSEC_SPD_POLICY_N_TYPES];
+ u32 *fp_mask_types[IPSEC_SPD_POLICY_N_TYPES];
+
+ clib_bihash_40_8_t fp_ip6_lookup_hash; /* spd fp ip6 lookup hash table. */
+ clib_bihash_16_8_t fp_ip4_lookup_hash; /* spd fp ip4 lookup hash table. */
+
+ u8 fp_ip6_lookup_hash_initialized;
+
+} ipsec_spd_fp_t;
+
+/**
+ * @brief A Security Policy Database
*/
typedef struct
{
@@ -49,6 +67,8 @@ typedef struct
u32 id;
/** vectors for each of the policy types */
u32 *policies[IPSEC_SPD_POLICY_N_TYPES];
+ /* TODO remove fp_spd. Use directly ipsec_spd_t for fast path */
+ ipsec_spd_fp_t fp_spd;
} ipsec_spd_t;
/**