2 * Copyright (C) 2010 Tobias Brunner
3 * Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 typedef struct private_hydra_t private_hydra_t
;
23 * Private additions to hydra_t.
25 struct private_hydra_t
{
28 * Public members of hydra_t.
34 * Single instance of hydra_t.
39 * Described in header.
41 void libhydra_deinit()
43 private_hydra_t
*this = (private_hydra_t
*)hydra
;
44 this->public.attributes
->destroy(this->public.attributes
);
45 free((void*)this->public.daemon
);
51 * Described in header.
53 bool libhydra_init(const char *daemon
)
55 private_hydra_t
*this;
59 .attributes
= attribute_manager_create(),
60 .daemon
= strdup(daemon ?
: "libhydra"),
63 hydra
= &this->public;
66 !lib
->integrity
->check(lib
->integrity
, "libhydra", libhydra_init
))
68 DBG1(DBG_LIB
, "integrity check of libhydra failed");