memeq() is currently used to compare these but if there is padding that
is not initialized the same for two instances the comparison fails.
Using this function ensures the objects are compared correctly.
"IPCOMP_LZJH"
);
+/*
+ * See header
+ */
+bool ipsec_sa_cfg_equals(ipsec_sa_cfg_t *a, ipsec_sa_cfg_t *b)
+{
+ return a->mode == b->mode &&
+ a->reqid == b->reqid &&
+ a->policy_count == b->policy_count &&
+ a->esp.use == b->esp.use &&
+ a->esp.spi == b->esp.spi &&
+ a->ah.use == b->ah.use &&
+ a->ah.spi == b->ah.spi &&
+ a->ipcomp.transform == b->ipcomp.transform &&
+ a->ipcomp.cpi == b->ipcomp.cpi;
+}
+
/*
* See header
*/
} 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.
*