Indicate IMV in assessment log statement

This commit is contained in:
Andreas Steffen 2014-04-11 16:58:08 +02:00
parent 3e7044b45e
commit 1d7324133b

View File

@ -177,11 +177,21 @@ METHOD(imc_msg_t, send_, TNC_Result,
/** /**
* Print a clearly visible assessment header to the log * Print a clearly visible assessment header to the log
*/ */
static void print_assessment_header(const char *name, TNC_UInt32 id, bool *first) static void print_assessment_header(const char *name, TNC_UInt32 dst_id,
TNC_UInt32 src_id, bool *first)
{ {
if (*first) if (*first)
{ {
DBG1(DBG_IMC, "***** assessment of IMC %u \"%s\" *****", id, name); if (src_id == TNC_IMCID_ANY)
{
DBG1(DBG_IMC, "***** assessment of IMC %u \"%s\" *****",
dst_id, name);
}
else
{
DBG1(DBG_IMC, "***** assessment of IMC %u \"%s\" from IMV %u *****",
dst_id, name, src_id);
}
*first = FALSE; *first = FALSE;
} }
} }
@ -294,7 +304,7 @@ METHOD(imc_msg_t, receive, TNC_Result,
this->state->set_result(this->state, target_imc_id, result); this->state->set_result(this->state, target_imc_id, result);
print_assessment_header(this->agent->get_name(this->agent), print_assessment_header(this->agent->get_name(this->agent),
target_imc_id, &first); target_imc_id, this->src_id, &first);
DBG1(DBG_IMC, "assessment result is '%N'", DBG1(DBG_IMC, "assessment result is '%N'",
TNC_IMV_Evaluation_Result_names, result); TNC_IMV_Evaluation_Result_names, result);
} }
@ -309,7 +319,7 @@ METHOD(imc_msg_t, receive, TNC_Result,
parameters = attr_cast->get_parameters(attr_cast); parameters = attr_cast->get_parameters(attr_cast);
print_assessment_header(this->agent->get_name(this->agent), print_assessment_header(this->agent->get_name(this->agent),
target_imc_id, &first); target_imc_id, this->src_id, &first);
if (parameters_type.vendor_id == PEN_IETF) if (parameters_type.vendor_id == PEN_IETF)
{ {
switch (parameters_type.type) switch (parameters_type.type)