tnccs-20: Fix build with DEBUG_LEVEL < 2

This commit is contained in:
Tobias Brunner
2023-05-08 17:32:17 +02:00
parent a0ee0cbf90
commit 4a28488a7e
2 changed files with 11 additions and 5 deletions
@@ -141,9 +141,7 @@ METHOD(pb_tnc_batch_t, get_encoding, chunk_t,
METHOD(pb_tnc_batch_t, add_msg, bool,
private_pb_tnc_batch_t *this, pb_tnc_msg_t* msg)
{
enum_name_t *msg_type_names;
chunk_t msg_value;
pen_type_t msg_type;
size_t msg_len;
msg->build(msg);
@@ -157,7 +155,10 @@ METHOD(pb_tnc_batch_t, add_msg, bool,
}
this->batch_len += msg_len;
msg_type = msg->get_type(msg);
#if DEBUG_LEVEL >= 2
pen_type_t msg_type = msg->get_type(msg);
enum_name_t *msg_type_names;
switch (msg_type.vendor_id)
{
default:
@@ -173,6 +174,7 @@ METHOD(pb_tnc_batch_t, add_msg, bool,
}
DBG2(DBG_TNC, "adding %N/%N message", pen_names, msg_type.vendor_id,
msg_type_names, msg_type.type);
#endif
this->messages->insert_last(this->messages, msg);
return TRUE;
}
@@ -329,7 +331,7 @@ static status_t process_tnc_msg(private_pb_tnc_batch_t *this)
uint32_t vendor_id, msg_type, msg_len, offset;
chunk_t data, msg_value;
bool noskip_flag;
enum_name_t *msg_type_names;
enum_name_t *msg_type_names DBG_UNUSED;
pen_type_t msg_pen_type;
status_t status;
@@ -274,6 +274,7 @@ static void handle_ietf_message(private_tnccs_20_client_t *this, pb_tnc_msg_t *m
}
case PB_MSG_ASSESSMENT_RESULT:
{
#if DEBUG_LEVEL >= 1
pb_assessment_result_msg_t *assess_msg;
uint32_t result;
@@ -281,6 +282,7 @@ static void handle_ietf_message(private_tnccs_20_client_t *this, pb_tnc_msg_t *m
result = assess_msg->get_assessment_result(assess_msg);
DBG1(DBG_TNC, "PB-TNC assessment result is '%N'",
TNC_IMV_Evaluation_Result_names, result);
#endif
break;
}
case PB_MSG_ACCESS_RECOMMENDATION:
@@ -312,7 +314,7 @@ static void handle_ietf_message(private_tnccs_20_client_t *this, pb_tnc_msg_t *m
{
pb_remediation_parameters_msg_t *rem_msg;
pen_type_t parameters_type;
chunk_t parameters, string, lang_code;
chunk_t parameters DBG_UNUSED, string DBG_UNUSED, lang_code;
rem_msg = (pb_remediation_parameters_msg_t*)msg;
parameters_type = rem_msg->get_parameters_type(rem_msg);
@@ -347,6 +349,7 @@ static void handle_ietf_message(private_tnccs_20_client_t *this, pb_tnc_msg_t *m
break;
case PB_MSG_REASON_STRING:
{
#if DEBUG_LEVEL >= 1
pb_reason_string_msg_t *reason_msg;
chunk_t reason_string, language_code;
@@ -356,6 +359,7 @@ static void handle_ietf_message(private_tnccs_20_client_t *this, pb_tnc_msg_t *m
DBG1(DBG_TNC, "reason string is '%.*s' [%.*s]",
(int)reason_string.len, reason_string.ptr,
(int)language_code.len, language_code.ptr);
#endif
break;
}
default: