3 * Copyright (c) 2010, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
15 #include "utils/includes.h"
17 #include "utils/common.h"
21 struct wlantest_sta * sta_get(struct wlantest_bss *bss, const u8 *addr)
23 struct wlantest_sta *sta;
26 return NULL; /* Skip group addressed frames */
28 dl_list_for_each(sta, &bss->sta, struct wlantest_sta, list) {
29 if (os_memcmp(sta->addr, addr, ETH_ALEN) == 0)
33 sta = os_zalloc(sizeof(*sta));
36 os_memcpy(sta->addr, addr, ETH_ALEN);
37 dl_list_add(&bss->sta, &sta->list);
38 wpa_printf(MSG_DEBUG, "Discovered new STA " MACSTR " in BSS " MACSTR,
39 MAC2STR(sta->addr), MAC2STR(bss->bssid));
44 void sta_deinit(struct wlantest_sta *sta)
46 dl_list_del(&sta->list);