[strongSwan-dev] [hw-offload-auto-mode v2 1/3] ipsec-types: Create new enum hw_offload_t

adin at mellanox.com adin at mellanox.com
Mon Mar 12 15:34:19 CET 2018


From: Adi Nissim <adin at mellanox.com>

Add the new enum in order to add HW offload auto mode.

Signed-off-by: Adi Nissim <adin at mellanox.com>
Reviewed-by: Aviv Heller <avivh at mellanox.com>
---
 src/libstrongswan/ipsec/ipsec_types.c |  6 ++++++
 src/libstrongswan/ipsec/ipsec_types.h | 15 +++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/src/libstrongswan/ipsec/ipsec_types.c b/src/libstrongswan/ipsec/ipsec_types.c
index c992eb5..0e94071 100644
--- a/src/libstrongswan/ipsec/ipsec_types.c
+++ b/src/libstrongswan/ipsec/ipsec_types.c
@@ -37,6 +37,12 @@ ENUM(ipcomp_transform_names, IPCOMP_NONE, IPCOMP_LZJH,
 	"IPCOMP_LZJH"
 );

+ENUM(hw_offload_names, HW_OFFLOAD_NO, HW_OFFLOAD_AUTO,
+	"no",
+	"yes",
+	"auto",
+);
+
 /*
  * See header
  */
diff --git a/src/libstrongswan/ipsec/ipsec_types.h b/src/libstrongswan/ipsec/ipsec_types.h
index 1db78ba..fef9f83 100644
--- a/src/libstrongswan/ipsec/ipsec_types.h
+++ b/src/libstrongswan/ipsec/ipsec_types.h
@@ -26,6 +26,7 @@ typedef enum policy_dir_t policy_dir_t;
 typedef enum policy_type_t policy_type_t;
 typedef enum policy_priority_t policy_priority_t;
 typedef enum ipcomp_transform_t ipcomp_transform_t;
+typedef enum hw_offload_t hw_offload_t;
 typedef struct ipsec_sa_cfg_t ipsec_sa_cfg_t;
 typedef struct lifetime_cfg_t lifetime_cfg_t;
 typedef struct mark_t mark_t;
@@ -117,6 +118,20 @@ enum ipcomp_transform_t {
 extern enum_name_t *ipcomp_transform_names;

 /**
+ * HW off-load mode options
+ */
+enum hw_offload_t {
+	HW_OFFLOAD_NO = 0,
+	HW_OFFLOAD_YES = 1,
+	HW_OFFLOAD_AUTO = 2,
+};
+
+/**
+ * enum names for hw_offload_t.
+ */
+extern enum_name_t *hw_offload_names;
+
+/**
  * This struct contains details about IPsec SA(s) tied to a policy.
  */
 struct ipsec_sa_cfg_t {
--
1.8.3.1



More information about the Dev mailing list