initialize libstrongswan in dynamic stand-alone libimcv-based libraries

This commit is contained in:
Andreas Steffen
2011-06-01 20:59:25 +02:00
parent 633720f99a
commit d4c8fe3cb6
7 changed files with 199 additions and 6 deletions
+10
View File
@@ -12,6 +12,7 @@
* for more details.
*/
#include "imcv.h"
#include "imc_agent.h"
#include <debug.h>
@@ -277,6 +278,9 @@ METHOD(imc_agent_t, destroy, void,
this->connections->destroy_function(this->connections, free);
this->connection_lock->destroy(this->connection_lock);
free(this);
/* decrease the reference count or terminate */
libimcv_deinit();
}
/**
@@ -288,6 +292,12 @@ imc_agent_t *imc_agent_create(const char *name,
{
private_imc_agent_t *this;
/* initialize or increase the reference count */
if (!libimcv_init())
{
return NULL;
}
INIT(this,
.public = {
.bind_functions = _bind_functions,