3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 17:59:25 +01:00

blacklist: Convert to use IWD_MODULE

This commit is contained in:
Denis Kenzior 2019-05-19 13:01:22 -05:00
parent a1d9c07f2f
commit b8f6899f40
3 changed files with 8 additions and 10 deletions

View File

@ -152,7 +152,7 @@ void blacklist_remove_bss(const uint8_t *addr)
l_free(entry);
}
void blacklist_init(void)
static int blacklist_init(void)
{
const struct l_settings *config = iwd_get_config();
@ -168,16 +168,21 @@ void blacklist_init(void)
&blacklist_multiplier))
blacklist_multiplier = BLACKLIST_DEFAULT_MULTIPLIER;
if (!l_settings_get_uint64(config, "Blacklist", "bss_blacklist_max_time",
if (!l_settings_get_uint64(config, "Blacklist",
"bss_blacklist_max_time",
&blacklist_max_timeout))
blacklist_max_timeout = BLACKLIST_DEFAULT_MAX_TIMEOUT;
blacklist_max_timeout *= 1000000;
blacklist = l_queue_new();
return 0;
}
void blacklist_exit(void)
static void blacklist_exit(void)
{
l_queue_destroy(blacklist, l_free);
}
IWD_MODULE(blacklist, blacklist_init, blacklist_exit)

View File

@ -23,6 +23,3 @@
void blacklist_add_bss(const uint8_t *addr);
bool blacklist_contains_bss(const uint8_t *addr);
void blacklist_remove_bss(const uint8_t *addr);
void blacklist_init(void);
void blacklist_exit(void);

View File

@ -44,7 +44,6 @@
#include "src/plugin.h"
#include "src/simauth.h"
#include "src/adhoc.h"
#include "src/blacklist.h"
#include "src/storage.h"
#include "src/backtrace.h"
@ -531,8 +530,6 @@ int main(int argc, char *argv[])
network_init();
known_networks_init();
sim_auth_init();
blacklist_init();
if (iwd_modules_init() < 0)
goto fail_modules;
@ -543,7 +540,6 @@ int main(int argc, char *argv[])
fail_modules:
iwd_modules_exit();
blacklist_exit();
sim_auth_exit();
known_networks_exit();
network_exit();