Lines Matching +full:- +full:e

2  * wpa_supplicant - List of temporarily ignored BSSIDs
3 * Copyright (c) 2003-2021, Jouni Malinen <j@w1.fi>
16 * wpa_bssid_ignore_get - Get the ignore list entry for a BSSID
24 struct wpa_bssid_ignore *e; in wpa_bssid_ignore_get() local
29 if (wpa_s->current_ssid && in wpa_bssid_ignore_get()
30 wpa_s->current_ssid->was_recently_reconfigured) { in wpa_bssid_ignore_get()
32 wpa_s->current_ssid->was_recently_reconfigured = false; in wpa_bssid_ignore_get()
38 e = wpa_s->bssid_ignore; in wpa_bssid_ignore_get()
39 while (e) { in wpa_bssid_ignore_get()
40 if (ether_addr_equal(e->bssid, bssid)) in wpa_bssid_ignore_get()
41 return e; in wpa_bssid_ignore_get()
42 e = e->next; in wpa_bssid_ignore_get()
50 * wpa_bssid_ignore_add - Add an BSSID to the ignore list
53 * Returns: Current ignore list count on success, -1 on failure
67 struct wpa_bssid_ignore *e; in wpa_bssid_ignore_add() local
71 return -1; in wpa_bssid_ignore_add()
73 e = wpa_bssid_ignore_get(wpa_s, bssid); in wpa_bssid_ignore_add()
75 if (e) { in wpa_bssid_ignore_add()
76 e->start = now; in wpa_bssid_ignore_add()
77 e->count++; in wpa_bssid_ignore_add()
78 if (e->count > 5) in wpa_bssid_ignore_add()
79 e->timeout_secs = 1800; in wpa_bssid_ignore_add()
80 else if (e->count == 5) in wpa_bssid_ignore_add()
81 e->timeout_secs = 600; in wpa_bssid_ignore_add()
82 else if (e->count == 4) in wpa_bssid_ignore_add()
83 e->timeout_secs = 120; in wpa_bssid_ignore_add()
84 else if (e->count == 3) in wpa_bssid_ignore_add()
85 e->timeout_secs = 60; in wpa_bssid_ignore_add()
87 e->timeout_secs = 10; in wpa_bssid_ignore_add()
90 MAC2STR(bssid), e->count, e->timeout_secs); in wpa_bssid_ignore_add()
91 return e->count; in wpa_bssid_ignore_add()
94 e = os_zalloc(sizeof(*e)); in wpa_bssid_ignore_add()
95 if (e == NULL) in wpa_bssid_ignore_add()
96 return -1; in wpa_bssid_ignore_add()
97 os_memcpy(e->bssid, bssid, ETH_ALEN); in wpa_bssid_ignore_add()
98 e->count = 1; in wpa_bssid_ignore_add()
99 e->timeout_secs = 10; in wpa_bssid_ignore_add()
100 e->start = now; in wpa_bssid_ignore_add()
101 e->next = wpa_s->bssid_ignore; in wpa_bssid_ignore_add()
102 wpa_s->bssid_ignore = e; in wpa_bssid_ignore_add()
105 MAC2STR(bssid), e->timeout_secs); in wpa_bssid_ignore_add()
107 return e->count; in wpa_bssid_ignore_add()
112 * wpa_bssid_ignore_del - Remove an BSSID from the ignore list
115 * Returns: 0 on success, -1 on failure
119 struct wpa_bssid_ignore *e, *prev = NULL; in wpa_bssid_ignore_del() local
122 return -1; in wpa_bssid_ignore_del()
124 e = wpa_s->bssid_ignore; in wpa_bssid_ignore_del()
125 while (e) { in wpa_bssid_ignore_del()
126 if (ether_addr_equal(e->bssid, bssid)) { in wpa_bssid_ignore_del()
128 wpa_s->bssid_ignore = e->next; in wpa_bssid_ignore_del()
130 prev->next = e->next; in wpa_bssid_ignore_del()
134 os_free(e); in wpa_bssid_ignore_del()
137 prev = e; in wpa_bssid_ignore_del()
138 e = e->next; in wpa_bssid_ignore_del()
140 return -1; in wpa_bssid_ignore_del()
145 * wpa_bssid_ignore_is_listed - Check whether a BSSID is ignored temporarily
152 struct wpa_bssid_ignore *e; in wpa_bssid_ignore_is_listed() local
155 e = wpa_bssid_ignore_get(wpa_s, bssid); in wpa_bssid_ignore_is_listed()
156 if (!e) in wpa_bssid_ignore_is_listed()
159 if (os_reltime_expired(&now, &e->start, e->timeout_secs)) in wpa_bssid_ignore_is_listed()
161 return e->count; in wpa_bssid_ignore_is_listed()
166 * wpa_bssid_ignore_clear - Clear the ignore list of all entries
171 struct wpa_bssid_ignore *e, *prev; in wpa_bssid_ignore_clear() local
173 e = wpa_s->bssid_ignore; in wpa_bssid_ignore_clear()
174 wpa_s->bssid_ignore = NULL; in wpa_bssid_ignore_clear()
175 while (e) { in wpa_bssid_ignore_clear()
176 prev = e; in wpa_bssid_ignore_clear()
177 e = e->next; in wpa_bssid_ignore_clear()
179 " from ignore list (clear)", MAC2STR(prev->bssid)); in wpa_bssid_ignore_clear()
186 * wpa_bssid_ignore_update - Update the entries in the ignore list,
192 struct wpa_bssid_ignore *e, *prev = NULL; in wpa_bssid_ignore_update() local
198 e = wpa_s->bssid_ignore; in wpa_bssid_ignore_update()
200 while (e) { in wpa_bssid_ignore_update()
201 if (os_reltime_expired(&now, &e->start, in wpa_bssid_ignore_update()
202 e->timeout_secs + 3600)) { in wpa_bssid_ignore_update()
203 struct wpa_bssid_ignore *to_delete = e; in wpa_bssid_ignore_update()
206 prev->next = e->next; in wpa_bssid_ignore_update()
207 e = prev->next; in wpa_bssid_ignore_update()
209 wpa_s->bssid_ignore = e->next; in wpa_bssid_ignore_update()
210 e = wpa_s->bssid_ignore; in wpa_bssid_ignore_update()
214 MAC2STR(to_delete->bssid)); in wpa_bssid_ignore_update()
217 prev = e; in wpa_bssid_ignore_update()
218 e = e->next; in wpa_bssid_ignore_update()