diff options
| author | Martin Willi <martin@revosec.ch> | 2011-02-08 10:56:06 +0100 |
|---|---|---|
| committer | Martin Willi <martin@revosec.ch> | 2011-02-08 11:03:10 +0100 |
| commit | 6ccb23e80b821ba89bcabbe0fde00acdfe5f8a67 (patch) | |
| tree | 1ec40c5158ce486d3444a840bda598748e8274ed /src/libcharon/plugins/tnc_imv | |
| parent | c6c7c7001cd0e53a81464a6376cad3bcf857cdd0 (diff) | |
| download | strongswan-6ccb23e80b821ba89bcabbe0fde00acdfe5f8a67.tar.bz2 strongswan-6ccb23e80b821ba89bcabbe0fde00acdfe5f8a67.tar.xz | |
Whitespace cleanups in tnc code
Diffstat (limited to 'src/libcharon/plugins/tnc_imv')
| -rw-r--r-- | src/libcharon/plugins/tnc_imv/tnc_imv.c | 30 | ||||
| -rw-r--r-- | src/libcharon/plugins/tnc_imv/tnc_imv_bind_function.c | 14 | ||||
| -rw-r--r-- | src/libcharon/plugins/tnc_imv/tnc_imv_manager.c | 6 | ||||
| -rw-r--r-- | src/libcharon/plugins/tnc_imv/tnc_imv_recommendations.c | 12 |
4 files changed, 31 insertions, 31 deletions
diff --git a/src/libcharon/plugins/tnc_imv/tnc_imv.c b/src/libcharon/plugins/tnc_imv/tnc_imv.c index 42d2ab064..f88b645d6 100644 --- a/src/libcharon/plugins/tnc_imv/tnc_imv.c +++ b/src/libcharon/plugins/tnc_imv/tnc_imv.c @@ -108,19 +108,19 @@ METHOD(imv_t, type_supported, bool, TNC_MessageSubtype msg_subtype, subtype; int i; - msg_vid = (message_type >> 8) & TNC_VENDORID_ANY; + msg_vid = (message_type >> 8) & TNC_VENDORID_ANY; msg_subtype = message_type & TNC_SUBTYPE_ANY; for (i = 0; i < this->type_count; i++) { - vid = (this->supported_types[i] >> 8) & TNC_VENDORID_ANY; - subtype = this->supported_types[i] & TNC_SUBTYPE_ANY; + vid = (this->supported_types[i] >> 8) & TNC_VENDORID_ANY; + subtype = this->supported_types[i] & TNC_SUBTYPE_ANY; - if (this->supported_types[i] == message_type + if (this->supported_types[i] == message_type || (subtype == TNC_SUBTYPE_ANY && (msg_vid == vid || vid == TNC_VENDORID_ANY)) - || (vid == TNC_VENDORID_ANY - && (msg_subtype == subtype || subtype == TNC_SUBTYPE_ANY))) + || (vid == TNC_VENDORID_ANY + && (msg_subtype == subtype || subtype == TNC_SUBTYPE_ANY))) { return TRUE; } @@ -153,7 +153,7 @@ imv_t* tnc_imv_create(char *name, char *path) .set_message_types = _set_message_types, .type_supported = _type_supported, .destroy = _destroy, - }, + }, .name = name, .path = path, ); @@ -168,7 +168,7 @@ imv_t* tnc_imv_create(char *name, char *path) this->public.initialize = dlsym(this->handle, "TNC_IMV_Initialize"); if (!this->public.initialize) - { + { DBG1(DBG_TNC, "could not resolve TNC_IMV_Initialize in %s: %s\n", path, dlerror()); dlclose(this->handle); @@ -177,25 +177,25 @@ imv_t* tnc_imv_create(char *name, char *path) } this->public.notify_connection_change = dlsym(this->handle, "TNC_IMV_NotifyConnectionChange"); - this->public.solicit_recommendation = + this->public.solicit_recommendation = dlsym(this->handle, "TNC_IMV_SolicitRecommendation"); if (!this->public.solicit_recommendation) - { + { DBG1(DBG_TNC, "could not resolve TNC_IMV_SolicitRecommendation in %s: %s\n", path, dlerror()); dlclose(this->handle); free(this); return NULL; } - this->public.receive_message = + this->public.receive_message = dlsym(this->handle, "TNC_IMV_ReceiveMessage"); - this->public.batch_ending = + this->public.batch_ending = dlsym(this->handle, "TNC_IMV_BatchEnding"); - this->public.terminate = + this->public.terminate = dlsym(this->handle, "TNC_IMV_Terminate"); - this->public.provide_bind_function = + this->public.provide_bind_function = dlsym(this->handle, "TNC_IMV_ProvideBindFunction"); - if (!this->public.provide_bind_function) + if (!this->public.provide_bind_function) { DBG1(DBG_TNC, "could not resolve TNC_IMV_ProvideBindFunction in %s: %s\n", path, dlerror()); diff --git a/src/libcharon/plugins/tnc_imv/tnc_imv_bind_function.c b/src/libcharon/plugins/tnc_imv/tnc_imv_bind_function.c index f6e9c5e32..0ea52f08e 100644 --- a/src/libcharon/plugins/tnc_imv/tnc_imv_bind_function.c +++ b/src/libcharon/plugins/tnc_imv/tnc_imv_bind_function.c @@ -109,29 +109,29 @@ TNC_Result TNC_TNCS_BindFunction(TNC_IMVID id, { *function_pointer = (void*)TNC_TNCS_ReportMessageTypes; } - else if (streq(function_name, "TNC_TNCS_RequestHandshakeRetry")) + else if (streq(function_name, "TNC_TNCS_RequestHandshakeRetry")) { *function_pointer = (void*)TNC_TNCS_RequestHandshakeRetry; } - else if (streq(function_name, "TNC_TNCS_SendMessage")) + else if (streq(function_name, "TNC_TNCS_SendMessage")) { *function_pointer = (void*)TNC_TNCS_SendMessage; } - else if (streq(function_name, "TNC_TNCS_ProvideRecommendation")) + else if (streq(function_name, "TNC_TNCS_ProvideRecommendation")) { *function_pointer = (void*)TNC_TNCS_ProvideRecommendation; } - else if (streq(function_name, "TNC_TNCS_GetAttribute")) + else if (streq(function_name, "TNC_TNCS_GetAttribute")) { *function_pointer = (void*)TNC_TNCS_GetAttribute; } - else if (streq(function_name, "TNC_TNCS_SetAttribute")) + else if (streq(function_name, "TNC_TNCS_SetAttribute")) { *function_pointer = (void*)TNC_TNCS_SetAttribute; } - else + else { return TNC_RESULT_INVALID_PARAMETER; } - return TNC_RESULT_SUCCESS; + return TNC_RESULT_SUCCESS; } diff --git a/src/libcharon/plugins/tnc_imv/tnc_imv_manager.c b/src/libcharon/plugins/tnc_imv/tnc_imv_manager.c index b098200cd..559de86d0 100644 --- a/src/libcharon/plugins/tnc_imv/tnc_imv_manager.c +++ b/src/libcharon/plugins/tnc_imv/tnc_imv_manager.c @@ -68,7 +68,7 @@ METHOD(imv_manager_t, add, bool, this->imvs->insert_last(this->imvs, imv); this->next_imv_id++; - if (imv->provide_bind_function(imv->get_id(imv), TNC_TNCS_BindFunction) + if (imv->provide_bind_function(imv->get_id(imv), TNC_TNCS_BindFunction) != TNC_RESULT_SUCCESS) { DBG1(DBG_TNC, "IMV \"%s\" could failed to obtain bind function", @@ -124,7 +124,7 @@ METHOD(imv_manager_t, enforce_recommendation, bool, case TNC_IMV_ACTION_RECOMMENDATION_ALLOW: DBG1(DBG_TNC, "TNC recommendation is allow"); group = "allow"; - break; + break; case TNC_IMV_ACTION_RECOMMENDATION_ISOLATE: DBG1(DBG_TNC, "TNC recommendation is isolate"); group = "isolate"; @@ -280,7 +280,7 @@ imv_manager_t* tnc_imv_manager_create(void) .receive_message = _receive_message, .batch_ending = _batch_ending, .destroy = _destroy, - }, + }, .imvs = linked_list_create(), .next_imv_id = 1, ); diff --git a/src/libcharon/plugins/tnc_imv/tnc_imv_recommendations.c b/src/libcharon/plugins/tnc_imv/tnc_imv_recommendations.c index 3f701a4d1..5cc6b0ced 100644 --- a/src/libcharon/plugins/tnc_imv/tnc_imv_recommendations.c +++ b/src/libcharon/plugins/tnc_imv/tnc_imv_recommendations.c @@ -54,7 +54,7 @@ struct recommendation_entry_t { /** * Reason language provided by IMV instance */ - chunk_t reason_language; + chunk_t reason_language; }; /** @@ -68,7 +68,7 @@ struct private_tnc_imv_recommendations_t { recommendations_t public; /** - * list of recommendations and evaluations provided by IMVs + * list of recommendations and evaluations provided by IMVs */ linked_list_t *recs; @@ -347,7 +347,7 @@ static bool reason_filter(void *null, recommendation_entry_t **entry, else { return FALSE; - } + } } METHOD(recommendations_t, create_reason_enumerator, enumerator_t*, @@ -393,7 +393,7 @@ recommendations_t* tnc_imv_recommendations_create(linked_list_t *imv_list) .set_reason_language = _set_reason_language, .create_reason_enumerator = _create_reason_enumerator, .destroy = _destroy, - }, + }, .recs = linked_list_create(), ); @@ -407,9 +407,9 @@ recommendations_t* tnc_imv_recommendations_create(linked_list_t *imv_list) entry->eval = TNC_IMV_EVALUATION_RESULT_DONT_KNOW; entry->reason = chunk_empty; entry->reason_language = chunk_empty; - this->recs->insert_last(this->recs, entry); + this->recs->insert_last(this->recs, entry); } - enumerator->destroy(enumerator); + enumerator->destroy(enumerator); return &this->public; } |
