]> git.ipfire.org Git - thirdparty/strongswan.git/blobdiff - src/libstrongswan/ipsec/ipsec_types.h
ipsec-types: Create new enum hw_offload_t
[thirdparty/strongswan.git] / src / libstrongswan / ipsec / ipsec_types.h
index cbc0d089b2471830a5759a282cd0e81afc23c706..4324ea40a8f827121e1a9473aa9f8cda08f9e057 100644 (file)
@@ -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;
@@ -116,6 +117,20 @@ enum ipcomp_transform_t {
  */
 extern enum_name_t *ipcomp_transform_names;
 
+/**
+ * HW offload 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.
  */
@@ -142,6 +157,15 @@ struct ipsec_sa_cfg_t {
        } ipcomp;
 };
 
+/**
+ * Compare two ipsec_sa_cfg_t objects for equality.
+ *
+ * @param a                    first object
+ * @param b                    second object
+ * @return                     TRUE if both objects are equal
+ */
+bool ipsec_sa_cfg_equals(ipsec_sa_cfg_t *a, ipsec_sa_cfg_t *b);
+
 /**
  * A lifetime_cfg_t defines the lifetime limits of an SA.
  *
@@ -169,9 +193,11 @@ struct mark_t {
 };
 
 /**
- * Special mark value that uses a unique mark for each CHILD_SA
+ * Special mark value that uses a unique mark for each CHILD_SA (and direction)
  */
 #define MARK_UNIQUE (0xFFFFFFFF)
+#define MARK_UNIQUE_DIR (0xFFFFFFFE)
+#define MARK_IS_UNIQUE(m) ((m) == MARK_UNIQUE || (m) == MARK_UNIQUE_DIR)
 
 /**
  * Try to parse a mark_t from the given string of the form mark[/mask].