diff options
Diffstat (limited to 'src/libhydra')
-rw-r--r-- | src/libhydra/hydra.c | 4 | ||||
-rw-r--r-- | src/libhydra/hydra.h | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/libhydra/hydra.c b/src/libhydra/hydra.c index 2dd6ee7e5..7ad022f5f 100644 --- a/src/libhydra/hydra.c +++ b/src/libhydra/hydra.c @@ -42,6 +42,7 @@ void libhydra_deinit() { private_hydra_t *this = (private_hydra_t*)hydra; this->public.attributes->destroy(this->public.attributes); + free((void*)this->public.daemon); free(this); hydra = NULL; } @@ -49,13 +50,14 @@ void libhydra_deinit() /** * Described in header. */ -bool libhydra_init() +bool libhydra_init(const char *daemon) { private_hydra_t *this; INIT(this, .public = { .attributes = attribute_manager_create(), + .daemon = strdup(daemon ?: "libhydra"), }, ); hydra = &this->public; diff --git a/src/libhydra/hydra.h b/src/libhydra/hydra.h index 525dce165..8670f3969 100644 --- a/src/libhydra/hydra.h +++ b/src/libhydra/hydra.h @@ -44,6 +44,11 @@ struct hydra_t { * manager for payload attributes */ attribute_manager_t *attributes; + + /** + * name of the daemon that initialized the library + */ + const char *daemon; }; /** @@ -56,9 +61,12 @@ extern hydra_t *hydra; /** * Initialize libhydra. * + * The daemon's name is used to load daemon-specific settings. + * + * @param daemon name of the daemon that initializes the library * @return FALSE if integrity check failed */ -bool libhydra_init(); +bool libhydra_init(const char *daemon); /** * Deinitialize libhydra. |