Lines Matching refs:sta

30 				   struct sta_info *sta);
34 struct sta_info *sta,
51 if (sta) {
52 radius_msg_make_authenticator(msg, (u8 *) sta, sizeof(*sta));
55 sta->acct_session_id_hi, sta->acct_session_id_lo);
81 if (sta) {
83 val = ieee802_1x_get_identity(sta->eapol_sm, &len);
86 if (!val && sta->identity) {
87 val = (u8 *) sta->identity;
88 len = os_strlen(sta->identity);
95 MAC2STR(sta->addr));
107 if (add_common_radius_attr(hapd, hapd->conf->radius_acct_req_attr, sta,
111 if (sta) {
113 val = ieee802_1x_get_radius_class(sta->eapol_sm, &len,
125 b = ieee802_1x_get_radius_cui(sta->eapol_sm);
134 if (!b && sta->radius_cui &&
137 (u8 *) sta->radius_cui,
138 os_strlen(sta->radius_cui))) {
153 struct sta_info *sta,
156 if (hostapd_drv_read_sta_data(hapd, data, sta->addr))
159 if (sta->last_rx_bytes > data->rx_bytes)
160 sta->acct_input_gigawords++;
161 if (sta->last_tx_bytes > data->tx_bytes)
162 sta->acct_output_gigawords++;
163 sta->last_rx_bytes = data->rx_bytes;
164 sta->last_tx_bytes = data->tx_bytes;
166 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS,
170 sta->last_rx_bytes, sta->acct_input_gigawords,
171 sta->last_tx_bytes, sta->acct_output_gigawords);
180 struct sta_info *sta = timeout_ctx;
183 if (sta->acct_interim_interval) {
184 accounting_sta_interim(hapd, sta);
185 interval = sta->acct_interim_interval;
188 accounting_sta_update_stats(hapd, sta, &data);
193 hapd, sta);
200 * @sta: The station
202 void accounting_sta_start(struct hostapd_data *hapd, struct sta_info *sta)
208 if (sta->acct_session_started)
211 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS,
214 sta->acct_session_id_hi, sta->acct_session_id_lo);
217 sta->acct_session_start = t.sec;
218 sta->last_rx_bytes = sta->last_tx_bytes = 0;
219 sta->acct_input_gigawords = sta->acct_output_gigawords = 0;
220 hostapd_drv_sta_clear_stats(hapd, sta->addr);
225 if (sta->acct_interim_interval)
226 interval = sta->acct_interim_interval;
230 hapd, sta);
232 msg = accounting_msg(hapd, sta, RADIUS_ACCT_STATUS_TYPE_START);
234 radius_client_send(hapd->radius, msg, RADIUS_ACCT, sta->addr) < 0)
237 sta->acct_session_started = 1;
242 struct sta_info *sta, int stop)
245 int cause = sta->acct_terminate_cause;
253 msg = accounting_msg(hapd, sta,
263 now.sec - sta->acct_session_start)) {
268 if (accounting_sta_update_stats(hapd, sta, &data) == 0) {
287 gigawords = sta->acct_input_gigawords;
304 gigawords = sta->acct_output_gigawords;
335 sta->addr) < 0)
347 * @sta: The station
350 struct sta_info *sta)
352 if (sta->acct_session_started)
353 accounting_sta_report(hapd, sta, 0);
360 * @sta: The station
362 void accounting_sta_stop(struct hostapd_data *hapd, struct sta_info *sta)
364 if (sta->acct_session_started) {
365 accounting_sta_report(hapd, sta, 1);
366 eloop_cancel_timeout(accounting_interim_update, hapd, sta);
367 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS,
370 sta->acct_session_id_hi,
371 sta->acct_session_id_lo);
372 sta->acct_session_started = 0;
378 struct sta_info *sta)
380 sta->acct_session_id_lo = hapd->acct_session_id_lo++;
384 sta->acct_session_id_hi = hapd->acct_session_id_hi;