From 92ac6376c47e58c7cc7fac32dd061dbe06f8a524 Mon Sep 17 00:00:00 2001 From: Xi Chen Date: Wed, 16 Mar 2011 16:28:32 +0200 Subject: [PATCH] IBSS RSN: Add for_each_sta handler for authenticator --- wpa_supplicant/ibss_rsn.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c index ae3d196d1..38292c7a8 100644 --- a/wpa_supplicant/ibss_rsn.c +++ b/wpa_supplicant/ibss_rsn.c @@ -299,6 +299,24 @@ static int auth_set_key(void *ctx, int vlan_id, enum wpa_alg alg, } +static int auth_for_each_sta(void *ctx, int (*cb)(struct wpa_state_machine *sm, + void *ctx), + void *cb_ctx) +{ + struct ibss_rsn *ibss_rsn = ctx; + struct ibss_rsn_peer *peer; + + wpa_printf(MSG_DEBUG, "AUTH: for_each_sta"); + + for (peer = ibss_rsn->peers; peer; peer = peer->next) { + if (peer->auth && cb(peer->auth, cb_ctx)) + return 1; + } + + return 0; +} + + static int ibss_rsn_auth_init_group(struct ibss_rsn *ibss_rsn, const u8 *own_addr) { @@ -321,6 +339,7 @@ static int ibss_rsn_auth_init_group(struct ibss_rsn *ibss_rsn, cb.send_eapol = auth_send_eapol; cb.get_psk = auth_get_psk; cb.set_key = auth_set_key; + cb.for_each_sta = auth_for_each_sta; ibss_rsn->init_in_progress = 1; ibss_rsn->auth_group = wpa_init(own_addr, &conf, &cb);