sa/tasks/ike_auth_lifetime.c sa/tasks/ike_auth_lifetime.h \
sa/tasks/ike_vendor.c sa/tasks/ike_vendor.h \
sa/tasks/task.c sa/tasks/task.h \
-tnc/imv/imv.h tnc/imv/imv_manager.h \
-tnc/imv/imv_recommendations.c tnc/imv/imv_recommendations.h \
tnc/tnccs/tnccs.c tnc/tnccs/tnccs.h \
tnc/tnccs/tnccs_manager.c tnc/tnccs/tnccs_manager.h
#include <sa/shunt_manager.h>
#include <config/backend_manager.h>
#include <sa/authenticators/eap/eap_manager.h>
-#include <tnc/imv/imv_manager.h>
#include <tnc/tnccs/tnccs_manager.h>
#ifdef ME
*/
eap_manager_t *eap;
- /**
- * TNC IMV manager controlling Integrity Measurement Verifiers
- */
- imv_manager_t *imvs;
-
/**
* TNCCS manager to maintain registered TNCCS protocols
*/
#include <errno.h>
#include <fcntl.h>
-#include <daemon.h>
#include <utils/lexparser.h>
+#include <debug.h>
+
+typedef struct private_tnc_imv_plugin_t private_tnc_imv_plugin_t;
+
+/**
+ * Private data of a tnc_imv_plugin_t object.
+ */
+struct private_tnc_imv_plugin_t {
+
+ /**
+ * Public interface.
+ */
+ tnc_imv_plugin_t public;
+
+ /**
+ * TNC IMV manager controlling Integrity Measurement Verifiers
+ */
+ imv_manager_t *imvs;
+};
/**
* load IMVs from a configuration file
*/
-static bool load_imvs(char *filename)
+static bool load_imvs(private_tnc_imv_plugin_t *this, char *filename)
{
int fd, line_nr = 0;
chunk_t src, line;
free(path);
return FALSE;
}
- if (!charon->imvs->add(charon->imvs, imv))
+ if (!this->imvs->add(this->imvs, imv))
{
if (imv->terminate &&
imv->terminate(imv->get_id(imv)) != TNC_RESULT_SUCCESS)
return "tnc-imv";
}
+METHOD(plugin_t, get_features, int,
+ private_tnc_imv_plugin_t *this, plugin_feature_t *features[])
+{
+ static plugin_feature_t f[] = {
+ PLUGIN_PROVIDE(CUSTOM, "imv-manager"),
+ };
+ *features = f;
+ return countof(f);
+}
+
METHOD(plugin_t, destroy, void,
tnc_imv_plugin_t *this)
{
- charon->imvs->destroy(charon->imvs);
+ lib->set(lib, "imv-manager", NULL);
+ this->imvs->destroy(this->imvs);
free(this);
}
tnc_imv_plugin_t *this;
INIT(this,
- .plugin = {
- .get_name = _get_name,
- .reload = (void*)return_false,
- .destroy = _destroy,
+ .public = {
+ .plugin = {
+ .get_name = _get_name,
+ .get_features = _get_features,
+ .destroy = _destroy,
+ },
},
+ .imvs = tnc_imv_manager_create(),
);
- tnc_config = lib->settings->get_str(lib->settings,
- "charon.plugins.tnc-imv.tnc_config", "/etc/tnc_config");
-
- /* Create IMV manager */
- charon->imvs = tnc_imv_manager_create();
+ lib->set(lib, "imv-manager", this->imvs);
/* Load IMVs and abort if not all instances initalize successfully */
- if (!load_imvs(tnc_config))
+ tnc_config = lib->settings->get_str(lib->settings,
+ "charon.plugins.tnc-imv.tnc_config", "/etc/tnc_config");
+ if (!load_imvs(this, tnc_config))
{
- charon->imvs->destroy(charon->imvs);
- charon->imvs = NULL;
- free(this);
+ destroy(this);
return NULL;
}
- return &this->plugin;
+ return &this->public.plugin;
}
*/
imc_manager_t *imcs;
+ /**
+ * TNC IMV manager controlling Integrity Measurement Verifiers
+ */
+ imc_manager_t *imvs;
+
};
METHOD(tnccs_t, send_msg, TNC_Result,
this->send_msg = TRUE;
if (this->is_server)
{
- charon->imvs->receive_message(charon->imvs,
+ this->imvs->receive_message(this->imvs,
this->connection_id, msg_body.ptr, msg_body.len, msg_type);
}
else
this->send_msg = TRUE;
if (this->is_server)
{
- charon->imvs->batch_ending(charon->imvs, this->connection_id);
+ this->imvs->batch_ending(this->imvs, this->connection_id);
}
else
{
.is_server = is_server,
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
.imcs = lib->get(lib, "imc-manager"),
+ .imvs = lib->get(lib, "imv-manager"),
);
return &this->public;
*/
imc_manager_t *imcs;
+ /**
+ * TNC IMV manager controlling Integrity Measurement Verifiers
+ */
+ imv_manager_t *imvs;
+
};
METHOD(tnccs_t, send_msg, TNC_Result,
this->send_msg = TRUE;
if (this->is_server)
{
- charon->imvs->receive_message(charon->imvs,
+ this->imvs->receive_message(this->imvs,
this->connection_id, msg_body.ptr, msg_body.len, msg_type);
}
else
this->send_msg = TRUE;
if (this->is_server)
{
- charon->imvs->batch_ending(charon->imvs, this->connection_id);
+ this->imvs->batch_ending(this->imvs, this->connection_id);
}
else
{
.state_machine = pb_tnc_state_machine_create(is_server),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
.imcs = lib->get(lib, "imc-manager"),
+ .imvs = lib->get(lib, "imv-manager"),
);
return &this->public;
#include "tnccs_manager.h"
#include <imc/imc_manager.h>
-#include <tnc/imv/imv_recommendations.h>
+#include <imv/imv_manager.h>
#include <debug.h>
#include <daemon.h>
*/
imc_manager_t *imcs;
+ /**
+ * TNC IMV manager controlling Integrity Measurement Verifiers
+ */
+ imv_manager_t *imvs;
+
};
METHOD(tnccs_manager_t, add_method, void,
if (recs)
{
/* we assume a TNC Server needing recommendations from IMVs */
- if (!charon->imvs)
+ if (!this->imvs)
+ {
+ this->imvs = lib->get(lib, "imv-manager");
+ }
+ if (!this->imvs)
{
DBG1(DBG_TNC, "no IMV manager available!");
free(entry);
return 0;
}
- entry->recs = charon->imvs->create_recommendations(charon->imvs);
+ entry->recs = this->imvs->create_recommendations(this->imvs);
*recs = entry->recs;
}
else
if (is_server)
{
- if (charon->imvs)
+ if (this->imvs)
{
- charon->imvs->notify_connection_change(charon->imvs, id,
+ this->imvs->notify_connection_change(this->imvs, id,
TNC_CONNECTION_STATE_DELETE);
}
}
.protocol_lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
.connection_lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
.imcs = lib->get(lib, "imc-manager"),
+ .imvs = lib->get(lib, "imv-manager"),
);
return &this->public;
#include "tnccs.h"
-#include <tnc/imv/imv_recommendations.h>
+#include <imv/imv_recommendations.h>
/**
* The TNCCS manager manages all TNCCS implementations and creates instances.
libtnccs_la_LIBADD = $(top_builddir)/src/libtncif/libtncif.la
libtnccs_la_SOURCES = \
- imc/imc.h imc/imc_manager.h
+ imc/imc.h imc/imc_manager.h \
+ imv/imv.h imv/imv_manager.h \
+ imv/imv_recommendations.h imv/imv_recommendations.c
typedef struct imv_manager_t imv_manager_t;
-#ifdef USE_TNC
-
#include "imv.h"
#include "imv_recommendations.h"
void (*destroy)(imv_manager_t *this);
};
-#endif /* USE_TNC */
-
#endif /** IMV_MANAGER_H_ @}*/