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
18 #include <utils/debug.h>
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 this->public.kernel_interface
->destroy(this->public.kernel_interface
);
46 free((void*)this->public.daemon
);
52 * Described in header.
54 bool libhydra_init(const char *daemon
)
56 private_hydra_t
*this;
60 .attributes
= attribute_manager_create(),
61 .daemon
= strdup(daemon
?: "libhydra"),
64 hydra
= &this->public;
66 this->public.kernel_interface
= kernel_interface_create();
69 !lib
->integrity
->check(lib
->integrity
, "libhydra", libhydra_init
))
71 DBG1(DBG_LIB
, "integrity check of libhydra failed");