diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-12-12 10:17:43 +0100 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-12-12 10:17:43 +0100 |
commit | 41216e6518324677019f47c16ecc17e6f2b66f8d (patch) | |
tree | 1b683a2a0a183e8a866eab7f6214244eb6d21f2c /src | |
parent | 54eb669dd5bc99b350383f5defb7c638ae6676bb (diff) | |
download | strongswan-41216e6518324677019f47c16ecc17e6f2b66f8d.tar.bz2 strongswan-41216e6518324677019f47c16ecc17e6f2b66f8d.tar.xz |
final cosmetics in PB-TNC debug output
Diffstat (limited to 'src')
-rw-r--r-- | src/libcharon/plugins/tnccs_20/batch/pb_tnc_batch.c | 33 | ||||
-rw-r--r-- | src/libcharon/plugins/tnccs_20/tnccs_20.c | 28 |
2 files changed, 30 insertions, 31 deletions
diff --git a/src/libcharon/plugins/tnccs_20/batch/pb_tnc_batch.c b/src/libcharon/plugins/tnccs_20/batch/pb_tnc_batch.c index 1e0a6bf97..3f38543ed 100644 --- a/src/libcharon/plugins/tnccs_20/batch/pb_tnc_batch.c +++ b/src/libcharon/plugins/tnccs_20/batch/pb_tnc_batch.c @@ -129,7 +129,7 @@ METHOD(pb_tnc_batch_t, get_encoding, chunk_t, METHOD(pb_tnc_batch_t, add_msg, void, private_pb_tnc_batch_t *this, pb_tnc_msg_t* msg) { - DBG2(DBG_TNC, "adding %N Message", pb_tnc_msg_type_names, + DBG2(DBG_TNC, "adding %N message", pb_tnc_msg_type_names, msg->get_type(msg)); this->messages->insert_last(this->messages, msg); } @@ -219,7 +219,7 @@ static status_t process_batch_header(private_pb_tnc_batch_t *this, /* Version */ if (version != PB_TNC_VERSION) { - DBG1(DBG_TNC, "unsupported TNCCS Batch Version 0x%01x", version); + DBG1(DBG_TNC, "unsupported TNCCS batch version 0x%01x", version); msg = pb_error_msg_create(TRUE, IETF_VENDOR_ID, PB_ERROR_VERSION_NOT_SUPPORTED); err_msg = (pb_error_msg_t*)msg; @@ -231,8 +231,8 @@ static status_t process_batch_header(private_pb_tnc_batch_t *this, directionality = (flags & PB_TNC_BATCH_FLAG_D) != PB_TNC_BATCH_FLAG_NONE; if (directionality == this->is_server) { - DBG1(DBG_TNC, "wrong Directionality: Batch is from a PB %s", - directionality ? "Server" : "Client"); + DBG1(DBG_TNC, "wrong Directionality: batch is from a PB %s", + directionality ? "server" : "client"); msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID, PB_ERROR_INVALID_PARAMETER, 1); goto fatal; @@ -242,7 +242,7 @@ static status_t process_batch_header(private_pb_tnc_batch_t *this, this->type = type & 0x0F; if (this->type > PB_BATCH_ROOF) { - DBG1(DBG_TNC, "unknown PB-TNC Batch Type: %d", this->type); + DBG1(DBG_TNC, "unknown PB-TNC batch type: %d", this->type); msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID, PB_ERROR_INVALID_PARAMETER, 3); goto fatal; @@ -250,7 +250,7 @@ static status_t process_batch_header(private_pb_tnc_batch_t *this, if (!state_machine->receive_batch(state_machine, this->type)) { - DBG1(DBG_TNC, "unexpected PB-TNC Batch Type: %N", + DBG1(DBG_TNC, "unexpected PB-TNC batch type: %N", pb_tnc_batch_type_names, this->type); msg = pb_error_msg_create(TRUE, IETF_VENDOR_ID, PB_ERROR_UNEXPECTED_BATCH_TYPE); @@ -324,7 +324,7 @@ static status_t process_tnc_msg(private_pb_tnc_batch_t *this) if (msg_type == PB_TNC_RESERVED_MSG_TYPE) { - DBG1(DBG_TNC, "PB-TNC Message Type 0x%08x is reserved", + DBG1(DBG_TNC, "PB-TNC message Type 0x%08x is reserved", PB_TNC_RESERVED_MSG_TYPE); msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID, PB_ERROR_INVALID_PARAMETER, this->offset + 4); @@ -345,7 +345,7 @@ static status_t process_tnc_msg(private_pb_tnc_batch_t *this) if (noskip_flag) { - DBG1(DBG_TNC, "reject PB-TNC Message (Vendor ID 0x%06x / " + DBG1(DBG_TNC, "reject PB-TNC message (Vendor ID 0x%06x / " "Type 0x%08x)", vendor_id, msg_type); msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID, PB_ERROR_UNSUPPORTED_MANDATORY_MSG, this->offset); @@ -353,7 +353,7 @@ static status_t process_tnc_msg(private_pb_tnc_batch_t *this) } else { - DBG1(DBG_TNC, "ignore PB-TNC Message (Vendor ID 0x%06x / " + DBG1(DBG_TNC, "ignore PB-TNC message (Vendor ID 0x%06x / " "Type 0x%08x)", vendor_id, msg_type); this->offset += msg_len; return SUCCESS; @@ -364,7 +364,7 @@ static status_t process_tnc_msg(private_pb_tnc_batch_t *this) if (pb_tnc_msg_infos[msg_type].has_noskip_flag != TRUE_OR_FALSE && pb_tnc_msg_infos[msg_type].has_noskip_flag != noskip_flag) { - DBG1(DBG_TNC, "%N Message must%s have NOSKIP flag set", + DBG1(DBG_TNC, "%N message must%s have NOSKIP flag set", pb_tnc_msg_type_names, msg_type, pb_tnc_msg_infos[msg_type].has_noskip_flag ? "" : " not"); msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID, @@ -376,7 +376,7 @@ static status_t process_tnc_msg(private_pb_tnc_batch_t *this) (pb_tnc_msg_infos[msg_type].exact_size && msg_len != pb_tnc_msg_infos[msg_type].min_size)) { - DBG1(DBG_TNC, "%N Message length must be %s %u bytes but is %u bytes", + DBG1(DBG_TNC, "%N message length must be %s %u bytes but is %u bytes", pb_tnc_msg_type_names, msg_type, pb_tnc_msg_infos[msg_type].exact_size ? "exactly" : "at least", pb_tnc_msg_infos[msg_type].min_size, msg_len); @@ -391,7 +391,7 @@ static status_t process_tnc_msg(private_pb_tnc_batch_t *this) { if (this->is_server) { - DBG1(DBG_TNC,"reject %N Message received from a PB-TNC Client", + DBG1(DBG_TNC,"reject %N message received from a PB-TNC client", pb_tnc_msg_type_names, msg_type); msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID, PB_ERROR_INVALID_PARAMETER, this->offset); @@ -399,17 +399,16 @@ static status_t process_tnc_msg(private_pb_tnc_batch_t *this) } else { - DBG1(DBG_TNC,"ignore %N Message not received within RESULT batch", + DBG1(DBG_TNC,"ignore %N message not received within RESULT batch", pb_tnc_msg_type_names, msg_type); this->offset += msg_len; return SUCCESS; } } - DBG2(DBG_TNC, "processing %N Message (%u bytes)", pb_tnc_msg_type_names, + DBG2(DBG_TNC, "processing %N message (%u bytes)", pb_tnc_msg_type_names, msg_type, msg_len); data.len = msg_len; - DBG3(DBG_TNC, "%B", &data); msg_value = chunk_skip(data, PB_TNC_HEADER_SIZE); pb_tnc_msg = pb_tnc_msg_create_from_data(msg_type, msg_value); @@ -444,7 +443,7 @@ METHOD(pb_tnc_batch_t, process, status_t, { return FAILED; } - DBG1(DBG_TNC, "processing PB-TNC %N Batch", pb_tnc_batch_type_names, + DBG1(DBG_TNC, "processing PB-TNC %N batch", pb_tnc_batch_type_names, this->type); while (this->offset < this->encoding.len) { @@ -510,7 +509,7 @@ pb_tnc_batch_t* pb_tnc_batch_create(bool is_server, pb_tnc_batch_type_t type) .errors = linked_list_create(), ); - DBG2(DBG_TNC, "creating PB-TNC %N Batch", pb_tnc_batch_type_names, type); + DBG2(DBG_TNC, "creating PB-TNC %N batch", pb_tnc_batch_type_names, type); return &this->public; } diff --git a/src/libcharon/plugins/tnccs_20/tnccs_20.c b/src/libcharon/plugins/tnccs_20/tnccs_20.c index 235163261..94db953b5 100644 --- a/src/libcharon/plugins/tnccs_20/tnccs_20.c +++ b/src/libcharon/plugins/tnccs_20/tnccs_20.c @@ -164,7 +164,7 @@ static void handle_msg(private_tnccs_20_t *this, pb_tnc_msg_t *msg) assess_msg = (pb_assessment_result_msg_t*)msg; result = assess_msg->get_assessment_result(assess_msg); - DBG1(DBG_TNC, "assessment result is '%N'", + DBG1(DBG_TNC, "PB-TNC assessment result is '%N'", evaluation_result_names, result); break; } @@ -175,7 +175,7 @@ static void handle_msg(private_tnccs_20_t *this, pb_tnc_msg_t *msg) rec_msg = (pb_access_recommendation_msg_t*)msg; rec = rec_msg->get_access_recommendation(rec_msg); - DBG1(DBG_TNC, "access recommendation is '%N'", + DBG1(DBG_TNC, "PB-TNC access recommendation is '%N'", pb_access_recommendation_code_names, rec); break; } @@ -271,13 +271,13 @@ static void handle_msg(private_tnccs_20_t *this, pb_tnc_msg_t *msg) } /** - * Build a CRETRY or SRETRY Batch + * Build a CRETRY or SRETRY batch */ static void build_retry_batch(private_tnccs_20_t *this) { if (this->batch) { - DBG1(DBG_TNC, "cancelling PB-TNC %N Batch", + DBG1(DBG_TNC, "cancelling PB-TNC %N batch", pb_tnc_batch_type_names, this->batch->get_type(this->batch)); this->batch->destroy(this->batch); } @@ -308,7 +308,7 @@ METHOD(tls_t, process, status_t, } data = chunk_create(buf, buflen); - DBG1(DBG_TNC, "received TNCCS Batch (%u bytes) for Connection ID %u", + DBG1(DBG_TNC, "received TNCCS batch (%u bytes) for connection ID %u", data.len, this->connection_id); DBG3(DBG_TNC, "%B", &data); batch = pb_tnc_batch_create_from_data(this->is_server, data); @@ -325,7 +325,7 @@ METHOD(tls_t, process, status_t, if (batch_type == PB_BATCH_CRETRY) { - /* Send an SRETRY Batch in response */ + /* Send an SRETRY batch in response */ this->mutex->lock(this->mutex); build_retry_batch(this); this->mutex->unlock(this->mutex); @@ -346,7 +346,7 @@ METHOD(tls_t, process, status_t, } enumerator->destroy(enumerator); - /* received an empty CLOSE Batch from PB-TNC Client */ + /* received an empty CLOSE batch from PB-TNC client */ if (this->is_server && batch_type == PB_BATCH_CLOSE && empty) { batch->destroy(batch); @@ -379,7 +379,7 @@ METHOD(tls_t, process, status_t, this->mutex->lock(this->mutex); if (this->batch) { - DBG1(DBG_TNC, "cancelling PB-TNC %N Batch", + DBG1(DBG_TNC, "cancelling PB-TNC %N batch", pb_tnc_batch_type_names, this->batch->get_type(this->batch)); this->batch->destroy(this->batch); } @@ -406,7 +406,7 @@ METHOD(tls_t, process, status_t, } /** - * Build a RESULT Batch if a final recommendation is available + * Build a RESULT batch if a final recommendation is available */ static void check_and_build_recommendation(private_tnccs_20_t *this) { @@ -464,7 +464,7 @@ METHOD(tls_t, build, status_t, return FAILED; } - /* Create PB-TNC Language Preference Message */ + /* Create PB-TNC Language Preference message */ pref_lang = charon->imcs->get_preferred_language(charon->imcs); msg = pb_language_preference_msg_create(chunk_create(pref_lang, strlen(pref_lang))); @@ -515,7 +515,7 @@ METHOD(tls_t, build, status_t, /** * if the DECIDED state has been reached and no CRETRY is under way * or if a CLOSE batch with error messages has been received, - * reply with an empty CLOSE batch. + * a PB-TNC client replies with an empty CLOSE batch. */ if (state == PB_STATE_DECIDED || state == PB_STATE_END) { @@ -535,7 +535,7 @@ METHOD(tls_t, build, status_t, { this->batch->build(this->batch); data = this->batch->get_encoding(this->batch); - DBG1(DBG_TNC, "sending PB-TNC %N Batch (%d bytes) for Connection ID %u", + DBG1(DBG_TNC, "sending PB-TNC %N batch (%d bytes) for connection ID %u", pb_tnc_batch_type_names, batch_type, data.len, this->connection_id); DBG3(DBG_TNC, "%B", &data); @@ -547,7 +547,7 @@ METHOD(tls_t, build, status_t, } else { - DBG1(DBG_TNC, "cancelling unexpected PB-TNC Batch Type: %N", + DBG1(DBG_TNC, "cancelling unexpected PB-TNC batch type: %N", pb_tnc_batch_type_names, batch_type); status = INVALID_STATE; } @@ -557,7 +557,7 @@ METHOD(tls_t, build, status_t, } else { - DBG1(DBG_TNC, "no TNCCS Batch to send"); + DBG1(DBG_TNC, "no TNCCS batch to send"); status = INVALID_STATE; } this->mutex->unlock(this->mutex); |