From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH v2 03/12] eapol: utilize IWD_MODULE
Date: Fri, 11 Oct 2019 12:29:24 -0700 [thread overview]
Message-ID: <20191011192933.13550-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20191011192933.13550-1-prestwoj@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2326 bytes --]
This converts eapol to using IWD modules. The init/exit APIs did need
to remain exposed for unit tests.
Netdev was updated to depend on eapol.
---
src/eapol.c | 11 ++++++-----
src/eapol.h | 4 ++--
src/main.c | 2 --
src/netdev.c | 1 +
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/eapol.c b/src/eapol.c
index 414d1c69..6732b370 100644
--- a/src/eapol.c
+++ b/src/eapol.c
@@ -40,6 +40,7 @@
#include "src/handshake.h"
#include "src/watchlist.h"
#include "src/erp.h"
+#include "src/iwd.h"
static struct l_queue *state_machines;
static struct l_queue *preauths;
@@ -2705,16 +2706,16 @@ void __eapol_set_config(struct l_settings *config)
eapol_4way_handshake_time = 5;
}
-bool eapol_init()
+int eapol_init(void)
{
state_machines = l_queue_new();
preauths = l_queue_new();
watchlist_init(&frame_watches, &eapol_frame_watch_ops);
- return true;
+ return 0;
}
-bool eapol_exit()
+void eapol_exit(void)
{
if (!l_queue_isempty(state_machines))
l_warn("stale eapol state machines found");
@@ -2727,6 +2728,6 @@ bool eapol_exit()
l_queue_destroy(preauths, preauth_sm_destroy);
watchlist_destroy(&frame_watches);
-
- return true;
}
+
+IWD_MODULE(eapol, eapol_init, eapol_exit);
diff --git a/src/eapol.h b/src/eapol.h
index 1a1862bd..9462b56d 100644
--- a/src/eapol.h
+++ b/src/eapol.h
@@ -128,5 +128,5 @@ struct preauth_sm *eapol_preauth_start(const uint8_t *aa,
eapol_preauth_destroy_func_t destroy);
void eapol_preauth_cancel(uint32_t ifindex);
-bool eapol_init();
-bool eapol_exit();
+int eapol_init(void);
+void eapol_exit(void);
diff --git a/src/main.c b/src/main.c
index 4ff5f010..1acee95e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -482,14 +482,12 @@ int main(int argc, char *argv[])
dbus_init(dbus);
eap_init(eap_mtu);
- eapol_init();
exit_status = l_main_run_with_signal(signal_handler, NULL);
plugin_exit();
iwd_modules_exit();
- eapol_exit();
eap_exit();
if (nl80211) {
diff --git a/src/netdev.c b/src/netdev.c
index 1828f5d0..0785f0c4 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -4841,3 +4841,4 @@ void netdev_shutdown(void)
}
IWD_MODULE(netdev, netdev_init, netdev_exit);
+IWD_MODULE_DEPENDS(netdev, eapol);
--
2.17.1
next prev parent reply other threads:[~2019-10-11 19:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 19:29 [PATCH v2 01/12] main: move module init into nl80211_appeared James Prestwood
2019-10-11 19:29 ` [PATCH v2 02/12] netdev: utilize IWD_MODULE James Prestwood
2019-10-11 19:29 ` James Prestwood [this message]
2019-10-11 19:29 ` [PATCH v2 04/12] anqp: " James Prestwood
2019-10-11 19:29 ` [PATCH v2 05/12] manager: remove white/black list from argument James Prestwood
2019-10-11 19:29 ` [PATCH v2 06/12] manager: utilize IWD_MODULE James Prestwood
2019-10-11 19:29 ` [PATCH v2 07/12] wiphy: remove white/blacklist from wiphy_init James Prestwood
2019-10-11 19:29 ` [PATCH v2 08/12] wiphy: utilize IWD_MODULE James Prestwood
2019-10-11 19:29 ` [PATCH v2 09/12] eap: remove mtu argument from eap_init James Prestwood
2019-10-11 19:29 ` [PATCH v2 10/12] wired: update with new eap_init James Prestwood
2019-10-11 19:29 ` [PATCH v2 11/12] unit: update wsc/eapol " James Prestwood
2019-10-11 19:29 ` [PATCH v2 12/12] eap: utilize IWD_MODULE James Prestwood
2019-10-11 20:49 ` [PATCH v2 01/12] main: move module init into nl80211_appeared Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191011192933.13550-3-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox