commit ab5742bb3229f04396f9a2dcceb1f2e53ad6736f
parent b45242562b56d4596e5208f994887fbc47da13be
Author: Marcel Holtmann <marcel@holtmann.org>
Date: Thu, 7 Nov 2019 23:33:51 +0100
module: Move declarations into separate header file
Diffstat:
28 files changed, 77 insertions(+), 32 deletions(-)
diff --git a/Makefile.am b/Makefile.am
@@ -225,7 +225,7 @@ src_iwd_SOURCES = src/main.c linux/nl80211.h src/iwd.h src/missing.h \
src/resolve.h src/resolve.c\
src/hotspot.c \
src/p2putil.h src/p2putil.c \
- src/module.c \
+ src/module.h src/module.c \
src/rrm.c \
$(eap_sources) \
$(builtin_sources)
diff --git a/src/adhoc.c b/src/adhoc.c
@@ -29,6 +29,7 @@
#include "linux/nl80211.h"
#include "src/iwd.h"
+#include "src/module.h"
#include "src/device.h"
#include "src/netdev.h"
#include "src/wiphy.h"
diff --git a/src/agent.c b/src/agent.c
@@ -30,6 +30,7 @@
#include "src/dbus.h"
#include "src/agent.h"
#include "src/iwd.h"
+#include "src/module.h"
static unsigned int next_request_id = 0;
diff --git a/src/anqp.c b/src/anqp.c
@@ -28,6 +28,7 @@
#include <ell/ell.h>
+#include "src/module.h"
#include "src/anqp.h"
#include "src/util.h"
#include "src/eap-private.h"
diff --git a/src/ap.c b/src/ap.c
@@ -32,6 +32,7 @@
#include "linux/nl80211.h"
#include "src/iwd.h"
+#include "src/module.h"
#include "src/scan.h"
#include "src/device.h"
#include "src/netdev.h"
diff --git a/src/blacklist.c b/src/blacklist.c
@@ -29,6 +29,7 @@
#include "src/blacklist.h"
#include "src/util.h"
#include "src/iwd.h"
+#include "src/module.h"
/*
* The current timeout is multiplied by this value after an entry is blacklisted
diff --git a/src/device.c b/src/device.c
@@ -31,6 +31,7 @@
#include <ell/ell.h>
#include "src/iwd.h"
+#include "src/module.h"
#include "src/util.h"
#include "src/wiphy.h"
#include "src/scan.h"
diff --git a/src/eap.c b/src/eap.c
@@ -31,6 +31,7 @@
#include <ell/ell.h>
#include "src/missing.h"
+#include "src/module.h"
#include "src/eap.h"
#include "src/eap-private.h"
#include "src/iwd.h"
diff --git a/src/eapol.c b/src/eapol.c
@@ -31,6 +31,7 @@
#include <ell/ell.h>
#include "src/missing.h"
+#include "src/module.h"
#include "src/crypto.h"
#include "src/eapol.h"
#include "src/ie.h"
diff --git a/src/erp.c b/src/erp.c
@@ -32,6 +32,7 @@
#include "src/missing.h"
#include "src/iwd.h"
+#include "src/module.h"
#include "src/eap-private.h"
#include "src/erp.h"
#include "src/crypto.h"
diff --git a/src/hotspot.c b/src/hotspot.c
@@ -31,6 +31,7 @@
#include <ell/ell.h>
#include "src/iwd.h"
+#include "src/module.h"
#include "src/common.h"
#include "src/network.h"
#include "src/util.h"
diff --git a/src/iwd.h b/src/iwd.h
@@ -35,33 +35,3 @@ const char *iwd_get_iface_blacklist(void);
const char *iwd_get_phy_whitelist(void);
const char *iwd_get_phy_blacklist(void);
-
-struct iwd_module_desc {
- const char *name;
- int (*init)(void);
- void (*exit)(void);
- bool active;
-} __attribute__((aligned(8)));
-
-struct iwd_module_depends {
- const char *self;
- const char *target;
-};
-
-#define IWD_MODULE(name, init, exit) \
- static struct iwd_module_desc __iwd_module_ ## name \
- __attribute__((used, section("__iwd_module"), aligned(8))) = {\
- #name, init, exit \
- };
-
-#define IWD_MODULE_DEPENDS(name, dep) \
- static struct iwd_module_depends \
- __iwd_module__##name_##dep \
- __attribute__((used, section("__iwd_module_dep"), \
- aligned(8))) = { \
- .self = #name, \
- .target = #dep, \
- };
-
-int iwd_modules_init();
-void iwd_modules_exit();
diff --git a/src/knownnetworks.c b/src/knownnetworks.c
@@ -35,6 +35,7 @@
#include <ell/ell.h>
#include "src/iwd.h"
+#include "src/module.h"
#include "src/storage.h"
#include "src/common.h"
#include "src/network.h"
diff --git a/src/main.c b/src/main.c
@@ -34,6 +34,7 @@
#include "linux/nl80211.h"
#include "src/iwd.h"
+#include "src/module.h"
#include "src/wiphy.h"
#include "src/dbus.h"
#include "src/eap.h"
diff --git a/src/manager.c b/src/manager.c
@@ -36,6 +36,7 @@
#include "src/nl80211util.h"
#include "src/iwd.h"
+#include "src/module.h"
#include "src/netdev.h"
#include "src/wiphy.h"
#include "src/util.h"
diff --git a/src/module.c b/src/module.c
@@ -26,7 +26,7 @@
#include <errno.h>
#include <ell/ell.h>
-#include "src/iwd.h"
+#include "src/module.h"
struct dependency {
struct dependency *next;
diff --git a/src/module.h b/src/module.h
@@ -0,0 +1,51 @@
+/*
+ *
+ * Wireless daemon for Linux
+ *
+ * Copyright (C) 2019 Intel Corporation. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+struct iwd_module_desc {
+ const char *name;
+ int (*init)(void);
+ void (*exit)(void);
+ bool active;
+} __attribute__((aligned(8)));
+
+struct iwd_module_depends {
+ const char *self;
+ const char *target;
+};
+
+#define IWD_MODULE(name, init, exit) \
+ static struct iwd_module_desc __iwd_module_ ## name \
+ __attribute__((used, section("__iwd_module"), aligned(8))) = {\
+ #name, init, exit \
+ };
+
+#define IWD_MODULE_DEPENDS(name, dep) \
+ static struct iwd_module_depends \
+ __iwd_module__##name_##dep \
+ __attribute__((used, section("__iwd_module_dep"), \
+ aligned(8))) = { \
+ .self = #name, \
+ .target = #dep, \
+ };
+
+int iwd_modules_init();
+void iwd_modules_exit();
diff --git a/src/netconfig.c b/src/netconfig.c
@@ -34,6 +34,7 @@
#include <ell/ell.h>
#include "src/iwd.h"
+#include "src/module.h"
#include "src/netdev.h"
#include "src/station.h"
#include "src/common.h"
diff --git a/src/netdev.c b/src/netdev.c
@@ -42,6 +42,7 @@
#include "linux/nl80211.h"
#include "src/iwd.h"
+#include "src/module.h"
#include "src/wiphy.h"
#include "src/ie.h"
#include "src/mpdu.h"
diff --git a/src/network.c b/src/network.c
@@ -33,6 +33,7 @@
#include <ell/ell.h>
#include "src/missing.h"
+#include "src/module.h"
#include "src/ie.h"
#include "src/crypto.h"
#include "src/iwd.h"
diff --git a/src/resolve.c b/src/resolve.c
@@ -33,6 +33,7 @@
#include <ell/ell.h>
#include "src/iwd.h"
+#include "src/module.h"
#include "src/dbus.h"
#include "src/resolve.h"
diff --git a/src/rfkill.c b/src/rfkill.c
@@ -35,6 +35,7 @@
#include <ell/ell.h>
#include "src/iwd.h"
+#include "src/module.h"
#include "src/common.h"
#include "src/rfkill.h"
diff --git a/src/rrm.c b/src/rrm.c
@@ -30,6 +30,7 @@
#include <ell/ell.h>
+#include "src/module.h"
#include "src/mpdu.h"
#include "src/netdev.h"
#include "src/iwd.h"
diff --git a/src/scan.c b/src/scan.c
@@ -37,6 +37,7 @@
#include "linux/nl80211.h"
#include "src/iwd.h"
+#include "src/module.h"
#include "src/wiphy.h"
#include "src/ie.h"
#include "src/common.h"
diff --git a/src/simauth.c b/src/simauth.c
@@ -30,6 +30,7 @@
#include <ell/ell.h>
#include "src/iwd.h"
+#include "src/module.h"
#include "src/watchlist.h"
#include "src/simauth.h"
diff --git a/src/station.c b/src/station.c
@@ -35,6 +35,7 @@
#include "src/util.h"
#include "src/iwd.h"
+#include "src/module.h"
#include "src/common.h"
#include "src/device.h"
#include "src/watchlist.h"
diff --git a/src/wiphy.c b/src/wiphy.c
@@ -38,6 +38,7 @@
#include "linux/nl80211.h"
#include "src/iwd.h"
+#include "src/module.h"
#include "src/ie.h"
#include "src/crypto.h"
#include "src/scan.h"
diff --git a/src/wsc.c b/src/wsc.c
@@ -29,6 +29,7 @@
#include <ell/ell.h>
#include "src/missing.h"
+#include "src/module.h"
#include "src/dbus.h"
#include "src/netdev.h"
#include "src/wiphy.h"