Home | History | Annotate | Download | only in ap

Lines Matching defs:hapd

29 static void accounting_sta_interim(struct hostapd_data *hapd,
33 static struct radius_msg * accounting_msg(struct hostapd_data *hapd,
45 radius_client_get_id(hapd->radius));
62 radius_msg_make_authenticator(msg, (u8 *) hapd, sizeof(*hapd));
71 if (!hostapd_config_get_radius_attr(hapd->conf->radius_acct_req_attr,
74 hapd->conf->ieee802_1x ?
107 if (add_common_radius_attr(hapd, hapd->conf->radius_acct_req_attr, sta,
152 static int accounting_sta_update_stats(struct hostapd_data *hapd,
156 if (hostapd_drv_read_sta_data(hapd, data, sta->addr))
166 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS,
179 struct hostapd_data *hapd = eloop_ctx;
184 accounting_sta_interim(hapd, sta);
188 accounting_sta_update_stats(hapd, sta, &data);
193 hapd, sta);
199 * @hapd: hostapd BSS data
202 void accounting_sta_start(struct hostapd_data *hapd, struct sta_info *sta)
211 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS,
220 hostapd_drv_sta_clear_stats(hapd, sta->addr);
222 if (!hapd->conf->radius->acct_server)
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)
241 static void accounting_sta_report(struct hostapd_data *hapd,
250 if (!hapd->conf->radius->acct_server)
253 msg = accounting_msg(hapd, sta,
268 if (accounting_sta_update_stats(hapd, sta, &data) == 0) {
333 if (radius_client_send(hapd->radius, msg,
346 * @hapd: hostapd BSS data
349 static void accounting_sta_interim(struct hostapd_data *hapd,
353 accounting_sta_report(hapd, sta, 0);
359 * @hapd: hostapd BSS data
362 void accounting_sta_stop(struct hostapd_data *hapd, struct sta_info *sta)
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,
377 void accounting_sta_get_id(struct hostapd_data *hapd,
380 sta->acct_session_id_lo = hapd->acct_session_id_lo++;
381 if (hapd->acct_session_id_lo == 0) {
382 hapd->acct_session_id_hi++;
384 sta->acct_session_id_hi = hapd->acct_session_id_hi;
417 static void accounting_report_state(struct hostapd_data *hapd, int on)
421 if (!hapd->conf->radius->acct_server || hapd->radius == NULL)
426 msg = accounting_msg(hapd, NULL,
440 if (radius_client_send(hapd->radius, msg, RADIUS_ACCT, NULL) < 0)
447 * @hapd: hostapd BSS data
450 int accounting_init(struct hostapd_data *hapd)
457 hapd->acct_session_id_hi = now.sec;
459 if (radius_client_register(hapd->radius, RADIUS_ACCT,
460 accounting_receive, hapd))
463 accounting_report_state(hapd, 1);
471 * @hapd: hostapd BSS data
473 void accounting_deinit(struct hostapd_data *hapd)
475 accounting_report_state(hapd, 0);