Home | History | Annotate | Download | only in ap

Lines Matching defs:hapd

30 static void accounting_sta_interim(struct hostapd_data *hapd,
34 static struct radius_msg * accounting_msg(struct hostapd_data *hapd,
47 radius_client_get_id(hapd->radius));
61 hapd->conf->radius_acct_req_attr,
64 hapd->conf->ieee802_1x ?
96 if (add_common_radius_attr(hapd, hapd->conf->radius_acct_req_attr, sta,
167 static int accounting_sta_update_stats(struct hostapd_data *hapd,
171 if (hostapd_drv_read_sta_data(hapd, data, sta->addr))
185 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS,
200 struct hostapd_data *hapd = eloop_ctx;
205 accounting_sta_interim(hapd, sta);
209 accounting_sta_update_stats(hapd, sta, &data);
214 hapd, sta);
220 * @hapd: hostapd BSS data
223 void accounting_sta_start(struct hostapd_data *hapd, struct sta_info *sta)
231 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS,
241 hostapd_drv_sta_clear_stats(hapd, sta->addr);
243 if (!hapd->conf->radius->acct_server)
251 hapd, sta);
253 msg = accounting_msg(hapd, sta, RADIUS_ACCT_STATUS_TYPE_START);
255 radius_client_send(hapd->radius, msg, RADIUS_ACCT, sta->addr) < 0)
262 static void accounting_sta_report(struct hostapd_data *hapd,
271 if (!hapd->conf->radius->acct_server)
274 msg = accounting_msg(hapd, sta,
290 if (accounting_sta_update_stats(hapd, sta, &data) == 0) {
349 if (radius_client_send(hapd->radius, msg,
362 * @hapd: hostapd BSS data
365 static void accounting_sta_interim(struct hostapd_data *hapd,
369 accounting_sta_report(hapd, sta, 0);
375 * @hapd: hostapd BSS data
378 void accounting_sta_stop(struct hostapd_data *hapd, struct sta_info *sta)
381 accounting_sta_report(hapd, sta, 1);
382 eloop_cancel_timeout(accounting_interim_update, hapd, sta);
383 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_RADIUS,
392 int accounting_sta_get_id(struct hostapd_data *hapd, struct sta_info *sta)
427 static void accounting_report_state(struct hostapd_data *hapd, int on)
431 if (!hapd->conf->radius->acct_server || hapd->radius == NULL)
436 msg = accounting_msg(hapd, NULL,
442 if (hapd->acct_session_id) {
446 (unsigned long long) hapd->acct_session_id);
452 if (radius_client_send(hapd->radius, msg, RADIUS_ACCT, NULL) < 0)
459 struct hostapd_data *hapd = ctx;
464 sta = ap_get_sta(hapd, addr);
495 hapd, sta);
516 * @hapd: hostapd BSS data
519 int accounting_init(struct hostapd_data *hapd)
521 if (radius_gen_session_id((u8 *) &hapd->acct_session_id,
522 sizeof(hapd->acct_session_id)) < 0)
525 if (radius_client_register(hapd->radius, RADIUS_ACCT,
526 accounting_receive, hapd))
528 radius_client_set_interim_error_cb(hapd->radius,
529 accounting_interim_error_cb, hapd);
531 accounting_report_state(hapd, 1);
539 * @hapd: hostapd BSS data
541 void accounting_deinit(struct hostapd_data *hapd)
543 accounting_report_state(hapd, 0);