contrib/hostapd/hostapd/hostapd.c
void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
			   int reassoc)
{
	if (hapd->tkip_countermeasures) {
		hostapd_sta_deauth(hapd, sta->addr,
				   WLAN_REASON_MICHAEL_MIC_FAILURE);
		return;
	}

	hostapd_prune_associations(hapd, sta);

	/* IEEE 802.11F (IAPP) */
	if (hapd->conf->ieee802_11f)
		iapp_new_station(hapd->iapp, sta);

	/* Start accounting here, if IEEE 802.1X and WPA are not used.
	 * IEEE 802.1X/WPA code will start accounting after the station has
	 * been authorized. */
	if (!hapd->conf->ieee802_1x && !hapd->conf->wpa)
		accounting_sta_start(hapd, sta);

	hostapd_wmm_sta_config(hapd, sta);

	/* Start IEEE 802.1X authentication process for new stations */
	ieee802_1x_new_station(hapd, sta);
	if (reassoc) {
		if (sta->auth_alg != WLAN_AUTH_FT &&
		    !(sta->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS)))
			wpa_auth_sm_event(sta->wpa_sm, WPA_REAUTH);
	} else
		wpa_auth_sta_associated(hapd->wpa_auth, sta->wpa_sm);
}
/**
 * hostapd_new_assoc_sta - Notify that a new station associated with the AP
 * @hapd: Pointer to BSS data
 * @sta: Pointer to the associated STA data
 * @reassoc: 1 to indicate this was a re-association; 0 = first association
 *
 * This function will be called whenever a station associates with the AP. It
 * can be called for ieee802_11.c for drivers that export MLME to hostapd and
 * from driver_*.c for drivers that take care of management frames (IEEE 802.11
 * authentication and association) internally.
 */
Notify that a new station associated with the AP
@hapd: Pointer to BSS data
@sta: Pointer to the associated STA data
@reassoc: 1 to indicate this was a re-association; 0 = first association

This function will be called whenever a station associates with the AP. It
can be called for ieee802_11.c for drivers that export MLME to hostapd and
from driver_*.c for drivers that take care of management frames  internally.
Notify that a new station associated with the AP @hapd : Pointer to BSS data @sta : Pointer to the associated STA data @reassoc : 1 to indicate this was a re - association ; 0 = first association This function will be called whenever a station associates with the AP . It can be called for ieee802_11 . c for drivers that export MLME to hostapd and from driver_ * . c for drivers that take care of management frames internally .
void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
			   int reassoc)
{
	if (hapd->tkip_countermeasures) {
		hostapd_sta_deauth(hapd, sta->addr,
				   WLAN_REASON_MICHAEL_MIC_FAILURE);
		return;
	}
	hostapd_prune_associations(hapd, sta);
	if (hapd->conf->ieee802_11f)
		iapp_new_station(hapd->iapp, sta);
	if (!hapd->conf->ieee802_1x && !hapd->conf->wpa)
		accounting_sta_start(hapd, sta);
	hostapd_wmm_sta_config(hapd, sta);
	ieee802_1x_new_station(hapd, sta);
	if (reassoc) {
		if (sta->auth_alg != WLAN_AUTH_FT &&
		    !(sta->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS)))
			wpa_auth_sm_event(sta->wpa_sm, WPA_REAUTH);
	} else
		wpa_auth_sta_associated(hapd->wpa_auth, sta->wpa_sm);
}
void hostapd_new_assoc_sta ( struct hostapd_data * hapd , struct sta_info * sta , int reassoc ) { if ( hapd -> tkip_countermeasures ) { hostapd_sta_deauth ( hapd , sta -> addr , WLAN_REASON_MICHAEL_MIC_FAILURE ) ; return ; } hostapd_prune_associations ( hapd , sta ) ; if ( hapd -> conf -> ieee802_11f ) iapp_new_station ( hapd -> iapp , sta ) ; if ( ! hapd -> conf -> ieee802_1x && ! hapd -> conf -> wpa ) accounting_sta_start ( hapd , sta ) ; hostapd_wmm_sta_config ( hapd , sta ) ; ieee802_1x_new_station ( hapd , sta ) ; if ( reassoc ) { if ( sta -> auth_alg != WLAN_AUTH_FT && ! ( sta -> flags & ( WLAN_STA_WPS | WLAN_STA_MAYBE_WPS ) ) ) wpa_auth_sm_event ( sta -> wpa_sm , WPA_REAUTH ) ; } else wpa_auth_sta_associated ( hapd -> wpa_auth , sta -> wpa_sm ) ; }
hostapd_new_assoc_sta - Notify that a new station associated with the AP
 @hapd: Pointer to BSS data
 @sta: Pointer to the associated STA data
 @reassoc: 1 to indicate this was a re-association; 0 = first association
hostapd_new_assoc_sta - Notify that a new station associated with the AP @hapd : Pointer to BSS data @sta : Pointer to the associated STA data @reassoc : 1 to indicate this was a re - association ; 0 = first association
/* IEEE 802.11F (IAPP) */ /* Start accounting here, if IEEE 802.1X and WPA are not used.
	 * IEEE 802.1X/WPA code will start accounting after the station has
	 * been authorized. */ /* Start IEEE 802.1X authentication process for new stations */