Home | History | Annotate | Download | only in eap_server

Lines Matching refs:imv

2  * EAP-TNC - TNCS (IF-IMV, IF-TNCCS, and IF-TNCCS-SOH)
38 /* TNC IF-IMV */
151 struct tnc_if_imv *imv; /* local copy of tncs_global_data->imv */
169 struct tnc_if_imv *imv;
179 struct tnc_if_imv *imv;
183 imv = tncs_global_data->imv;
184 while (imv) {
185 if (imv->imvID == imvID)
186 return imv;
187 imv = imv->next;
221 struct tnc_if_imv *imv;
232 imv = tncs_get_imv(imvID);
233 if (imv == NULL)
235 os_free(imv->supported_types);
236 imv->supported_types =
238 if (imv->supported_types == NULL)
240 os_memcpy(imv->supported_types, supportedTypes,
242 imv->num_supported_types = typeCount;
287 "<IMC-IMV-Message><Type>%08X</Type>"
288 "<Base64>%s</Base64></IMC-IMV-Message>",
407 static int tncs_imv_resolve_funcs(struct tnc_if_imv *imv)
409 void *handle = imv->dlhandle;
411 /* Mandatory IMV functions */
412 imv->Initialize = tncs_get_sym(handle, "TNC_IMV_Initialize");
413 if (imv->Initialize == NULL) {
414 wpa_printf(MSG_ERROR, "TNC: IMV does not export "
419 imv->SolicitRecommendation = tncs_get_sym(
421 if (imv->SolicitRecommendation == NULL) {
422 wpa_printf(MSG_ERROR, "TNC: IMV does not export "
427 imv->ProvideBindFunction =
429 if (imv->ProvideBindFunction == NULL) {
430 wpa_printf(MSG_ERROR, "TNC: IMV does not export "
435 /* Optional IMV functions */
436 imv->NotifyConnectionChange =
438 imv->ReceiveMessage = tncs_get_sym(handle, "TNC_IMV_ReceiveMessage");
439 imv->BatchEnding = tncs_get_sym(handle, "TNC_IMV_BatchEnding");
440 imv->Terminate = tncs_get_sym(handle, "TNC_IMV_Terminate");
446 static int tncs_imv_initialize(struct tnc_if_imv *imv)
451 wpa_printf(MSG_DEBUG, "TNC: Calling TNC_IMV_Initialize for IMV '%s'",
452 imv->name);
453 res = imv->Initialize(imv->imvID, TNC_IFIMV_VERSION_1,
462 static int tncs_imv_terminate(struct tnc_if_imv *imv)
466 if (imv->Terminate == NULL)
469 wpa_printf(MSG_DEBUG, "TNC: Calling TNC_IMV_Terminate for IMV '%s'",
470 imv->name);
471 res = imv->Terminate(imv->imvID);
479 static int tncs_imv_provide_bind_function(struct tnc_if_imv *imv)
484 "IMV '%s'", imv->name);
485 res = imv->ProvideBindFunction(imv->imvID, TNC_TNCS_BindFunction);
493 static int tncs_imv_notify_connection_change(struct tnc_if_imv *imv,
499 if (imv->NotifyConnectionChange == NULL)
503 " for IMV '%s'", (int) state, imv->name);
504 res = imv->NotifyConnectionChange(imv->imvID, conn, state);
512 static int tncs_load_imv(struct tnc_if_imv *imv)
514 if (imv->path == NULL) {
515 wpa_printf(MSG_DEBUG, "TNC: No IMV configured");
519 wpa_printf(MSG_DEBUG, "TNC: Opening IMV: %s (%s)",
520 imv->name, imv->path);
521 imv->dlhandle = dlopen(imv->path, RTLD_LAZY);
522 if (imv->dlhandle == NULL) {
523 wpa_printf(MSG_ERROR, "TNC: Failed to open IMV '%s' (%s): %s",
524 imv->name, imv->path, dlerror());
528 if (tncs_imv_resolve_funcs(imv) < 0) {
529 wpa_printf(MSG_ERROR, "TNC: Failed to resolve IMV functions");
533 if (tncs_imv_initialize(imv) < 0 ||
534 tncs_imv_provide_bind_function(imv) < 0) {
535 wpa_printf(MSG_ERROR, "TNC: Failed to initialize IMV");
543 static void tncs_free_imv(struct tnc_if_imv *imv)
545 os_free(imv->name);
546 os_free(imv->path);
547 os_free(imv->supported_types);
550 static void tncs_unload_imv(struct tnc_if_imv *imv)
552 tncs_imv_terminate(imv);
554 if (imv->dlhandle)
555 dlclose(imv->dlhandle);
557 tncs_free_imv(imv);
561 static int tncs_supported_type(struct tnc_if_imv *imv, unsigned int type)
566 if (imv == NULL || imv->supported_types == NULL)
572 for (i = 0; i < imv->num_supported_types; i++) {
574 svendor = imv->supported_types[i] >> 8;
575 ssubtype = imv->supported_types[i] & 0xff;
588 struct tnc_if_imv *imv;
591 wpa_hexdump_ascii(MSG_MSGDUMP, "TNC: Message to IMV(s)", msg, len);
593 for (imv = tncs->imv; imv; imv = imv->next) {
594 if (imv->ReceiveMessage == NULL ||
595 !tncs_supported_type(imv, type))
598 wpa_printf(MSG_DEBUG, "TNC: Call ReceiveMessage for IMV '%s'",
599 imv->name);
600 res = imv->ReceiveMessage(imv->imvID, tncs->connectionID,
611 struct tnc_if_imv *imv;
614 for (imv = tncs->imv; imv; imv = imv->next) {
615 if (imv->BatchEnding == NULL)
618 wpa_printf(MSG_DEBUG, "TNC: Call BatchEnding for IMV '%s'",
619 imv->name);
620 res = imv->BatchEnding(imv->imvID, tncs->connectionID);
629 struct tnc_if_imv *imv;
632 for (imv = tncs->imv; imv; imv = imv->next) {
633 imv->imvID].recommendation_set)
637 "IMV '%s'", imv->name);
638 res = imv->SolicitRecommendation(imv->imvID,
648 struct tnc_if_imv *imv;
651 for (imv = tncs->imv; imv; imv = imv->next) {
653 imv, tncs->connectionID, TNC_CONNECTION_STATE_CREATE);
655 imv, tncs->connectionID,
769 struct tnc_if_imv *imv;
782 for (imv = tncs->imv; imv; imv = imv->next) {
784 irec = tncs->imv_data[imv->imvID].recommendation;
832 for (imv = tncs->imv; imv; imv = imv->next) {
833 tncs_imv_notify_connection_change(imv, tncs->connectionID,
909 * <IMC-IMV-Message>
912 * </IMC-IMV-Message>
919 pos = os_strstr(start, "<IMC-IMV-Message>");
923 end = os_strstr(start, "</IMC-IMV-Message>");
935 wpa_printf(MSG_DEBUG, "TNC: IMC-IMV-Message Type 0x%x", type);
1038 struct tnc_if_imv *imv;
1046 imv = os_zalloc(sizeof(*imv));
1047 if (imv == NULL) {
1052 imv->imvID = id;
1055 wpa_printf(MSG_DEBUG, "TNC: Configured IMV: %s", pos);
1057 wpa_printf(MSG_ERROR, "TNC: Ignoring invalid IMV line '%s' "
1059 os_free(imv);
1068 wpa_printf(MSG_ERROR, "TNC: Ignoring invalid IMV line '%s' "
1070 os_free(imv);
1075 imv->name = os_strdup(pos);
1079 wpa_printf(MSG_ERROR, "TNC: Ignoring invalid IMV line '%s' "
1081 os_free(imv);
1086 wpa_printf(MSG_DEBUG, "TNC: IMV file: '%s'", pos);
1087 imv->path = os_strdup(pos);
1089 return imv;
1097 struct tnc_if_imv *imv, *last;
1117 if (os_strncmp(pos, "IMV ", 4) == 0) {
1120 imv = tncs_parse_imv(id++, pos + 4, line_end, &error);
1123 if (imv) {
1125 global->imv = imv;
1127 last->next = imv;
1128 last = imv;
1149 tncs->imv = tncs_global_data->imv;
1190 struct tnc_if_imv *imv;
1201 for (imv = tncs_global_data->imv; imv; imv = imv->next) {
1202 if (tncs_load_imv(imv)) {
1203 wpa_printf(MSG_ERROR, "TNC: Failed to load IMV '%s'",
1204 imv->name);
1219 struct tnc_if_imv *imv, *prev;
1224 imv = tncs_global_data->imv;
1225 while (imv) {
1226 tncs_unload_imv(imv);
1228 prev = imv;
1229 imv = imv->next;