Home | History | Annotate | Download | only in eap_server

Lines Matching refs:imv

2  * EAP-TNC - TNCS (IF-IMV, IF-TNCCS, and IF-TNCCS-SOH)
32 /* TNC IF-IMV */
145 struct tnc_if_imv *imv; /* local copy of tncs_global_data->imv */
163 struct tnc_if_imv *imv;
173 struct tnc_if_imv *imv;
177 imv = tncs_global_data->imv;
178 while (imv) {
179 if (imv->imvID == imvID)
180 return imv;
181 imv = imv->next;
215 struct tnc_if_imv *imv;
226 imv = tncs_get_imv(imvID);
227 if (imv == NULL)
229 os_free(imv->supported_types);
230 imv->supported_types =
232 if (imv->supported_types == NULL)
234 os_memcpy(imv->supported_types, supportedTypes,
236 imv->num_supported_types = typeCount;
281 "<IMC-IMV-Message><Type>%08X</Type>"
282 "<Base64>%s</Base64></IMC-IMV-Message>",
401 static int tncs_imv_resolve_funcs(struct tnc_if_imv *imv)
403 void *handle = imv->dlhandle;
405 /* Mandatory IMV functions */
406 imv->Initialize = tncs_get_sym(handle, "TNC_IMV_Initialize");
407 if (imv->Initialize == NULL) {
408 wpa_printf(MSG_ERROR, "TNC: IMV does not export "
413 imv->SolicitRecommendation = tncs_get_sym(
415 if (imv->SolicitRecommendation == NULL) {
416 wpa_printf(MSG_ERROR, "TNC: IMV does not export "
421 imv->ProvideBindFunction =
423 if (imv->ProvideBindFunction == NULL) {
424 wpa_printf(MSG_ERROR, "TNC: IMV does not export "
429 /* Optional IMV functions */
430 imv->NotifyConnectionChange =
432 imv->ReceiveMessage = tncs_get_sym(handle, "TNC_IMV_ReceiveMessage");
433 imv->BatchEnding = tncs_get_sym(handle, "TNC_IMV_BatchEnding");
434 imv->Terminate = tncs_get_sym(handle, "TNC_IMV_Terminate");
440 static int tncs_imv_initialize(struct tnc_if_imv *imv)
445 wpa_printf(MSG_DEBUG, "TNC: Calling TNC_IMV_Initialize for IMV '%s'",
446 imv->name);
447 res = imv->Initialize(imv->imvID, TNC_IFIMV_VERSION_1,
456 static int tncs_imv_terminate(struct tnc_if_imv *imv)
460 if (imv->Terminate == NULL)
463 wpa_printf(MSG_DEBUG, "TNC: Calling TNC_IMV_Terminate for IMV '%s'",
464 imv->name);
465 res = imv->Terminate(imv->imvID);
473 static int tncs_imv_provide_bind_function(struct tnc_if_imv *imv)
478 "IMV '%s'", imv->name);
479 res = imv->ProvideBindFunction(imv->imvID, TNC_TNCS_BindFunction);
487 static int tncs_imv_notify_connection_change(struct tnc_if_imv *imv,
493 if (imv->NotifyConnectionChange == NULL)
497 " for IMV '%s'", (int) state, imv->name);
498 res = imv->NotifyConnectionChange(imv->imvID, conn, state);
506 static int tncs_load_imv(struct tnc_if_imv *imv)
508 if (imv->path == NULL) {
509 wpa_printf(MSG_DEBUG, "TNC: No IMV configured");
513 wpa_printf(MSG_DEBUG, "TNC: Opening IMV: %s (%s)",
514 imv->name, imv->path);
515 imv->dlhandle = dlopen(imv->path, RTLD_LAZY);
516 if (imv->dlhandle == NULL) {
517 wpa_printf(MSG_ERROR, "TNC: Failed to open IMV '%s' (%s): %s",
518 imv->name, imv->path, dlerror());
522 if (tncs_imv_resolve_funcs(imv) < 0) {
523 wpa_printf(MSG_ERROR, "TNC: Failed to resolve IMV functions");
527 if (tncs_imv_initialize(imv) < 0 ||
528 tncs_imv_provide_bind_function(imv) < 0) {
529 wpa_printf(MSG_ERROR, "TNC: Failed to initialize IMV");
537 static void tncs_free_imv(struct tnc_if_imv *imv)
539 os_free(imv->name);
540 os_free(imv->path);
541 os_free(imv->supported_types);
544 static void tncs_unload_imv(struct tnc_if_imv *imv)
546 tncs_imv_terminate(imv);
548 if (imv->dlhandle)
549 dlclose(imv->dlhandle);
551 tncs_free_imv(imv);
555 static int tncs_supported_type(struct tnc_if_imv *imv, unsigned int type)
560 if (imv == NULL || imv->supported_types == NULL)
566 for (i = 0; i < imv->num_supported_types; i++) {
568 svendor = imv->supported_types[i] >> 8;
569 ssubtype = imv->supported_types[i] & 0xff;
582 struct tnc_if_imv *imv;
585 wpa_hexdump_ascii(MSG_MSGDUMP, "TNC: Message to IMV(s)", msg, len);
587 for (imv = tncs->imv; imv; imv = imv->next) {
588 if (imv->ReceiveMessage == NULL ||
589 !tncs_supported_type(imv, type))
592 wpa_printf(MSG_DEBUG, "TNC: Call ReceiveMessage for IMV '%s'",
593 imv->name);
594 res = imv->ReceiveMessage(imv->imvID, tncs->connectionID,
605 struct tnc_if_imv *imv;
608 for (imv = tncs->imv; imv; imv = imv->next) {
609 if (imv->BatchEnding == NULL)
612 wpa_printf(MSG_DEBUG, "TNC: Call BatchEnding for IMV '%s'",
613 imv->name);
614 res = imv->BatchEnding(imv->imvID, tncs->connectionID);
623 struct tnc_if_imv *imv;
626 for (imv = tncs->imv; imv; imv = imv->next) {
627 if (tncs->imv_data[imv->imvID].recommendation_set)
631 "IMV '%s'", imv->name);
632 res = imv->SolicitRecommendation(imv->imvID,
642 struct tnc_if_imv *imv;
645 for (imv = tncs->imv; imv; imv = imv->next) {
647 imv, tncs->connectionID, TNC_CONNECTION_STATE_CREATE);
649 imv, tncs->connectionID,
763 struct tnc_if_imv *imv;
776 for (imv = tncs->imv; imv; imv = imv->next) {
778 irec = tncs->imv_data[imv->imvID].recommendation;
826 for (imv = tncs->imv; imv; imv = imv->next) {
827 tncs_imv_notify_connection_change(imv, tncs->connectionID,
903 * <IMC-IMV-Message>
906 * </IMC-IMV-Message>
913 pos = os_strstr(start, "<IMC-IMV-Message>");
917 end = os_strstr(start, "</IMC-IMV-Message>");
929 wpa_printf(MSG_DEBUG, "TNC: IMC-IMV-Message Type 0x%x", type);
1032 struct tnc_if_imv *imv;
1040 imv = os_zalloc(sizeof(*imv));
1041 if (imv == NULL) {
1046 imv->imvID = id;
1049 wpa_printf(MSG_DEBUG, "TNC: Configured IMV: %s", pos);
1051 wpa_printf(MSG_ERROR, "TNC: Ignoring invalid IMV line '%s' "
1053 os_free(imv);
1062 wpa_printf(MSG_ERROR, "TNC: Ignoring invalid IMV line '%s' "
1064 os_free(imv);
1069 imv->name = os_strdup(pos);
1073 wpa_printf(MSG_ERROR, "TNC: Ignoring invalid IMV line '%s' "
1075 os_free(imv);
1080 wpa_printf(MSG_DEBUG, "TNC: IMV file: '%s'", pos);
1081 imv->path = os_strdup(pos);
1083 return imv;
1091 struct tnc_if_imv *imv, *last;
1111 if (os_strncmp(pos, "IMV ", 4) == 0) {
1114 imv = tncs_parse_imv(id++, pos + 4, line_end, &error);
1117 if (imv) {
1119 global->imv = imv;
1121 last->next = imv;
1122 last = imv;
1143 tncs->imv = tncs_global_data->imv;
1184 struct tnc_if_imv *imv;
1195 for (imv = tncs_global_data->imv; imv; imv = imv->next) {
1196 if (tncs_load_imv(imv)) {
1197 wpa_printf(MSG_ERROR, "TNC: Failed to load IMV '%s'",
1198 imv->name);
1213 struct tnc_if_imv *imv, *prev;
1218 imv = tncs_global_data->imv;
1219 while (imv) {
1220 tncs_unload_imv(imv);
1222 prev = imv;
1223 imv = imv->next;