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 software may be distributed under the terms of the BSD license.
8 * See README for more details.
11 #include "utils/includes.h"
13 #include "utils/common.h"
14 #include "common/ieee802_11_defs.h"
15 #include "ieee802_11.h"
21 #ifndef CONFIG_NO_HOSTAPD_LOGGER
22 static const char * mlme_auth_alg_str(int alg)
27 case WLAN_AUTH_SHARED_KEY:
35 #endif /* CONFIG_NO_HOSTAPD_LOGGER */
39 * mlme_authenticate_indication - Report the establishment of an authentication
40 * relationship with a specific peer MAC entity
44 * MLME calls this function as a result of the establishment of an
45 * authentication relationship with a specific peer MAC entity that
46 * resulted from an authentication procedure that was initiated by
47 * that specific peer MAC entity.
49 * PeerSTAAddress = sta->addr
50 * AuthenticationType = sta->auth_alg (WLAN_AUTH_OPEN / WLAN_AUTH_SHARED_KEY)
52 void mlme_authenticate_indication(struct hostapd_data *hapd,
55 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
57 "MLME-AUTHENTICATE.indication(" MACSTR ", %s)",
58 MAC2STR(sta->addr), mlme_auth_alg_str(sta->auth_alg));
59 if (sta->auth_alg != WLAN_AUTH_FT && !(sta->flags & WLAN_STA_MFP))
60 mlme_deletekeys_request(hapd, sta);
65 * mlme_deauthenticate_indication - Report the invalidation of an
66 * authentication relationship with a specific peer MAC entity
69 * @reason_code: ReasonCode from Deauthentication frame
71 * MLME calls this function as a result of the invalidation of an
72 * authentication relationship with a specific peer MAC entity.
74 * PeerSTAAddress = sta->addr
76 void mlme_deauthenticate_indication(struct hostapd_data *hapd,
77 struct sta_info *sta, u16 reason_code)
79 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
81 "MLME-DEAUTHENTICATE.indication(" MACSTR ", %d)",
82 MAC2STR(sta->addr), reason_code);
83 mlme_deletekeys_request(hapd, sta);
88 * mlme_associate_indication - Report the establishment of an association with
89 * a specific peer MAC entity
93 * MLME calls this function as a result of the establishment of an
94 * association with a specific peer MAC entity that resulted from an
95 * association procedure that was initiated by that specific peer MAC entity.
97 * PeerSTAAddress = sta->addr
99 void mlme_associate_indication(struct hostapd_data *hapd, struct sta_info *sta)
101 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
103 "MLME-ASSOCIATE.indication(" MACSTR ")",
105 if (sta->auth_alg != WLAN_AUTH_FT)
106 mlme_deletekeys_request(hapd, sta);
111 * mlme_reassociate_indication - Report the establishment of an reassociation
112 * with a specific peer MAC entity
114 * @sta: peer STA data
116 * MLME calls this function as a result of the establishment of an
117 * reassociation with a specific peer MAC entity that resulted from a
118 * reassociation procedure that was initiated by that specific peer MAC entity.
120 * PeerSTAAddress = sta->addr
122 * sta->previous_ap contains the "Current AP" information from ReassocReq.
124 void mlme_reassociate_indication(struct hostapd_data *hapd,
125 struct sta_info *sta)
127 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
129 "MLME-REASSOCIATE.indication(" MACSTR ")",
131 if (sta->auth_alg != WLAN_AUTH_FT)
132 mlme_deletekeys_request(hapd, sta);
137 * mlme_disassociate_indication - Report disassociation with a specific peer
140 * @sta: Peer STA data
141 * @reason_code: ReasonCode from Disassociation frame
143 * MLME calls this function as a result of the invalidation of an association
144 * relationship with a specific peer MAC entity.
146 * PeerSTAAddress = sta->addr
148 void mlme_disassociate_indication(struct hostapd_data *hapd,
149 struct sta_info *sta, u16 reason_code)
151 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
153 "MLME-DISASSOCIATE.indication(" MACSTR ", %d)",
154 MAC2STR(sta->addr), reason_code);
155 mlme_deletekeys_request(hapd, sta);
159 void mlme_michaelmicfailure_indication(struct hostapd_data *hapd,
162 hostapd_logger(hapd, addr, HOSTAPD_MODULE_MLME,
164 "MLME-MichaelMICFailure.indication(" MACSTR ")",
169 void mlme_deletekeys_request(struct hostapd_data *hapd, struct sta_info *sta)
171 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_MLME,
173 "MLME-DELETEKEYS.request(" MACSTR ")",
177 wpa_remove_ptk(sta->wpa_sm);