Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 03/11] eapol: utilize IWD_MODULE
Date: Fri, 11 Oct 2019 10:24:09 -0700	[thread overview]
Message-ID: <20191011172417.23328-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20191011172417.23328-1-prestwoj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2396 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 7707dfb8..2e8d4a6d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -480,7 +480,6 @@ int main(int argc, char *argv[])
 	dbus_init(dbus);
 
 	eap_init(eap_mtu);
-	eapol_init();
 
 	plugin_init(plugins, noplugins);
 	exit_status = l_main_run_with_signal(signal_handler, NULL);
@@ -488,7 +487,6 @@ int main(int argc, char *argv[])
 
 	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

  parent reply	other threads:[~2019-10-11 17:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 17:24 [PATCH 01/11] main: move module init into nl80211_appeared James Prestwood
2019-10-11 17:24 ` [PATCH 02/11] netdev: utilize IWD_MODULE James Prestwood
2019-10-11 17:24 ` James Prestwood [this message]
2019-10-11 17:24 ` [PATCH 04/11] anqp: " James Prestwood
2019-10-11 17:24 ` [PATCH 05/11] agent: " James Prestwood
2019-10-11 18:53   ` Denis Kenzior
2019-10-11 17:24 ` [PATCH 06/11] manager: " James Prestwood
2019-10-11 18:57   ` Denis Kenzior
2019-10-11 17:24 ` [PATCH 07/11] wiphy: " James Prestwood
2019-10-11 17:24 ` [PATCH 08/11] eap: remove mtu argument from eap_init James Prestwood
2019-10-11 17:24 ` [PATCH 09/11] wired: update with new eap_init James Prestwood
2019-10-11 17:24 ` [PATCH 10/11] unit: update wsc/eapol " James Prestwood
2019-10-11 17:24 ` [PATCH 11/11] eap: utilize IWD_MODULE James Prestwood

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=20191011172417.23328-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