int wpa_supplicant_init_wpa(struct wpa_supplicant *wpa_s)

#ifndef CONFIG_NO_WPA
 struct wpa_sm_ctx *ctx;
 ctx = os_zalloc(sizeof(*ctx));
 if (ctx == NULL) {
  wpa_printf(MSG_ERROR, "Failed to allocate WPA context.");
  return -1;
 }
 ctx->ctx = wpa_s;
 ctx->set_state = _wpa_supplicant_set_state;
 ctx->get_state = _wpa_supplicant_get_state;
 ctx->deauthenticate = _wpa_supplicant_deauthenticate;
 ctx->disassociate = _wpa_supplicant_disassociate;
 ctx->set_key = wpa_supplicant_set_key;
 ctx->get_network_ctx = wpa_supplicant_get_network_ctx;
 ctx->get_bssid = wpa_supplicant_get_bssid;
 ctx->ether_send = _wpa_ether_send;
 ctx->get_beacon_ie = wpa_supplicant_get_beacon_ie;
 ctx->alloc_eapol = _wpa_alloc_eapol;
 ctx->cancel_auth_timeout = _wpa_supplicant_cancel_auth_timeout;
 ctx->add_pmkid = wpa_supplicant_add_pmkid;
 ctx->remove_pmkid = wpa_supplicant_remove_pmkid;
#ifndef CONFIG_NO_CONFIG_BLOBS
 ctx->set_config_blob = wpa_supplicant_set_config_blob;
 ctx->get_config_blob = wpa_supplicant_get_config_blob;
#endif /* CONFIG_NO_CONFIG_BLOBS */
 ctx->mlme_setprotection = wpa_supplicant_mlme_setprotection;
#ifdef CONFIG_IEEE80211R
 ctx->update_ft_ies = wpa_supplicant_update_ft_ies;
 ctx->send_ft_action = wpa_supplicant_send_ft_action;
#endif /* CONFIG_IEEE80211R */
 wpa_s->wpa = wpa_sm_init(ctx);
 if (wpa_s->wpa == NULL) {
  wpa_printf(MSG_ERROR, "Failed to initialize WPA state "
      "machine");
  return -1;
 }
#endif /* CONFIG_NO_WPA */
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值