From 3146b2b961aa70ea1947de3ce6d321f6a84276f6 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 17 Jan 2009 17:31:21 +0200 Subject: [PATCH] IBSS RSN: Added couple of required WPA supplicant callback functions --- wpa_supplicant/ibss_rsn.c | 16 ++++++++++++++++ wpa_supplicant/ibss_rsn.h | 1 + 2 files changed, 17 insertions(+) diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c index a35fdc513..83299576a 100644 --- a/wpa_supplicant/ibss_rsn.c +++ b/wpa_supplicant/ibss_rsn.c @@ -31,6 +31,13 @@ static void ibss_rsn_free(struct ibss_rsn_peer *peer) } +static void supp_set_state(void *ctx, wpa_states state) +{ + struct ibss_rsn_peer *peer = ctx; + peer->supp_state = state; +} + + static int supp_ether_send(void *ctx, const u8 *dest, u16 proto, const u8 *buf, size_t len) { @@ -99,6 +106,13 @@ static int supp_set_key(void *ctx, wpa_alg alg, } +static void * supp_get_network_ctx(void *ctx) +{ + struct ibss_rsn_peer *peer = ctx; + return wpa_supplicant_get_ssid(peer->ibss_rsn->wpa_s); +} + + static int supp_mlme_setprotection(void *ctx, const u8 *addr, int protection_type, int key_type) { @@ -123,10 +137,12 @@ int ibss_rsn_supp_init(struct ibss_rsn_peer *peer, const u8 *own_addr, return -1; ctx->ctx = peer; + ctx->set_state = supp_set_state; ctx->ether_send = supp_ether_send; ctx->get_beacon_ie = supp_get_beacon_ie; ctx->alloc_eapol = supp_alloc_eapol; ctx->set_key = supp_set_key; + ctx->get_network_ctx = supp_get_network_ctx; ctx->mlme_setprotection = supp_mlme_setprotection; ctx->cancel_auth_timeout = supp_cancel_auth_timeout; peer->supp = wpa_sm_init(ctx); diff --git a/wpa_supplicant/ibss_rsn.h b/wpa_supplicant/ibss_rsn.h index 51825fb64..9dc803165 100644 --- a/wpa_supplicant/ibss_rsn.h +++ b/wpa_supplicant/ibss_rsn.h @@ -24,6 +24,7 @@ struct ibss_rsn_peer { u8 addr[ETH_ALEN]; struct wpa_sm *supp; + wpa_states supp_state; struct wpa_state_machine *auth; };