Lines Matching refs:imv

79 	struct tnc_if_imv *imv; /* local copy of tncs_global_data->imv */  member
97 struct tnc_if_imv *imv; member
107 struct tnc_if_imv *imv; in tncs_get_imv() local
111 imv = tncs_global_data->imv; in tncs_get_imv()
112 while (imv) { in tncs_get_imv()
113 if (imv->imvID == imvID) in tncs_get_imv()
114 return imv; in tncs_get_imv()
115 imv = imv->next; in tncs_get_imv()
149 struct tnc_if_imv *imv; in TNC_TNCS_ReportMessageTypes() local
160 imv = tncs_get_imv(imvID); in TNC_TNCS_ReportMessageTypes()
161 if (imv == NULL) in TNC_TNCS_ReportMessageTypes()
163 os_free(imv->supported_types); in TNC_TNCS_ReportMessageTypes()
164 imv->supported_types = os_memdup(supportedTypes, in TNC_TNCS_ReportMessageTypes()
166 if (imv->supported_types == NULL) in TNC_TNCS_ReportMessageTypes()
168 imv->num_supported_types = typeCount; in TNC_TNCS_ReportMessageTypes()
333 static int tncs_imv_resolve_funcs(struct tnc_if_imv *imv) in tncs_imv_resolve_funcs() argument
335 void *handle = imv->dlhandle; in tncs_imv_resolve_funcs()
338 imv->Initialize = tncs_get_sym(handle, "TNC_IMV_Initialize"); in tncs_imv_resolve_funcs()
339 if (imv->Initialize == NULL) { in tncs_imv_resolve_funcs()
345 imv->SolicitRecommendation = tncs_get_sym( in tncs_imv_resolve_funcs()
347 if (imv->SolicitRecommendation == NULL) { in tncs_imv_resolve_funcs()
353 imv->ProvideBindFunction = in tncs_imv_resolve_funcs()
355 if (imv->ProvideBindFunction == NULL) { in tncs_imv_resolve_funcs()
362 imv->NotifyConnectionChange = in tncs_imv_resolve_funcs()
364 imv->ReceiveMessage = tncs_get_sym(handle, "TNC_IMV_ReceiveMessage"); in tncs_imv_resolve_funcs()
365 imv->BatchEnding = tncs_get_sym(handle, "TNC_IMV_BatchEnding"); in tncs_imv_resolve_funcs()
366 imv->Terminate = tncs_get_sym(handle, "TNC_IMV_Terminate"); in tncs_imv_resolve_funcs()
372 static int tncs_imv_initialize(struct tnc_if_imv *imv) in tncs_imv_initialize() argument
378 imv->name); in tncs_imv_initialize()
379 res = imv->Initialize(imv->imvID, TNC_IFIMV_VERSION_1, in tncs_imv_initialize()
388 static int tncs_imv_terminate(struct tnc_if_imv *imv) in tncs_imv_terminate() argument
392 if (imv->Terminate == NULL) in tncs_imv_terminate()
396 imv->name); in tncs_imv_terminate()
397 res = imv->Terminate(imv->imvID); in tncs_imv_terminate()
405 static int tncs_imv_provide_bind_function(struct tnc_if_imv *imv) in tncs_imv_provide_bind_function() argument
410 "IMV '%s'", imv->name); in tncs_imv_provide_bind_function()
411 res = imv->ProvideBindFunction(imv->imvID, TNC_TNCS_BindFunction); in tncs_imv_provide_bind_function()
419 static int tncs_imv_notify_connection_change(struct tnc_if_imv *imv, in tncs_imv_notify_connection_change() argument
425 if (imv->NotifyConnectionChange == NULL) in tncs_imv_notify_connection_change()
429 " for IMV '%s'", (int) state, imv->name); in tncs_imv_notify_connection_change()
430 res = imv->NotifyConnectionChange(imv->imvID, conn, state); in tncs_imv_notify_connection_change()
438 static int tncs_load_imv(struct tnc_if_imv *imv) in tncs_load_imv() argument
440 if (imv->path == NULL) { in tncs_load_imv()
446 imv->name, imv->path); in tncs_load_imv()
447 imv->dlhandle = dlopen(imv->path, RTLD_LAZY); in tncs_load_imv()
448 if (imv->dlhandle == NULL) { in tncs_load_imv()
450 imv->name, imv->path, dlerror()); in tncs_load_imv()
454 if (tncs_imv_resolve_funcs(imv) < 0) { in tncs_load_imv()
459 if (tncs_imv_initialize(imv) < 0 || in tncs_load_imv()
460 tncs_imv_provide_bind_function(imv) < 0) { in tncs_load_imv()
469 static void tncs_free_imv(struct tnc_if_imv *imv) in tncs_free_imv() argument
471 os_free(imv->name); in tncs_free_imv()
472 os_free(imv->path); in tncs_free_imv()
473 os_free(imv->supported_types); in tncs_free_imv()
476 static void tncs_unload_imv(struct tnc_if_imv *imv) in tncs_unload_imv() argument
478 tncs_imv_terminate(imv); in tncs_unload_imv()
480 if (imv->dlhandle) in tncs_unload_imv()
481 dlclose(imv->dlhandle); in tncs_unload_imv()
483 tncs_free_imv(imv); in tncs_unload_imv()
487 static int tncs_supported_type(struct tnc_if_imv *imv, unsigned int type) in tncs_supported_type() argument
492 if (imv == NULL || imv->supported_types == NULL) in tncs_supported_type()
498 for (i = 0; i < imv->num_supported_types; i++) { in tncs_supported_type()
500 svendor = imv->supported_types[i] >> 8; in tncs_supported_type()
501 ssubtype = imv->supported_types[i] & 0xff; in tncs_supported_type()
514 struct tnc_if_imv *imv; in tncs_send_to_imvs() local
519 for (imv = tncs->imv; imv; imv = imv->next) { in tncs_send_to_imvs()
520 if (imv->ReceiveMessage == NULL || in tncs_send_to_imvs()
521 !tncs_supported_type(imv, type)) in tncs_send_to_imvs()
525 imv->name); in tncs_send_to_imvs()
526 res = imv->ReceiveMessage(imv->imvID, tncs->connectionID, in tncs_send_to_imvs()
537 struct tnc_if_imv *imv; in tncs_batch_ending() local
540 for (imv = tncs->imv; imv; imv = imv->next) { in tncs_batch_ending()
541 if (imv->BatchEnding == NULL) in tncs_batch_ending()
545 imv->name); in tncs_batch_ending()
546 res = imv->BatchEnding(imv->imvID, tncs->connectionID); in tncs_batch_ending()
555 struct tnc_if_imv *imv; in tncs_solicit_recommendation() local
558 for (imv = tncs->imv; imv; imv = imv->next) { in tncs_solicit_recommendation()
559 if (tncs->imv_data[imv->imvID].recommendation_set) in tncs_solicit_recommendation()
563 "IMV '%s'", imv->name); in tncs_solicit_recommendation()
564 res = imv->SolicitRecommendation(imv->imvID, in tncs_solicit_recommendation()
574 struct tnc_if_imv *imv; in tncs_init_connection() local
577 for (imv = tncs->imv; imv; imv = imv->next) { in tncs_init_connection()
579 imv, tncs->connectionID, TNC_CONNECTION_STATE_CREATE); in tncs_init_connection()
581 imv, tncs->connectionID, in tncs_init_connection()
694 struct tnc_if_imv *imv; in tncs_derive_recommendation() local
707 for (imv = tncs->imv; imv; imv = imv->next) { in tncs_derive_recommendation()
709 irec = tncs->imv_data[imv->imvID].recommendation; in tncs_derive_recommendation()
757 for (imv = tncs->imv; imv; imv = imv->next) { in tncs_derive_recommendation()
758 tncs_imv_notify_connection_change(imv, tncs->connectionID, in tncs_derive_recommendation()
961 struct tnc_if_imv *imv; in tncs_parse_imv() local
969 imv = os_zalloc(sizeof(*imv)); in tncs_parse_imv()
970 if (imv == NULL) { in tncs_parse_imv()
975 imv->imvID = id; in tncs_parse_imv()
982 os_free(imv); in tncs_parse_imv()
993 os_free(imv); in tncs_parse_imv()
998 imv->name = os_strdup(pos); in tncs_parse_imv()
1004 os_free(imv); in tncs_parse_imv()
1010 imv->path = os_strdup(pos); in tncs_parse_imv()
1012 return imv; in tncs_parse_imv()
1020 struct tnc_if_imv *imv, *last; in tncs_read_config() local
1043 imv = tncs_parse_imv(id++, pos + 4, line_end, &error); in tncs_read_config()
1046 if (imv) { in tncs_read_config()
1048 global->imv = imv; in tncs_read_config()
1050 last->next = imv; in tncs_read_config()
1051 last = imv; in tncs_read_config()
1072 tncs->imv = tncs_global_data->imv; in tncs_init()
1113 struct tnc_if_imv *imv; in tncs_global_init() local
1127 for (imv = tncs_global_data->imv; imv; imv = imv->next) { in tncs_global_init()
1128 if (tncs_load_imv(imv)) { in tncs_global_init()
1130 imv->name); in tncs_global_init()
1145 struct tnc_if_imv *imv, *prev; in tncs_global_deinit() local
1150 imv = tncs_global_data->imv; in tncs_global_deinit()
1151 while (imv) { in tncs_global_deinit()
1152 tncs_unload_imv(imv); in tncs_global_deinit()
1154 prev = imv; in tncs_global_deinit()
1155 imv = imv->next; in tncs_global_deinit()