Home | History | Annotate | Download | only in ap

Lines Matching defs:hapd

89 static int hostapd_acl_cache_get(struct hostapd_data *hapd, const u8 *addr,
101 for (entry = hapd->acl_cache; entry; entry = entry->next) {
147 static int hostapd_radius_acl_query(struct hostapd_data *hapd, const u8 *addr,
153 query->radius_id = radius_client_get_id(hapd->radius);
172 hapd->conf->radius->auth_server->shared_secret,
173 hapd->conf->radius->auth_server->shared_secret_len)) {
178 if (add_common_radius_attr(hapd, hapd->conf->radius_auth_req_attr,
197 if (radius_client_send(hapd->radius, msg, RADIUS_AUTH, addr) < 0)
210 * @hapd: hostapd BSS data
215 int hostapd_check_acl(struct hostapd_data *hapd, const u8 *addr,
218 if (hostapd_maclist_found(hapd->conf->accept_mac,
219 hapd->conf->num_accept_mac, addr, vlan_id))
222 if (hostapd_maclist_found(hapd->conf->deny_mac,
223 hapd->conf->num_deny_mac, addr, vlan_id))
226 if (hapd->conf->macaddr_acl == ACCEPT_UNLESS_DENIED)
228 if (hapd->conf->macaddr_acl == DENY_UNLESS_ACCEPTED)
237 * @hapd: hostapd BSS data
252 int hostapd_allowed_address(struct hostapd_data *hapd, const u8 *addr,
274 res = hostapd_check_acl(hapd, addr, vlan_id);
278 if (hapd->conf->macaddr_acl == USE_EXTERNAL_RADIUS_AUTH) {
285 res = hostapd_acl_cache_get(hapd, addr, session_timeout,
294 query = hapd->acl_queries;
312 if (!hapd->conf->radius->auth_server)
323 if (hostapd_radius_acl_query(hapd, addr, query)) {
339 query->next = hapd->acl_queries;
340 hapd->acl_queries = query;
353 static void hostapd_acl_expire_cache(struct hostapd_data *hapd,
359 entry = hapd->acl_cache;
369 hapd->acl_cache = entry->next;
370 hostapd_drv_set_radius_acl_expire(hapd, entry->addr);
383 static void hostapd_acl_expire_queries(struct hostapd_data *hapd,
389 entry = hapd->acl_queries;
399 hapd->acl_queries = entry->next;
415 * @hapd: struct hostapd_data *
417 void hostapd_acl_expire(struct hostapd_data *hapd)
422 hostapd_acl_expire_cache(hapd, &now);
423 hostapd_acl_expire_queries(hapd, &now);
427 static void decode_tunnel_passwords(struct hostapd_data *hapd,
470 hostapd_logger(hapd, cache->addr,
508 struct hostapd_data *hapd = data;
514 query = hapd->acl_queries;
577 decode_tunnel_passwords(hapd, shared_secret, shared_secret_len,
594 if (hapd->conf->wpa_psk_radius == PSK_RADIUS_REQUIRED &&
599 !hostapd_vlan_valid(hapd->conf->vlan, &cache->vlan_id)) {
600 hostapd_logger(hapd, query->addr,
608 if (hapd->conf->ssid.dynamic_vlan == DYNAMIC_VLAN_REQUIRED &&
613 cache->next = hapd->acl_cache;
614 hapd->acl_cache = cache;
617 hostapd_drv_set_radius_acl_auth(hapd, query->addr, cache->accepted,
624 ieee802_11_mgmt(hapd, query->auth_msg, query->auth_msg_len, NULL);
630 hapd->acl_queries = query->next;
643 * @hapd: hostapd BSS data
646 int hostapd_acl_init(struct hostapd_data *hapd)
649 if (radius_client_register(hapd->radius, RADIUS_AUTH,
650 hostapd_acl_recv_radius, hapd))
660 * @hapd: hostapd BSS data
662 void hostapd_acl_deinit(struct hostapd_data *hapd)
667 hostapd_acl_cache_free(hapd->acl_cache);
668 hapd->acl_cache = NULL;
671 query = hapd->acl_queries;
672 hapd->acl_queries = NULL;