/*
* hostapd / AP table
- * Copyright 2002-2003, Jouni Malinen <j@w1.fi>
- * Copyright 2003-2004, Instant802 Networks, Inc.
- * Copyright 2006, Devicescape Software, Inc.
+ * Copyright (c) 2002-2003, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2003-2004, Instant802 Networks, Inc.
+ * Copyright (c) 2006, Devicescape Software, Inc.
+ * Copyright (c) 2007-2008, Intel Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
#include "includes.h"
#include "hostapd.h"
+#include "config.h"
#include "ieee802_11.h"
#include "eloop.h"
+#include "sta_info.h"
#include "ap_list.h"
#include "hw_features.h"
#include "beacon.h"
+#include "drivers/driver.h"
struct ieee80211_frame_info {
* in this link will thus be the least recently used entry. */
-static void ap_list_new_ap(struct hostapd_iface *iface, struct ap_info *ap)
-{
- wpa_printf(MSG_DEBUG, "New AP detected: " MACSTR, MAC2STR(ap->addr));
-
- /* TODO: could send a notification message to an external program that
- * would then determine whether a rogue AP has been detected */
-}
-
-
-static void ap_list_expired_ap(struct hostapd_iface *iface, struct ap_info *ap)
-{
- wpa_printf(MSG_DEBUG, "AP info expired: " MACSTR, MAC2STR(ap->addr));
-
- /* TODO: could send a notification message to an external program */
-}
-
-
static int ap_list_beacon_olbc(struct hostapd_iface *iface, struct ap_info *ap)
{
int i;
if (iface->num_ap > iface->conf->ap_table_max_size && ap != ap->prev) {
wpa_printf(MSG_DEBUG, "Removing the least recently used AP "
MACSTR " from AP table", MAC2STR(ap->prev->addr));
- if (iface->conf->passive_scan_interval > 0)
- ap_list_expired_ap(iface, ap->prev);
ap_free_ap(iface, ap->prev);
}
ap->datarate = fi->datarate;
}
- if (new_ap) {
- if (iface->conf->passive_scan_interval > 0)
- ap_list_new_ap(iface, ap);
- } else if (ap != iface->ap_list) {
+ if (!new_ap && ap != iface->ap_list) {
/* move AP entry into the beginning of the list so that the
* oldest entry is always in the end of the list */
ap_ap_list_del(iface, ap);
time(&now);
- /* FIX: it looks like jkm-Purina ended up in busy loop in this
- * function. Apparently, something can still cause a loop in the AP
- * list.. */
-
while (iface->ap_list) {
ap = iface->ap_list->prev;
if (ap->last_beacon + iface->conf->ap_table_expiration_time >=
now)
break;
- if (iface->conf->passive_scan_interval > 0)
- ap_list_expired_ap(iface, ap);
ap_free_ap(iface, ap);
}
now)
break;
- if (iface->conf->passive_scan_interval > 0)
- ap_list_expired_ap(iface, iface->ap_list->prev);
ap_free_ap(iface, iface->ap_list->prev);
}