Attributes moved from libstrongswan to libhydra.

The attribute_manager_t instance is now located on the new hydra object
instead of the lib object.
This commit is contained in:
Tobias Brunner
2010-03-24 18:53:10 +01:00
parent 83218f0d65
commit 567d3f1463
13 changed files with 57 additions and 15 deletions
+30
View File
@@ -17,11 +17,32 @@
#include <debug.h>
typedef struct private_hydra_t private_hydra_t;
/**
* Private additions to hydra_t.
*/
struct private_hydra_t {
/**
* Public members of hydra_t.
*/
hydra_t public;
};
/**
* Single instance of hydra_t.
*/
hydra_t *hydra;
/**
* Described in header.
*/
void libhydra_deinit()
{
private_hydra_t *this = (private_hydra_t*)hydra;
this->public.attributes->destroy(this->public.attributes);
free(this);
hydra = NULL;
}
/**
@@ -29,6 +50,15 @@ void libhydra_deinit()
*/
bool libhydra_init()
{
private_hydra_t *this;
INIT(this,
.public = {
.attributes = attribute_manager_create(),
},
);
hydra = &this->public;
if (lib->integrity &&
!lib->integrity->check(lib->integrity, "libhydra", libhydra_init))
{