2 * hostapd / IEEE 802.11 MLME
3 * Copyright 2003-2006, Jouni Malinen <j@w1.fi>
4 * Copyright 2003-2004, Instant802 Networks, Inc.
5 * Copyright 2005-2006, Devicescape Software, Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * Alternatively, this software may be distributed under the terms of BSD
14 * See README and COPYING for more details.
17 #include "utils/includes.h"
19 #include "utils/common.h"
20 #include "common/ieee802_11_defs.h"
21 #include "ieee802_11.h"
27 #ifndef CONFIG_NO_HOSTAPD_LOGGER
28 static const char * mlme_auth_alg_str(int alg)
33 case WLAN_AUTH_SHARED_KEY:
41 #endif /* CONFIG_NO_HOSTAPD_LOGGER */
45 * mlme_authenticate_indication - Report the establishment of an authentication
46 * relationship with a specific peer MAC entity
50 * MLME calls this function as a result of the establishment of an
51 * authentication relationship with a specific peer MAC entity that
52 * resulted from an authentication procedure that was initiated by
53 * that specific peer MAC entity.
55 * PeerSTAAddress = sta->addr
56 * AuthenticationType = sta->auth_alg (WLAN_AUTH_OPEN / WLAN_AUTH_SHARED_KEY)
58 void mlme_authenticate_indication(struct hostapd_data *hapd,
61 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
63 "MLME-AUTHENTICATE.indication(" MACSTR ", %s)",
64 MAC2STR(sta->addr), mlme_auth_alg_str(sta->auth_alg));
65 if (sta->auth_alg != WLAN_AUTH_FT && !(sta->flags & WLAN_STA_MFP))
66 mlme_deletekeys_request(hapd, sta);
71 * mlme_deauthenticate_indication - Report the invalidation of an
72 * authentication relationship with a specific peer MAC entity
75 * @reason_code: ReasonCode from Deauthentication frame
77 * MLME calls this function as a result of the invalidation of an
78 * authentication relationship with a specific peer MAC entity.
80 * PeerSTAAddress = sta->addr
82 void mlme_deauthenticate_indication(struct hostapd_data *hapd,
83 struct sta_info *sta, u16 reason_code)
85 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
87 "MLME-DEAUTHENTICATE.indication(" MACSTR ", %d)",
88 MAC2STR(sta->addr), reason_code);
89 mlme_deletekeys_request(hapd, sta);
94 * mlme_associate_indication - Report the establishment of an association with
95 * a specific peer MAC entity
99 * MLME calls this function as a result of the establishment of an
100 * association with a specific peer MAC entity that resulted from an
101 * association procedure that was initiated by that specific peer MAC entity.
103 * PeerSTAAddress = sta->addr
105 void mlme_associate_indication(struct hostapd_data *hapd, struct sta_info *sta)
107 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
109 "MLME-ASSOCIATE.indication(" MACSTR ")",
111 if (sta->auth_alg != WLAN_AUTH_FT)
112 mlme_deletekeys_request(hapd, sta);
117 * mlme_reassociate_indication - Report the establishment of an reassociation
118 * with a specific peer MAC entity
120 * @sta: peer STA data
122 * MLME calls this function as a result of the establishment of an
123 * reassociation with a specific peer MAC entity that resulted from a
124 * reassociation procedure that was initiated by that specific peer MAC entity.
126 * PeerSTAAddress = sta->addr
128 * sta->previous_ap contains the "Current AP" information from ReassocReq.
130 void mlme_reassociate_indication(struct hostapd_data *hapd,
131 struct sta_info *sta)
133 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
135 "MLME-REASSOCIATE.indication(" MACSTR ")",
137 if (sta->auth_alg != WLAN_AUTH_FT)
138 mlme_deletekeys_request(hapd, sta);
143 * mlme_disassociate_indication - Report disassociation with a specific peer
146 * @sta: Peer STA data
147 * @reason_code: ReasonCode from Disassociation frame
149 * MLME calls this function as a result of the invalidation of an association
150 * relationship with a specific peer MAC entity.
152 * PeerSTAAddress = sta->addr
154 void mlme_disassociate_indication(struct hostapd_data *hapd,
155 struct sta_info *sta, u16 reason_code)
157 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
159 "MLME-DISASSOCIATE.indication(" MACSTR ", %d)",
160 MAC2STR(sta->addr), reason_code);
161 mlme_deletekeys_request(hapd, sta);
165 void mlme_michaelmicfailure_indication(struct hostapd_data *hapd,
168 hostapd_logger(hapd, addr, HOSTAPD_MODULE_MLME,
170 "MLME-MichaelMICFailure.indication(" MACSTR ")",
175 void mlme_deletekeys_request(struct hostapd_data *hapd, struct sta_info *sta)
177 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
179 "MLME-DELETEKEYS.request(" MACSTR ")",
183 wpa_remove_ptk(sta->wpa_sm);