Whitespace cleanups in tnc code

This commit is contained in:
Martin Willi
2011-02-08 11:03:10 +01:00
parent c6c7c7001c
commit 6ccb23e80b
14 changed files with 124 additions and 125 deletions
+15 -15
View File
@@ -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());
@@ -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;
}
@@ -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,
);
@@ -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;
}