diff options
author | Martin Willi <martin@revosec.ch> | 2012-07-31 11:09:19 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-08-21 09:38:01 +0200 |
commit | 63e460542c2cc9e1fb7707db34f483362f6a6c13 (patch) | |
tree | dad49c956a537c3ff374b6de42e385b5161322ac /src/libcharon/plugins/stroke/stroke_socket.c | |
parent | 9937ca069ad4fb26aeaf1b5c72820afdcd93ae16 (diff) | |
download | strongswan-63e460542c2cc9e1fb7707db34f483362f6a6c13.tar.bz2 strongswan-63e460542c2cc9e1fb7707db34f483362f6a6c13.tar.xz |
Add a stroke attribute_handler requesting DNS servers given with leftdns
Diffstat (limited to 'src/libcharon/plugins/stroke/stroke_socket.c')
-rw-r--r-- | src/libcharon/plugins/stroke/stroke_socket.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libcharon/plugins/stroke/stroke_socket.c b/src/libcharon/plugins/stroke/stroke_socket.c index 427a5e83f..df43e168d 100644 --- a/src/libcharon/plugins/stroke/stroke_socket.c +++ b/src/libcharon/plugins/stroke/stroke_socket.c @@ -37,6 +37,7 @@ #include "stroke_cred.h" #include "stroke_ca.h" #include "stroke_attribute.h" +#include "stroke_handler.h" #include "stroke_list.h" /** @@ -99,6 +100,11 @@ struct private_stroke_socket_t { stroke_attribute_t *attribute; /** + * attribute handler (requests only) + */ + stroke_handler_t *handler; + + /** * controller to control daemon */ stroke_control_t *control; @@ -238,6 +244,7 @@ static void stroke_add_conn(private_stroke_socket_t *this, stroke_msg_t *msg) this->config->add(this->config, msg); this->attribute->add_pool(this->attribute, msg); + this->handler->add_attributes(this->handler, msg); } /** @@ -250,6 +257,7 @@ static void stroke_del_conn(private_stroke_socket_t *this, stroke_msg_t *msg) this->config->del(this->config, msg); this->attribute->del_pool(this->attribute, msg); + this->handler->del_attributes(this->handler, msg); } /** @@ -789,10 +797,12 @@ METHOD(stroke_socket_t, destroy, void, lib->credmgr->remove_set(lib->credmgr, &this->cred->set); charon->backends->remove_backend(charon->backends, &this->config->backend); hydra->attributes->remove_provider(hydra->attributes, &this->attribute->provider); + hydra->attributes->remove_handler(hydra->attributes, &this->handler->handler); this->cred->destroy(this->cred); this->ca->destroy(this->ca); this->config->destroy(this->config); this->attribute->destroy(this->attribute); + this->handler->destroy(this->handler); this->control->destroy(this->control); this->list->destroy(this->list); free(this); @@ -819,6 +829,7 @@ stroke_socket_t *stroke_socket_create() this->cred = stroke_cred_create(); this->attribute = stroke_attribute_create(); + this->handler = stroke_handler_create(); this->ca = stroke_ca_create(this->cred); this->config = stroke_config_create(this->ca, this->cred); this->control = stroke_control_create(); @@ -835,6 +846,7 @@ stroke_socket_t *stroke_socket_create() lib->credmgr->add_set(lib->credmgr, &this->cred->set); charon->backends->add_backend(charon->backends, &this->config->backend); hydra->attributes->add_provider(hydra->attributes, &this->attribute->provider); + hydra->attributes->add_handler(hydra->attributes, &this->handler->handler); lib->processor->queue_job(lib->processor, (job_t*)callback_job_create_with_prio((callback_job_cb_t)receive, this, |