• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/wpa_supplicant/src/eap_peer/

Lines Matching defs:imc

150 	struct tnc_if_imc *imc;
166 struct tnc_if_imc *imc;
180 imc = tnc_imc[imcID];
181 os_free(imc->supported_types);
182 imc->supported_types =
184 if (imc->supported_types == NULL)
186 os_memcpy(imc->supported_types, supportedTypes,
188 imc->num_supported_types = typeCount;
201 struct tnc_if_imc *imc;
218 imc = tnc_imc[imcID];
219 os_free(imc->imc_send);
220 imc->imc_send_len = 0;
221 imc->imc_send = os_zalloc(b64len + 100);
222 if (imc->imc_send == NULL) {
227 imc->imc_send_len =
228 os_snprintf((char *) imc->imc_send, b64len + 100,
329 static int tncc_imc_resolve_funcs(struct tnc_if_imc *imc)
331 void *handle = imc->dlhandle;
334 imc->Initialize = tncc_get_sym(handle, "TNC_IMC_Initialize");
335 if (imc->Initialize == NULL) {
341 imc->BeginHandshake = tncc_get_sym(handle, "TNC_IMC_BeginHandshake");
342 if (imc->BeginHandshake == NULL) {
348 imc->ProvideBindFunction =
350 if (imc->ProvideBindFunction == NULL) {
357 imc->NotifyConnectionChange =
359 imc->ReceiveMessage = tncc_get_sym(handle, "TNC_IMC_ReceiveMessage");
360 imc->BatchEnding = tncc_get_sym(handle, "TNC_IMC_BatchEnding");
361 imc->Terminate = tncc_get_sym(handle, "TNC_IMC_Terminate");
367 static int tncc_imc_initialize(struct tnc_if_imc *imc)
373 imc->name);
374 res = imc->Initialize(imc->imcID, TNC_IFIMC_VERSION_1,
383 static int tncc_imc_terminate(struct tnc_if_imc *imc)
387 if (imc->Terminate == NULL)
391 imc->name);
392 res = imc->Terminate(imc->imcID);
400 static int tncc_imc_provide_bind_function(struct tnc_if_imc *imc)
405 "IMC '%s'", imc->name);
406 res = imc->ProvideBindFunction(imc->imcID, TNC_TNCC_BindFunction);
414 static int tncc_imc_notify_connection_change(struct tnc_if_imc *imc,
419 if (imc->NotifyConnectionChange == NULL)
423 " for IMC '%s'", (int) state, imc->name);
424 res = imc->NotifyConnectionChange(imc->imcID, imc->connectionID,
433 static int tncc_imc_begin_handshake(struct tnc_if_imc *imc)
438 "'%s'", imc->name);
439 res = imc->BeginHandshake(imc->imcID, imc->connectionID);
447 static int tncc_load_imc(struct tnc_if_imc *imc)
449 if (imc->path == NULL) {
455 imc->name, imc->path);
459 TCHAR *lib = wpa_strdup_tchar(imc->path);
462 imc->dlhandle = LoadLibrary(lib);
466 imc->dlhandle = LoadLibrary(imc->path);
468 if (imc->dlhandle == NULL) {
470 imc->name, imc->path, (int) GetLastError());
474 imc->dlhandle = dlopen(imc->path, RTLD_LAZY);
475 if (imc->dlhandle == NULL) {
477 imc->name, imc->path, dlerror());
482 if (tncc_imc_resolve_funcs(imc) < 0) {
487 if (tncc_imc_initialize(imc) < 0 ||
488 tncc_imc_provide_bind_function(imc) < 0) {
497 static void tncc_unload_imc(struct tnc_if_imc *imc)
499 tncc_imc_terminate(imc);
500 tnc_imc[imc->imcID] = NULL;
502 if (imc->dlhandle) {
504 FreeLibrary(imc->dlhandle);
506 dlclose(imc->dlhandle);
509 os_free(imc->name);
510 os_free(imc->path);
511 os_free(imc->supported_types);
512 os_free(imc->imc_send);
516 static int tncc_supported_type(struct tnc_if_imc *imc, unsigned int type)
521 if (imc == NULL || imc->supported_types == NULL)
527 for (i = 0; i < imc->num_supported_types; i++) {
529 svendor = imc->supported_types[i] >> 8;
530 ssubtype = imc->supported_types[i] & 0xff;
543 struct tnc_if_imc *imc;
548 for (imc = tncc->imc; imc; imc = imc->next) {
549 if (imc->ReceiveMessage == NULL ||
550 !tncc_supported_type(imc, type))
554 imc->name);
555 res = imc->ReceiveMessage(imc->imcID, imc->connectionID,
566 struct tnc_if_imc *imc;
568 for (imc = tncc->imc; imc; imc = imc->next) {
570 imc, TNC_CONNECTION_STATE_CREATE);
572 imc, TNC_CONNECTION_STATE_HANDSHAKE);
574 os_free(imc->imc_send);
575 imc->imc_send = NULL;
576 imc->imc_send_len = 0;
578 tncc_imc_begin_handshake(imc);
585 struct tnc_if_imc *imc;
588 for (imc = tncc->imc; imc; imc = imc->next)
589 len += imc->imc_send_len;
596 struct tnc_if_imc *imc;
598 for (imc = tncc->imc; imc; imc = imc->next) {
599 if (imc->imc_send == NULL)
602 os_memcpy(pos, imc->imc_send, imc->imc_send_len);
603 pos += imc->imc_send_len;
604 os_free(imc->imc_send);
605 imc->imc_send = NULL;
606 imc->imc_send_len = 0;
638 struct tnc_if_imc *imc;
655 for (imc = tncc->imc; imc; imc = imc->next)
656 tncc_imc_notify_connection_change(imc, state);
940 struct tnc_if_imc *imc, *last;
943 last = tncc->imc;
1020 imc = os_zalloc(sizeof(*imc));
1021 if (imc == NULL) {
1026 imc->imcID = j;
1029 imc->name = os_strdup((char *) name);
1030 imc->path = os_strdup((char *) val);
1035 tncc->imc = imc;
1037 last->next = imc;
1038 last = imc;
1040 tnc_imc[imc->imcID] = imc;
1061 struct tnc_if_imc *imc;
1074 imc = os_zalloc(sizeof(*imc));
1075 if (imc == NULL) {
1080 imc->imcID = i;
1087 os_free(imc);
1098 os_free(imc);
1103 imc->name = os_strdup(pos);
1109 os_free(imc->name);
1110 os_free(imc);
1116 imc->path = os_strdup(pos);
1117 tnc_imc[imc->imcID] = imc;
1119 return imc;
1127 struct tnc_if_imc *imc, *last;
1149 imc = tncc_parse_imc(pos + 4, line_end, &error);
1152 if (imc) {
1154 tncc->imc = imc;
1156 last->next = imc;
1157 last = imc;
1173 struct tnc_if_imc *imc;
1189 for (imc = tncc->imc; imc; imc = imc->next) {
1190 if (tncc_load_imc(imc)) {
1192 imc->name);
1207 struct tnc_if_imc *imc, *prev;
1209 imc = tncc->imc;
1210 while (imc) {
1211 tncc_unload_imc(imc);
1213 prev = imc;
1214 imc = imc->next;