[strongSwan-dev] [PATCH 1/2] Add ignore action to child_sa_t

Thomas Egerer thomas.egerer at secunet.com
Tue Jun 1 09:53:32 CEST 2010


---
 src/libcharon/sa/child_sa.c |   25 +++++++++++++++++++++++++
 src/libcharon/sa/child_sa.h |   15 +++++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/src/libcharon/sa/child_sa.c b/src/libcharon/sa/child_sa.c
index 8fd2a8c..8ba093a 100644
--- a/src/libcharon/sa/child_sa.c
+++ b/src/libcharon/sa/child_sa.c
@@ -156,6 +156,12 @@ struct private_child_sa_t {
 	 * last number of outbound bytes
 	 */
 	u_int64_t other_usebytes;
+
+	/**
+	 * ignore delete action of this child (can be set, if e.g. a rekeying
+	 * collision occurred
+	 */
+	bool ignore_delete_action;
 };

 /**
@@ -833,6 +839,22 @@ static status_t update(private_child_sa_t *this,  host_t *me, host_t *other,
 }

 /**
+ * Implementation of child_sa_t.set_ignore_delete_action.
+ */
+void set_ignore_delete_action(private_child_sa_t *this, bool ignore_delete_action)
+{
+	this->ignore_delete_action = ignore_delete_action;
+}
+
+/**
+ * Implementation of child_sa_t.get_ignore_delete_action.
+ */
+bool get_ignore_delete_action(private_child_sa_t *this)
+{
+	return this->ignore_delete_action;
+}
+
+/**
  * Implementation of child_sa_t.destroy.
  */
 static void destroy(private_child_sa_t *this)
@@ -926,6 +948,8 @@ child_sa_t * child_sa_create(host_t *me, host_t* other,
 	this->public.add_policies = (status_t (*)(child_sa_t*, linked_list_t*,linked_list_t*))add_policies;
 	this->public.get_traffic_selectors = (linked_list_t*(*)(child_sa_t*,bool))get_traffic_selectors;
 	this->public.create_policy_enumerator = (enumerator_t*(*)(child_sa_t*))create_policy_enumerator;
+	this->public.set_ignore_delete_action = (void (*)(child_sa_t *, bool))set_ignore_delete_action;
+	this->public.get_ignore_delete_action = (bool (*)(child_sa_t *))get_ignore_delete_action;
 	this->public.destroy = (void(*)(child_sa_t*))destroy;

 	/* private data */
@@ -950,6 +974,7 @@ child_sa_t * child_sa_create(host_t *me, host_t* other,
 	this->rekey_time = 0;
 	this->expire_time = 0;
 	this->config = config;
+	this->ignore_delete_action = FALSE;
 	config->get_ref(config);
 	this->reqid = config->get_reqid(config);
 	if (!this->reqid)
diff --git a/src/libcharon/sa/child_sa.h b/src/libcharon/sa/child_sa.h
index e6c6035..3c3302a 100644
--- a/src/libcharon/sa/child_sa.h
+++ b/src/libcharon/sa/child_sa.h
@@ -315,6 +315,21 @@ struct child_sa_t {
 	 */
 	status_t (*update)(child_sa_t *this, host_t *me, host_t *other,
 					   host_t *vip, bool encap);
+
+	/**
+	 * Set whether to ignore the delete action or not. Default is FALSE.
+	 *
+	 * @param value		new value for ignore_delete_action
+	 */
+	void (*set_ignore_delete_action)(child_sa_t *this, bool value);
+
+	/**
+	 * Get whether to ignore delete action of this particular CHILD_SA
+	 *
+	 * @return			value of ignore_delete_action
+	 */
+	bool (*get_ignore_delete_action)(child_sa_t *this);
+
 	/**
 	 * Destroys a child_sa.
 	 */
-- 
1.7.0.2




More information about the Dev mailing list