aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/plugins/stroke/stroke_socket.c
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2008-04-09 12:56:20 +0000
committerMartin Willi <martin@strongswan.org>2008-04-09 12:56:20 +0000
commitad81e51afcc335494b22d6c4972060caff8d3fdd (patch)
tree4638390cb4bf7fa9b3b31b51e0b2981c0156536b /src/charon/plugins/stroke/stroke_socket.c
parentcdcfe777f4cec7906a28fd2ef57d24ec3290902f (diff)
downloadstrongswan-ad81e51afcc335494b22d6c4972060caff8d3fdd.tar.bz2
strongswan-ad81e51afcc335494b22d6c4972060caff8d3fdd.tar.xz
implemented a simple attribute provider for stroke
Diffstat (limited to 'src/charon/plugins/stroke/stroke_socket.c')
-rw-r--r--src/charon/plugins/stroke/stroke_socket.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/charon/plugins/stroke/stroke_socket.c b/src/charon/plugins/stroke/stroke_socket.c
index 8ce757acb..9ee5a2410 100644
--- a/src/charon/plugins/stroke/stroke_socket.c
+++ b/src/charon/plugins/stroke/stroke_socket.c
@@ -33,6 +33,7 @@
#include "stroke_control.h"
#include "stroke_cred.h"
#include "stroke_ca.h"
+#include "stroke_attribute.h"
#include "stroke_list.h"
typedef struct stroke_job_context_t stroke_job_context_t;
@@ -64,6 +65,11 @@ struct private_stroke_socket_t {
stroke_config_t *config;
/**
+ * attribute provider
+ */
+ stroke_attribute_t *attribute;
+
+ /**
* controller to control daemon
*/
stroke_control_t *control;
@@ -173,6 +179,7 @@ static void stroke_add_conn(private_stroke_socket_t *this, stroke_msg_t *msg)
DBG2(DBG_CFG, " me_peerid=%s", msg->add_conn.ikeme.peerid);
this->config->add(this->config, msg);
+ this->attribute->add_pool(this->attribute, msg);
}
/**
@@ -184,6 +191,7 @@ static void stroke_del_conn(private_stroke_socket_t *this, stroke_msg_t *msg)
DBG1(DBG_CFG, "received stroke: delete connection '%s'", msg->del_conn.name);
this->config->del(this->config, msg);
+ this->attribute->del_pool(this->attribute, msg);
}
/**
@@ -542,9 +550,11 @@ static void destroy(private_stroke_socket_t *this)
charon->credentials->remove_set(charon->credentials, &this->ca->set);
charon->credentials->remove_set(charon->credentials, &this->cred->set);
charon->backends->remove_backend(charon->backends, &this->config->backend);
+ charon->attributes->remove_provider(charon->attributes, &this->attribute->provider);
this->cred->destroy(this->cred);
this->ca->destroy(this->ca);
this->config->destroy(this->config);
+ this->attribute->destroy(this->attribute);
this->control->destroy(this->control);
this->list->destroy(this->list);
free(this);
@@ -566,6 +576,7 @@ stroke_socket_t *stroke_socket_create()
}
this->cred = stroke_cred_create();
+ this->attribute = stroke_attribute_create();
this->ca = stroke_ca_create(this->cred);
this->config = stroke_config_create(this->cred);
this->control = stroke_control_create();
@@ -574,6 +585,7 @@ stroke_socket_t *stroke_socket_create()
charon->credentials->add_set(charon->credentials, &this->ca->set);
charon->credentials->add_set(charon->credentials, &this->cred->set);
charon->backends->add_backend(charon->backends, &this->config->backend);
+ charon->attributes->add_provider(charon->attributes, &this->attribute->provider);
this->job = callback_job_create((callback_job_cb_t)receive,
this, NULL, NULL);