exit(SS_RC_DAEMON_INTEGRITY);
}
- if (!libhydra_init())
+ if (!libhydra_init("charon"))
{
dbg_stderr(1, "initialization failed - aborting charon");
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;
}
/**
* 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;
* manager for payload attributes
*/
attribute_manager_t *attributes;
+
+ /**
+ * name of the daemon that initialized the library
+ */
+ const char *daemon;
};
/**
/**
* 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.
library_deinit();
exit(SS_RC_DAEMON_INTEGRITY);
}
- if (!libhydra_init())
+ if (!libhydra_init("pluto"))
{
libhydra_deinit();
library_deinit();