final cosmetics in PB-TNC debug output
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 12 Dec 2010 09:17:43 +0000 (10:17 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 12 Dec 2010 09:17:43 +0000 (10:17 +0100)
src/libcharon/plugins/tnccs_20/batch/pb_tnc_batch.c
src/libcharon/plugins/tnccs_20/tnccs_20.c

index 1e0a6bf..3f38543 100644 (file)
@@ -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)
 {
 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);
 }
                                                                           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)
        {
        /* 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;
                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)
        {
        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;
                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)
        {
        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;
                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))
        {
 
        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);
                                           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)
        {
 
        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);
                         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)
                {
 
                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);
                                                  "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
                {
                }
                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;
                                                  "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)
                {
                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,
                                 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))
                {
                   (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);
                                 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)
                {
        {
                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);
                                                  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
                {
                }
                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;
                }
        }
 
                                                  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;
                                   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);
 
        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;
        }
        {
                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)
        {
                                                                                                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(),
        );
 
                .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;
 }
 
        return &this->public;
 }
index 2351632..94db953 100644 (file)
@@ -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);
 
                        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;
                }
                                                   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);
 
                        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;
                }
                                                   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)
        {
  */
 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);
         }
                        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);
        }
 
        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);
                                   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)
                {
 
                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);
                        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);
 
                }
                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);
                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)
                        {
                        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);
                         }
                                        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)
 {
  */
 static void check_and_build_recommendation(private_tnccs_20_t *this)
 {
@@ -464,7 +464,7 @@ METHOD(tls_t, build, status_t,
                        return FAILED;
                }
 
                        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)));
                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,
                        /**
                         * 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)
                        {
                         */
                        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);
                {
                        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);
                                                   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
                {
                }
                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;
                }
                                 pb_tnc_batch_type_names, batch_type);
                        status = INVALID_STATE;
                }
@@ -557,7 +557,7 @@ METHOD(tls_t, build, status_t,
        }
        else
        {
        }
        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);
                status = INVALID_STATE;
        }
        this->mutex->unlock(this->mutex);