From: Tobias Brunner Date: Tue, 18 Apr 2023 15:35:36 +0000 (+0200) Subject: tnccs-20: Fix build with DEBUG_LEVEL < 2 X-Git-Tag: 5.9.11rc1~12^2~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a28488a7e50722a0bb3b599422c78d7c9e36829;p=thirdparty%2Fstrongswan.git tnccs-20: Fix build with DEBUG_LEVEL < 2 --- diff --git a/src/libtnccs/plugins/tnccs_20/batch/pb_tnc_batch.c b/src/libtnccs/plugins/tnccs_20/batch/pb_tnc_batch.c index 096e4cc625..48f8bd7832 100644 --- a/src/libtnccs/plugins/tnccs_20/batch/pb_tnc_batch.c +++ b/src/libtnccs/plugins/tnccs_20/batch/pb_tnc_batch.c @@ -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; diff --git a/src/libtnccs/plugins/tnccs_20/tnccs_20_client.c b/src/libtnccs/plugins/tnccs_20/tnccs_20_client.c index 1807d82f9a..0e31e729d6 100644 --- a/src/libtnccs/plugins/tnccs_20/tnccs_20_client.c +++ b/src/libtnccs/plugins/tnccs_20/tnccs_20_client.c @@ -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: