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.
20 #include "ieee802_11.h"
25 #ifndef CONFIG_NO_HOSTAPD_LOGGER
26 static const char * mlme_auth_alg_str(int alg)
31 case WLAN_AUTH_SHARED_KEY:
39 #endif /* CONFIG_NO_HOSTAPD_LOGGER */
43 * mlme_authenticate_indication - Report the establishment of an authentication
44 * relationship with a specific peer MAC entity
48 * MLME calls this function as a result of the establishment of an
49 * authentication relationship with a specific peer MAC entity that
50 * resulted from an authentication procedure that was initiated by
51 * that specific peer MAC entity.
53 * PeerSTAAddress = sta->addr
54 * AuthenticationType = sta->auth_alg (WLAN_AUTH_OPEN / WLAN_AUTH_SHARED_KEY)
56 void mlme_authenticate_indication(struct hostapd_data *hapd,
59 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
61 "MLME-AUTHENTICATE.indication(" MACSTR ", %s)",
62 MAC2STR(sta->addr), mlme_auth_alg_str(sta->auth_alg));
63 if (sta->auth_alg != WLAN_AUTH_FT && !(sta->flags & WLAN_STA_MFP))
64 mlme_deletekeys_request(hapd, sta);
69 * mlme_deauthenticate_indication - Report the invalidation of an
70 * authentication relationship with a specific peer MAC entity
73 * @reason_code: ReasonCode from Deauthentication frame
75 * MLME calls this function as a result of the invalidation of an
76 * authentication relationship with a specific peer MAC entity.
78 * PeerSTAAddress = sta->addr
80 void mlme_deauthenticate_indication(struct hostapd_data *hapd,
81 struct sta_info *sta, u16 reason_code)
83 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
85 "MLME-DEAUTHENTICATE.indication(" MACSTR ", %d)",
86 MAC2STR(sta->addr), reason_code);
87 mlme_deletekeys_request(hapd, sta);
92 * mlme_associate_indication - Report the establishment of an association with
93 * a specific peer MAC entity
97 * MLME calls this function as a result of the establishment of an
98 * association with a specific peer MAC entity that resulted from an
99 * association procedure that was initiated by that specific peer MAC entity.
101 * PeerSTAAddress = sta->addr
103 void mlme_associate_indication(struct hostapd_data *hapd, struct sta_info *sta)
105 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
107 "MLME-ASSOCIATE.indication(" MACSTR ")",
109 if (sta->auth_alg != WLAN_AUTH_FT)
110 mlme_deletekeys_request(hapd, sta);
115 * mlme_reassociate_indication - Report the establishment of an reassociation
116 * with a specific peer MAC entity
118 * @sta: peer STA data
120 * MLME calls this function as a result of the establishment of an
121 * reassociation with a specific peer MAC entity that resulted from a
122 * reassociation procedure that was initiated by that specific peer MAC entity.
124 * PeerSTAAddress = sta->addr
126 * sta->previous_ap contains the "Current AP" information from ReassocReq.
128 void mlme_reassociate_indication(struct hostapd_data *hapd,
129 struct sta_info *sta)
131 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
133 "MLME-REASSOCIATE.indication(" MACSTR ")",
135 if (sta->auth_alg != WLAN_AUTH_FT)
136 mlme_deletekeys_request(hapd, sta);
141 * mlme_disassociate_indication - Report disassociation with a specific peer
144 * @sta: Peer STA data
145 * @reason_code: ReasonCode from Disassociation frame
147 * MLME calls this function as a result of the invalidation of an association
148 * relationship with a specific peer MAC entity.
150 * PeerSTAAddress = sta->addr
152 void mlme_disassociate_indication(struct hostapd_data *hapd,
153 struct sta_info *sta, u16 reason_code)
155 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
157 "MLME-DISASSOCIATE.indication(" MACSTR ", %d)",
158 MAC2STR(sta->addr), reason_code);
159 mlme_deletekeys_request(hapd, sta);
163 void mlme_michaelmicfailure_indication(struct hostapd_data *hapd,
166 hostapd_logger(hapd, addr, HOSTAPD_MODULE_MLME,
168 "MLME-MichaelMICFailure.indication(" MACSTR ")",
173 void mlme_deletekeys_request(struct hostapd_data *hapd, struct sta_info *sta)
175 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
177 "MLME-DELETEKEYS.request(" MACSTR ")",
181 wpa_remove_ptk(sta->wpa_sm);