mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
refactor compare station count
This commit is contained in:
parent
061a477a20
commit
50167ac917
1 changed files with 13 additions and 30 deletions
|
@ -267,39 +267,22 @@ int compare_station_count(uint8_t *bssid_addr_own, uint8_t *bssid_addr_to_compar
|
||||||
printf("Comparing own %d to %d\n", ap_entry_own.station_count, ap_entry_to_compre.station_count);
|
printf("Comparing own %d to %d\n", ap_entry_own.station_count, ap_entry_to_compre.station_count);
|
||||||
|
|
||||||
|
|
||||||
if (automatic_kick) {
|
int sta_count = ap_entry_own.station_count;
|
||||||
return ((int)ap_entry_own.station_count - 1) > (int)ap_entry_to_compre.station_count;
|
int sta_count_to_compare = ap_entry_to_compre.station_count;
|
||||||
} else {
|
if(is_connected(bssid_addr_own, client_addr))
|
||||||
|
|
||||||
int sta_count = ap_entry_own.station_count;
|
|
||||||
int sta_count_to_compare = ap_entry_to_compre.station_count;
|
|
||||||
if(is_connected(bssid_addr_own, client_addr))
|
|
||||||
{
|
|
||||||
printf("OWN IS ALREADY CONNECTED! DECREASE COUNTER!!!\n");
|
|
||||||
sta_count--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(is_connected(bssid_addr_to_compare, client_addr))
|
|
||||||
{
|
|
||||||
printf("COMPARE IS ALREADY CONNECTED! DECREASE COUNTER!!!\n");
|
|
||||||
sta_count_to_compare--;
|
|
||||||
}
|
|
||||||
|
|
||||||
return sta_count > sta_count_to_compare;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
int own_count = ap_entry_own.station_count;
|
|
||||||
if(automatic_kick)
|
|
||||||
{
|
{
|
||||||
own_count--;
|
printf("OWN IS ALREADY CONNECTED! DECREASE COUNTER!!!\n");
|
||||||
}
|
sta_count--;
|
||||||
if (is_connected(bssid_addr_to_compare, client_addr))
|
|
||||||
{
|
|
||||||
own_count--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return own_count > ap_entry_to_compre.station_count;*/
|
if(is_connected(bssid_addr_to_compare, client_addr))
|
||||||
|
{
|
||||||
|
printf("COMPARE IS ALREADY CONNECTED! DECREASE COUNTER!!!\n");
|
||||||
|
sta_count_to_compare--;
|
||||||
|
}
|
||||||
|
printf("AFTER: Comparing own %d to %d\n", sta_count, sta_count_to_compare);
|
||||||
|
|
||||||
|
return sta_count > sta_count_to_compare;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue