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"
26 #ifndef CONFIG_NO_HOSTAPD_LOGGER
27 static const char * mlme_auth_alg_str(int alg)
32 case WLAN_AUTH_SHARED_KEY:
40 #endif /* CONFIG_NO_HOSTAPD_LOGGER */
44 * mlme_authenticate_indication - Report the establishment of an authentication
45 * relationship with a specific peer MAC entity
49 * MLME calls this function as a result of the establishment of an
50 * authentication relationship with a specific peer MAC entity that
51 * resulted from an authentication procedure that was initiated by
52 * that specific peer MAC entity.
54 * PeerSTAAddress = sta->addr
55 * AuthenticationType = sta->auth_alg (WLAN_AUTH_OPEN / WLAN_AUTH_SHARED_KEY)
57 void mlme_authenticate_indication(struct hostapd_data *hapd,
60 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
62 "MLME-AUTHENTICATE.indication(" MACSTR ", %s)",
63 MAC2STR(sta->addr), mlme_auth_alg_str(sta->auth_alg));
64 if (sta->auth_alg != WLAN_AUTH_FT && !(sta->flags & WLAN_STA_MFP))
65 mlme_deletekeys_request(hapd, sta);
70 * mlme_deauthenticate_indication - Report the invalidation of an
71 * authentication relationship with a specific peer MAC entity
74 * @reason_code: ReasonCode from Deauthentication frame
76 * MLME calls this function as a result of the invalidation of an
77 * authentication relationship with a specific peer MAC entity.
79 * PeerSTAAddress = sta->addr
81 void mlme_deauthenticate_indication(struct hostapd_data *hapd,
82 struct sta_info *sta, u16 reason_code)
84 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
86 "MLME-DEAUTHENTICATE.indication(" MACSTR ", %d)",
87 MAC2STR(sta->addr), reason_code);
88 mlme_deletekeys_request(hapd, sta);
93 * mlme_associate_indication - Report the establishment of an association with
94 * a specific peer MAC entity
98 * MLME calls this function as a result of the establishment of an
99 * association with a specific peer MAC entity that resulted from an
100 * association procedure that was initiated by that specific peer MAC entity.
102 * PeerSTAAddress = sta->addr
104 void mlme_associate_indication(struct hostapd_data *hapd, struct sta_info *sta)
106 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
108 "MLME-ASSOCIATE.indication(" MACSTR ")",
110 if (sta->auth_alg != WLAN_AUTH_FT)
111 mlme_deletekeys_request(hapd, sta);
116 * mlme_reassociate_indication - Report the establishment of an reassociation
117 * with a specific peer MAC entity
119 * @sta: peer STA data
121 * MLME calls this function as a result of the establishment of an
122 * reassociation with a specific peer MAC entity that resulted from a
123 * reassociation procedure that was initiated by that specific peer MAC entity.
125 * PeerSTAAddress = sta->addr
127 * sta->previous_ap contains the "Current AP" information from ReassocReq.
129 void mlme_reassociate_indication(struct hostapd_data *hapd,
130 struct sta_info *sta)
132 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
134 "MLME-REASSOCIATE.indication(" MACSTR ")",
136 if (sta->auth_alg != WLAN_AUTH_FT)
137 mlme_deletekeys_request(hapd, sta);
142 * mlme_disassociate_indication - Report disassociation with a specific peer
145 * @sta: Peer STA data
146 * @reason_code: ReasonCode from Disassociation frame
148 * MLME calls this function as a result of the invalidation of an association
149 * relationship with a specific peer MAC entity.
151 * PeerSTAAddress = sta->addr
153 void mlme_disassociate_indication(struct hostapd_data *hapd,
154 struct sta_info *sta, u16 reason_code)
156 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
158 "MLME-DISASSOCIATE.indication(" MACSTR ", %d)",
159 MAC2STR(sta->addr), reason_code);
160 mlme_deletekeys_request(hapd, sta);
164 void mlme_michaelmicfailure_indication(struct hostapd_data *hapd,
167 hostapd_logger(hapd, addr, HOSTAPD_MODULE_MLME,
169 "MLME-MichaelMICFailure.indication(" MACSTR ")",
174 void mlme_deletekeys_request(struct hostapd_data *hapd, struct sta_info *sta)
176 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
178 "MLME-DELETEKEYS.request(" MACSTR ")",
182 wpa_remove_ptk(sta->wpa_sm);