mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
schedule a client update
This commit is contained in:
parent
0595784480
commit
fe848b8231
3 changed files with 12 additions and 4 deletions
|
@ -32,4 +32,6 @@ int ubus_send_probe_via_network(struct probe_entry_s probe_entry);
|
||||||
|
|
||||||
void update_hostapd_sockets(struct uloop_timeout *t);
|
void update_hostapd_sockets(struct uloop_timeout *t);
|
||||||
|
|
||||||
|
void add_client_update_timer(time_t time);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -175,6 +175,8 @@ void kick_clients(uint8_t bssid[], uint32_t id) {
|
||||||
print_client_entry(client_array[j]);
|
print_client_entry(client_array[j]);
|
||||||
del_client_interface(id, client_array[j].client_addr, 5, 1, 60000);
|
del_client_interface(id, client_array[j].client_addr, 5, 1, 60000);
|
||||||
client_array_delete(client_array[j]);
|
client_array_delete(client_array[j]);
|
||||||
|
add_client_update_timer(timeout_config.update_client * 1000 / 4);
|
||||||
|
break;
|
||||||
|
|
||||||
// no entry in probe array for own bssid
|
// no entry in probe array for own bssid
|
||||||
} else if (kick_client(client_array[j]) == -1) {
|
} else if (kick_client(client_array[j]) == -1) {
|
||||||
|
|
|
@ -24,13 +24,12 @@ static struct blob_buf b;
|
||||||
|
|
||||||
void update_clients(struct uloop_timeout *t);
|
void update_clients(struct uloop_timeout *t);
|
||||||
|
|
||||||
struct uloop_timeout hostapd_timer = {
|
|
||||||
.cb = update_hostapd_sockets
|
|
||||||
};
|
|
||||||
|
|
||||||
struct uloop_timeout client_timer = {
|
struct uloop_timeout client_timer = {
|
||||||
.cb = update_clients
|
.cb = update_clients
|
||||||
};
|
};
|
||||||
|
struct uloop_timeout hostapd_timer = {
|
||||||
|
.cb = update_hostapd_sockets
|
||||||
|
};
|
||||||
|
|
||||||
#define MAX_HOSTAPD_SOCKETS 10
|
#define MAX_HOSTAPD_SOCKETS 10
|
||||||
uint32_t hostapd_sock_arr[MAX_HOSTAPD_SOCKETS];
|
uint32_t hostapd_sock_arr[MAX_HOSTAPD_SOCKETS];
|
||||||
|
@ -140,6 +139,11 @@ int hostapd_array_check_id(uint32_t id);
|
||||||
void hostapd_array_insert(uint32_t id);
|
void hostapd_array_insert(uint32_t id);
|
||||||
void hostapd_array_delete(uint32_t id);
|
void hostapd_array_delete(uint32_t id);
|
||||||
|
|
||||||
|
void add_client_update_timer(time_t time)
|
||||||
|
{
|
||||||
|
uloop_timeout_set(&client_timer, time);
|
||||||
|
}
|
||||||
|
|
||||||
int hostapd_array_check_id(uint32_t id)
|
int hostapd_array_check_id(uint32_t id)
|
||||||
{
|
{
|
||||||
for(int i = 0; i <= hostapd_sock_last; i++)
|
for(int i = 0; i <= hostapd_sock_last; i++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue