diff options
author | Tobias Brunner <tobias@strongswan.org> | 2016-03-03 17:39:27 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2016-03-03 17:39:58 +0100 |
commit | 88ce12a927f03d88f29609a46e7880dc0ecfb8be (patch) | |
tree | 7966167225b3e6f2ac51554f6092a28ab132c2b0 /src/libhydra/hydra.c | |
parent | 91d80298f9de5e7d792b7cb0a6c7a2c61784d744 (diff) | |
parent | 28649f6d91971e0fe50078aec2937010e8c61cd8 (diff) | |
download | strongswan-88ce12a927f03d88f29609a46e7880dc0ecfb8be.tar.bz2 strongswan-88ce12a927f03d88f29609a46e7880dc0ecfb8be.tar.xz |
Merge branch 'libhydra-bye-bye'
Moves kernel plugins to libcharon and removes the unused libhydra. The
kernel interface is now accessible under charon->kernel.
Diffstat (limited to 'src/libhydra/hydra.c')
-rw-r--r-- | src/libhydra/hydra.c | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/src/libhydra/hydra.c b/src/libhydra/hydra.c deleted file mode 100644 index 47ffb59c6..000000000 --- a/src/libhydra/hydra.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2010 Tobias Brunner - * Hochschule fuer Technik Rapperswil - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -#include "hydra.h" - -#include <utils/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; - - /** - * Integrity check failed? - */ - bool integrity_failed; - - /** - * Number of times we have been initialized - */ - refcount_t ref; -}; - -/** - * Single instance of hydra_t. - */ -hydra_t *hydra = NULL; - -/** - * Described in header. - */ -void libhydra_deinit() -{ - private_hydra_t *this = (private_hydra_t*)hydra; - - if (!this || !ref_put(&this->ref)) - { /* have more users */ - return; - } - - this->public.kernel_interface->destroy(this->public.kernel_interface); - free(this); - hydra = NULL; -} - -/** - * Described in header. - */ -bool libhydra_init() -{ - private_hydra_t *this; - - if (hydra) - { /* already initialized, increase refcount */ - this = (private_hydra_t*)hydra; - ref_get(&this->ref); - return !this->integrity_failed; - } - - INIT(this, - .ref = 1, - ); - hydra = &this->public; - - this->public.kernel_interface = kernel_interface_create(); - - if (lib->integrity && - !lib->integrity->check(lib->integrity, "libhydra", libhydra_init)) - { - DBG1(DBG_LIB, "integrity check of libhydra failed"); - this->integrity_failed = TRUE; - } - return !this->integrity_failed; -} |