tnc/tncif.h tnc/tncifimc.h tnc/tncifimv.h \
tnc/tncifimv_names.h tnc/tncifimv_names.c \
tnc/imc/imc.h tnc/imc/imc_manager.h \
-tnc/imv/imv.h tnc/imv/imv_manager.h tnc/imv/imv_recommendations.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
* Next IMV ID to be assigned
*/
TNC_IMVID next_imv_id;
+
+ /**
+ * Policy defining how to derive final recommendation from individual ones
+ */
+ recommendation_policy_t policy;
};
METHOD(imv_manager_t, add, bool,
imv_manager_t* tnc_imv_manager_create(void)
{
private_tnc_imv_manager_t *this;
+ recommendation_policy_t policy;
INIT(this,
.public = {
.imvs = linked_list_create(),
.next_imv_id = 1,
);
+ policy = enum_from_name(recommendation_policy_names,
+ lib->settings->get_str(lib->settings,
+ "charon.plugins.tnc-imv.recommendation_policy", "any"));
+ this->policy = (policy != -1) ? policy : RECOMMENDATION_POLICY_NONE;
return &this->public;
}
--- /dev/null
+/*
+ * Copyright (C) 2010 Andreas Steffen
+ * HSR 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 "imv_recommendations.h"
+
+ENUM(recommendation_policy_names, RECOMMENDATION_POLICY_NONE,
+ RECOMMENDATION_POLICY_ALL,
+ "none",
+ "any",
+ "all"
+);
+
#include <tnc/tncifimv.h>
#include <library.h>
+typedef enum recommendation_policy_t recommendation_policy_t;
+
+enum recommendation_policy_t {
+ RECOMMENDATION_POLICY_NONE,
+ RECOMMENDATION_POLICY_ANY,
+ RECOMMENDATION_POLICY_ALL
+};
+
+extern enum_name_t *recommendation_policy_names;
+
+
typedef struct recommendations_t recommendations_t;
/**