aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhydra/hydra.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2010-03-24 17:40:15 +0100
committerTobias Brunner <tobias@strongswan.org>2010-03-24 18:53:10 +0100
commit567d3f14639f769b1b2a6ba4dd327ef0b4960c06 (patch)
tree16590335d50ddf5aedc5ca7ec2e3e98145e96b64 /src/libhydra/hydra.c
parent83218f0d6552019323b4e11c453632e121d3faa8 (diff)
downloadstrongswan-567d3f14639f769b1b2a6ba4dd327ef0b4960c06.tar.bz2
strongswan-567d3f14639f769b1b2a6ba4dd327ef0b4960c06.tar.xz
Attributes moved from libstrongswan to libhydra.
The attribute_manager_t instance is now located on the new hydra object instead of the lib object.
Diffstat (limited to 'src/libhydra/hydra.c')
-rw-r--r--src/libhydra/hydra.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/libhydra/hydra.c b/src/libhydra/hydra.c
index edc48f748..8775df08c 100644
--- a/src/libhydra/hydra.c
+++ b/src/libhydra/hydra.c
@@ -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))
{