Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."
Today's Topics:
1. Re: Re: Does ConnMan support 802.1X authentication over wifi?
([email protected])
2. [PATCH] service: Add warning message why 8021x setup fails
(Daniel Wagner)
3. Re: connman Digest, Vol 28, Issue 4 (Daniel Wagner)
4. [RFC 0/3] Only cleanup devices which are supported (Daniel Wagner)
5. [RFC 2/3] technology: Add __connman_technology_is_supported()
(Daniel Wagner)
6. [RFC 3/3] device: Only cleanup devices which are supported
(Daniel Wagner)
7. [RFC 1/3] plugins: Introduce explicit technology un/register
(Daniel Wagner)
----------------------------------------------------------------------
Message: 1
Date: Sat, 10 Feb 2018 10:56:53 +0800
From: "[email protected]" <[email protected]>
To: "Vasyl Vavrychuk" <[email protected]>
Cc: connman <[email protected]>
Subject: Re: Re: Does ConnMan support 802.1X authentication over wifi?
Message-ID: <[email protected]>+5981C0BD138AAC1E
Content-Type: text/plain; charset="utf-8"
hi Vasyl,
i see "man connman-service.config", and connect ieee802.1x tls
method type Wifi.
i really really try many many times to config the parser, but connmanctl report
"Error /net/connman/service/wifi_7cdd90caf78b_526f79_managed_ieee8021x: Input
error"
my "/usr/local/var/lib/connman/tls.config" as follows
[service_tls]
Type = wifi
SSID = Roy
EAP = tls
CACertFile = /home/echo/work/user/tls/ca.pem
ClientCertFile = /home/echo/work/user/tls/client.p12
PrivateKeyFile = /home/echo/work/user/tls/client.key
Identity = user
PrivateKeyPassphraseType = fsid
and now i have files named "ca.pem, client.pem, client.p12" on my freeradius
centos server,
i am not sure that the "PrivateKeyFile = /home/user/.certs/client.fsid.pem,
PrivateKeyPassphraseType = fsid,
Identity = user" is right or not?
Thanks,
Vasyl
[email protected]
From: Vasyl Vavrychuk
Date: 2018-02-07 23:27
To: [email protected]
Subject: Re: Does ConnMan support 802.1X authentication over wifi?
You have to write provision file with connection parameters in the
case of 802.1X, see 'man connman-service.config'
On Wed, Feb 7, 2018 at 8:49 AM, [email protected] <[email protected]> wrote:
> Hi all,
>
> My team 's network requires 802.1X authentication for wifi. I can connect to
> it with my Arch Linux machine using dhcpcd and wpa-supplicant, but despite
> various efforts I haven't been able to write a working ConnMan profile. On
> the other hand, connecting to our Eduroam network via wifi works as
> expected.
>
> Am I missing something or doesn't ConnMan support 802.1X authentication over
> wifi at all?
>
> Best wishes
>
> ________________________________
>
>
> _______________________________________________
> connman mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/connman
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20180210/095a5144/attachment-0001.html>
------------------------------
Message: 2
Date: Sat, 10 Feb 2018 11:14:37 +0100
From: Daniel Wagner <[email protected]>
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Subject: [PATCH] service: Add warning message why 8021x setup fails
Message-ID: <[email protected]>
ConnMan can be a bit more verbose why it fails to setup a
network. Just to return -EINVAL makes it hard to find out why a
provisioning setup doesn't work.
---
src/config.c | 9 ++++++---
src/service.c | 9 ++++++++-
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/config.c b/src/config.c
index 000a4fbf1926..1f1ba11b7070 100644
--- a/src/config.c
+++ b/src/config.c
@@ -570,8 +570,8 @@ static bool load_service(GKeyFile *keyfile, const char
*group,
g_free(service->type);
service->type = str;
} else {
- DBG("Type of the configured service is missing for group %s",
- group);
+ connman_warn("Type of the configured service is missing "
+ "for group %s", group);
goto err;
}
@@ -808,8 +808,11 @@ static bool load_service_from_keyfile(GKeyFile *keyfile,
groups = g_key_file_get_groups(keyfile, NULL);
for (i = 0; groups[i]; i++) {
- if (!g_str_has_prefix(groups[i], "service_"))
+ if (!g_str_has_prefix(groups[i], "service_")) {
+ connman_warn("Ignore group named '%s' because prefix "
+ "is not 'service_'", groups[i]);
continue;
+ }
if (load_service(keyfile, groups[i], config))
found = true;
}
diff --git a/src/service.c b/src/service.c
index 9951cce09bf6..bf8064a04e73 100644
--- a/src/service.c
+++ b/src/service.c
@@ -6261,8 +6261,15 @@ static int service_connect(struct connman_service
*service)
break;
case CONNMAN_SERVICE_SECURITY_8021X:
- if (!service->eap)
+ if (!service->eap) {
+ connman_warn("EAP type has not been found. "
+ "Most likely ConnMan is not able to "
+ "find a configuration for given "
+ "8021X network. "
+ "Check SSID or Name match with the "
+ "network name.");
return -EINVAL;
+ }
/*
* never request credentials if using EAP-TLS
--
2.14.3
------------------------------
Message: 3
Date: Sat, 10 Feb 2018 11:18:34 +0100
From: Daniel Wagner <[email protected]>
To: "[email protected]" <[email protected]>
Cc: connman <[email protected]>
Subject: Re: connman Digest, Vol 28, Issue 4
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
Hi,
On 02/10/2018 03:54 AM, [email protected] wrote:
>
> hi Daniel,
> ? ? i see "man connman-service.config", and connect ieee802.1x tls
> method type Wifi.
> i really really try many many times to config the parser, but connmanctl
> report
> "Error?/net/connman/service/wifi_7cdd90caf78b_526f79_managed_ieee8021x:
> Input error"
> my "/usr/local/var/lib/connman/tls.config" as follows
>
> [service_tls]
> Type?=?wifi
> SSID?=?Roy
> EAP?=?tls
> CACertFile?=?/home/echo/work/user/tls/ca.pem
> ClientCertFile?=?/home/echo/work/user/tls/client.p12
> PrivateKeyFile?=?/home/echo/work/user/tls/client.key
> Identity?=?user
> PrivateKeyPassphraseType?=?fsid
So first thing to look out if you see something like this here:
connmand[1672]: Config file /var/lib/connman/wpa-eap-testing.config
does not contain any configuration that can be provisioned!
In this case the config file somehow invalid. I checked your
configuration by hand and it looks syntactical correct.
One thing which is not correct is 'SSID = Roy'. The SSID field
is expected to be the hex representation of the name. Try instead
'Name = Roy'. It took me a while to spot it :)
> and now i have files named "ca.pem, client.pem, client.p12" on my
> freeradius centos server,
> i am not sure that the
> "PrivateKeyFile?=?/home/user/.certs/client.fsid.pem,
> PrivateKeyPassphraseType?=?fsid,
> Identity?=?user" is right or not?
This depends on your certificates if I am not completely wrong
here. If the key needs to unlocked by a passphrase.
So in case you still have problems, we need to look at the
wpa_supplicant/ConnMan interaction.
For example during my testing I got:
connmand[5161]: src/service.c:connect_service() service 0x205f6b0
connmand[5161]: src/service.c:__connman_service_connect() service 0x205f6b0
state idle connect reason none -> user
connmand[5161]: src/service.c:__connman_service_clear_error() service 0x205f6b0
connmand[5161]: src/service.c:__connman_service_connect() service 0x205f6b0 err
-22
connmand[5161]: src/network.c:__connman_network_disconnect() network 0x2058560
So the -22 maps to EINVAL. Looking a bit at the code it is clear what is
happening.
static int service_connect(struct connman_service *service)
{
[...]
case CONNMAN_SERVICE_SECURITY_8021X:
if (!service->eap)
return -EINVAL;
[...]
}
ConnMan is not able to match the provisioning to the services.
So if you change your configuration file as described above
it should work (famous last words).
I just sent out a patch which adds a warning to log if we hit this
problem.
HTH,
Daniel
------------------------------
Message: 4
Date: Sat, 10 Feb 2018 12:01:00 +0100
From: Daniel Wagner <[email protected]>
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Subject: [RFC 0/3] Only cleanup devices which are supported
Message-ID: <[email protected]>
Hi,
When ConnMan starts up, it wipes all configuration on all
interfaces instead only those interfaces it will control.
This series fixes this by spliting the plugin init step into two
steps. The first is to register the technology driver and the second
does the rest. This split is needed because the plugin initilization
happens after the cleanup step. The plugin technology registration
happens before the cleanup so we can now filter which interface we
will cleanup or not. So far the theory.
I don't really like the first patch. It touches all plugins and adds
some noise to those plugins which do not need to set the
technology. Maybe with some precompiler black magic things could help,
but that sounds even worse. Another idea is to introduce an another
indiration for the initilization steps. Every plugin registers an
init/cleanup function pointer table. So we would have an explicit
registration step for the different drivers and one for the final init
step. Currently every plugin does it's own thing with different kind
of error handling. Well, error handling seems anyway a bit
missing. The plugins return error code and the core just jumps over
it.
Any thoughs?
Reported-by: KARBOWSKI Piotr <[email protected]>
Daniel Wagner (3):
plugins: Introduce explicit technology un/register
technology: Add __connman_technology_is_supported()
device: Only cleanup devices which are supported
include/plugin.h | 32 ++++++++++++++++++++++-----
plugins/bluetooth.c | 21 ++++++++++--------
plugins/dundee.c | 3 ++-
plugins/ethernet.c | 19 ++++++++++------
plugins/gadget.c | 21 +++++++++++-------
plugins/loopback.c | 3 ++-
plugins/neard.c | 3 ++-
plugins/nmcompat.c | 2 +-
plugins/ofono.c | 21 ++++++++++--------
plugins/pacrunner.c | 3 ++-
plugins/polkit.c | 3 ++-
plugins/session_policy_local.c | 3 ++-
plugins/vpn.c | 3 ++-
plugins/wifi.c | 22 ++++++++++---------
src/connman.h | 6 ++++-
src/device.c | 5 +++++
src/main.c | 6 ++++-
src/plugin.c | 50 ++++++++++++++++++++++++++++++++++++------
src/technology.c | 5 +++++
vpn/main.c | 2 +-
vpn/plugins/openconnect.c | 3 ++-
vpn/plugins/openvpn.c | 3 ++-
vpn/plugins/vpnc.c | 3 ++-
23 files changed, 173 insertions(+), 69 deletions(-)
--
2.14.3
------------------------------
Message: 5
Date: Sat, 10 Feb 2018 12:01:02 +0100
From: Daniel Wagner <[email protected]>
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Subject: [RFC 2/3] technology: Add __connman_technology_is_supported()
Message-ID: <[email protected]>
---
src/connman.h | 1 +
src/technology.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/src/connman.h b/src/connman.h
index ef9ff194225e..c7e3bd748e72 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -529,6 +529,7 @@ int __connman_technology_add_device(struct connman_device
*device);
int __connman_technology_remove_device(struct connman_device *device);
int __connman_technology_enabled(enum connman_service_type type);
int __connman_technology_disabled(enum connman_service_type type);
+bool __connman_technology_is_supported(enum connman_service_type type);
int __connman_technology_set_offlinemode(bool offlinemode);
bool __connman_technology_get_offlinemode(void);
void __connman_technology_set_connected(enum connman_service_type type,
diff --git a/src/technology.c b/src/technology.c
index 4c1cbbbb0c16..7db597d18cf5 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -1562,6 +1562,11 @@ int __connman_technology_disabled(enum
connman_service_type type)
return technology_disabled(technology);
}
+bool __connman_technology_is_supported(enum connman_service_type type)
+{
+ return !!technology_find(type);
+}
+
int __connman_technology_set_offlinemode(bool offlinemode)
{
GSList *list;
--
2.14.3
------------------------------
Message: 6
Date: Sat, 10 Feb 2018 12:01:03 +0100
From: Daniel Wagner <[email protected]>
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Subject: [RFC 3/3] device: Only cleanup devices which are supported
Message-ID: <[email protected]>
---
src/device.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/device.c b/src/device.c
index 7c212c10ce3b..160820ffdb9f 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1406,6 +1406,7 @@ static void cleanup_devices(void)
return;
for (i = 0; interfaces[i]; i++) {
+ enum connman_service_type type;
bool filtered;
int index;
struct sockaddr_in sin_addr, sin_mask;
@@ -1418,6 +1419,10 @@ static void cleanup_devices(void)
if (index < 0)
continue;
+ type = __connman_rtnl_get_device_type(index);
+ if (!__connman_technology_is_supported(type))
+ continue;
+
if (!__connman_inet_get_address_netmask(index, &sin_addr,
&sin_mask)) {
char *address = g_strdup(inet_ntoa(sin_addr.sin_addr));
--
2.14.3
------------------------------
Message: 7
Date: Sat, 10 Feb 2018 12:01:01 +0100
From: Daniel Wagner <[email protected]>
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Subject: [RFC 1/3] plugins: Introduce explicit technology un/register
Message-ID: <[email protected]>
---
include/plugin.h | 32 ++++++++++++++++++++++-----
plugins/bluetooth.c | 21 ++++++++++--------
plugins/dundee.c | 3 ++-
plugins/ethernet.c | 19 ++++++++++------
plugins/gadget.c | 21 +++++++++++-------
plugins/loopback.c | 3 ++-
plugins/neard.c | 3 ++-
plugins/nmcompat.c | 2 +-
plugins/ofono.c | 21 ++++++++++--------
plugins/pacrunner.c | 3 ++-
plugins/polkit.c | 3 ++-
plugins/session_policy_local.c | 3 ++-
plugins/vpn.c | 3 ++-
plugins/wifi.c | 22 ++++++++++---------
src/connman.h | 5 ++++-
src/main.c | 6 ++++-
src/plugin.c | 50 ++++++++++++++++++++++++++++++++++++------
vpn/main.c | 2 +-
vpn/plugins/openconnect.c | 3 ++-
vpn/plugins/openvpn.c | 3 ++-
vpn/plugins/vpnc.c | 3 ++-
21 files changed, 162 insertions(+), 69 deletions(-)
diff --git a/include/plugin.h b/include/plugin.h
index 8d2bb08e00a5..842f38424510 100644
--- a/include/plugin.h
+++ b/include/plugin.h
@@ -51,6 +51,8 @@ struct connman_plugin_desc {
int priority;
int (*init) (void);
void (*exit) (void);
+ int (*init_tech) (void);
+ void (*exit_tech) (void);
void *debug_start;
void *debug_stop;
};
@@ -62,6 +64,8 @@ struct connman_plugin_desc {
* @version: plugin version string
* @init: init function called on plugin loading
* @exit: exit function called on plugin removal
+ * @init_tech: init technology called on plugin loading
+ * @exit_tech: exit technology called on plugin removal
*
* Macro for defining a plugin descriptor
*
@@ -70,24 +74,41 @@ struct connman_plugin_desc {
*
* static int example_init(void)
* {
- * return 0;
+ * // register driver
+ * return 0;
* }
*
* static void example_exit(void)
* {
+ * // unregister driver
+ * }
+ *
+ * static int example_init_tech(void)
+ * {
+ * // register technology driver
+ * return 0;
+ * }
+ *
+ * static void example_exit_tech(void)
+ * {
+ * // unregister technoloy driver
* }
*
* CONNMAN_PLUGIN_DEFINE(example, "Example plugin", CONNMAN_VERSION,
- * example_init, example_exit)
+ * example_init, example_exit,
+ * example_init_tech, example_exit_tech)
* ]|
*/
#ifdef CONNMAN_PLUGIN_BUILTIN
-#define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init,
exit) \
+#define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init,
exit, \
+ init_tech, exit_tech) \
struct connman_plugin_desc __connman_builtin_ ## name = { \
- #name, description, version, priority, init, exit \
+ #name, description, version, priority, init, exit, \
+ init_tech, exit_tech \
};
#else
-#define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init,
exit) \
+#define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init,
exit, \
+ init_tech, exit_techt) \
extern struct connman_debug_desc __start___debug[] \
__attribute__ ((weak, visibility("hidden"))); \
extern struct connman_debug_desc __stop___debug[] \
@@ -96,6 +117,7 @@ struct connman_plugin_desc {
__attribute__ ((visibility("default"))); \
struct connman_plugin_desc connman_plugin_desc = { \
#name, description, version, priority, init, exit, \
+ init_tech, exit_tech, \
__start___debug, __stop___debug \
};
#endif
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index f759a902611c..ce1fdb9f8adb 100644
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -926,23 +926,16 @@ static int bluetooth_init(void)
if (!connection)
goto out;
- if (connman_technology_driver_register(&tech_driver) < 0) {
- connman_warn("Failed to initialize technology for Bluez 5");
- goto out;
- }
-
devices = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
device_free);
if (connman_device_driver_register(&device_driver) < 0) {
connman_warn("Failed to initialize device driver for "
BLUEZ_SERVICE);
- connman_technology_driver_unregister(&tech_driver);
goto out;
}
if (connman_network_driver_register(&network_driver) < 0) {
- connman_technology_driver_unregister(&tech_driver);
connman_device_driver_unregister(&device_driver);
goto out;
}
@@ -994,9 +987,19 @@ static void bluetooth_exit(void)
connman_device_driver_unregister(&device_driver);
g_hash_table_destroy(devices);
- connman_technology_driver_unregister(&tech_driver);
dbus_connection_unref(connection);
}
+static int bluetooth_init_tech(void)
+{
+ return connman_technology_driver_register(&tech_driver);
+}
+
+static void bluetooth_exit_tech(void)
+{
+ connman_technology_driver_unregister(&tech_driver);
+}
+
CONNMAN_PLUGIN_DEFINE(bluetooth, "Bluetooth technology plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, bluetooth_init,
bluetooth_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, bluetooth_init,
bluetooth_exit,
+ bluetooth_init_tech, bluetooth_exit_tech)
diff --git a/plugins/dundee.c b/plugins/dundee.c
index b5420acfdcef..d108b93cbb0b 100644
--- a/plugins/dundee.c
+++ b/plugins/dundee.c
@@ -883,4 +883,5 @@ static void dundee_exit(void)
}
CONNMAN_PLUGIN_DEFINE(dundee, "Dundee plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, dundee_init, dundee_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, dundee_init, dundee_exit,
+ NULL, NULL)
diff --git a/plugins/ethernet.c b/plugins/ethernet.c
index 935c96710807..fda08e6ad294 100644
--- a/plugins/ethernet.c
+++ b/plugins/ethernet.c
@@ -435,10 +435,6 @@ static int ethernet_init(void)
{
int err;
- err = connman_technology_driver_register(ð_tech_driver);
- if (err < 0)
- return err;
-
err = connman_network_driver_register(ð_network_driver);
if (err < 0)
return err;
@@ -454,12 +450,21 @@ static int ethernet_init(void)
static void ethernet_exit(void)
{
- connman_technology_driver_unregister(ð_tech_driver);
-
connman_network_driver_unregister(ð_network_driver);
connman_device_driver_unregister(ð_dev_driver);
}
+static int ethernet_init_tech(void)
+{
+ return connman_technology_driver_register(ð_tech_driver);
+}
+
+static void ethernet_exit_tech(void)
+{
+ connman_technology_driver_unregister(ð_tech_driver);
+}
+
CONNMAN_PLUGIN_DEFINE(ethernet, "Ethernet interface plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, ethernet_init, ethernet_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, ethernet_init, ethernet_exit,
+ ethernet_init_tech, ethernet_exit_tech)
diff --git a/plugins/gadget.c b/plugins/gadget.c
index 94f664872fbd..ec96e931c3cd 100644
--- a/plugins/gadget.c
+++ b/plugins/gadget.c
@@ -329,18 +329,13 @@ static int gadget_init(void)
{
int err;
- err = connman_technology_driver_register(&gadget_tech_driver);
- if (err < 0) {
- return err;
- }
-
err = connman_network_driver_register(&gadget_network_driver);
if (err < 0)
return err;
err = connman_device_driver_register(&gadget_dev_driver);
if (err < 0) {
- connman_technology_driver_unregister(&gadget_tech_driver);
+ connman_network_driver_unregister(&gadget_network_driver);
return err;
}
@@ -349,10 +344,20 @@ static int gadget_init(void)
static void gadget_exit(void)
{
- connman_technology_driver_unregister(&gadget_tech_driver);
connman_network_driver_unregister(&gadget_network_driver);
connman_device_driver_unregister(&gadget_dev_driver);
}
+static int gadget_init_tech(void)
+{
+ return connman_technology_driver_register(&gadget_tech_driver);
+}
+
+static void gadget_exit_tech(void)
+{
+ connman_technology_driver_unregister(&gadget_tech_driver);
+}
+
CONNMAN_PLUGIN_DEFINE(gadget, "Gadget interface plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, gadget_init, gadget_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, gadget_init, gadget_exit,
+ gadget_init_tech, gadget_exit_tech)
diff --git a/plugins/loopback.c b/plugins/loopback.c
index e113887d1086..b727ed46effd 100644
--- a/plugins/loopback.c
+++ b/plugins/loopback.c
@@ -279,4 +279,5 @@ static void loopback_exit(void)
}
CONNMAN_PLUGIN_DEFINE(loopback, "Loopback device plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_HIGH, loopback_init, loopback_exit)
+ CONNMAN_PLUGIN_PRIORITY_HIGH, loopback_init, loopback_exit,
+ NULL, NULL)
diff --git a/plugins/neard.c b/plugins/neard.c
index 69586df653b0..a335fd6185f4 100644
--- a/plugins/neard.c
+++ b/plugins/neard.c
@@ -623,4 +623,5 @@ static void neard_exit(void)
}
CONNMAN_PLUGIN_DEFINE(neard, "Neard handover plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, neard_init, neard_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, neard_init, neard_exit,
+ NULL, NULL)
diff --git a/plugins/nmcompat.c b/plugins/nmcompat.c
index 883ce9bd2316..4e9a181dcb81 100644
--- a/plugins/nmcompat.c
+++ b/plugins/nmcompat.c
@@ -281,4 +281,4 @@ static void nmcompat_exit(void)
CONNMAN_PLUGIN_DEFINE(nmcompat, "NetworkManager compatibility interfaces",
VERSION, CONNMAN_PLUGIN_PRIORITY_DEFAULT,
- nmcompat_init, nmcompat_exit)
+ nmcompat_init, nmcompat_exit, NULL, NULL)
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 82413b6e680c..a7b99253e52f 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -2935,13 +2935,6 @@ static int ofono_init(void)
goto remove;
}
- err = connman_technology_driver_register(&tech_driver);
- if (err < 0) {
- connman_device_driver_unregister(&modem_driver);
- connman_network_driver_unregister(&network_driver);
- goto remove;
- }
-
return 0;
remove:
@@ -2985,7 +2978,6 @@ static void ofono_exit(void)
context_hash = NULL;
}
- connman_technology_driver_unregister(&tech_driver);
connman_device_driver_unregister(&modem_driver);
connman_network_driver_unregister(&network_driver);
@@ -3005,5 +2997,16 @@ static void ofono_exit(void)
dbus_connection_unref(connection);
}
+static int ofono_init_tech(void)
+{
+ return connman_technology_driver_register(&tech_driver);
+}
+
+static void ofono_exit_tech(void)
+{
+ connman_technology_driver_unregister(&tech_driver);
+}
+
CONNMAN_PLUGIN_DEFINE(ofono, "oFono telephony plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, ofono_init, ofono_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, ofono_init, ofono_exit,
+ ofono_init_tech, ofono_exit_tech)
diff --git a/plugins/pacrunner.c b/plugins/pacrunner.c
index d2464a5e72c6..ed5950e2983d 100644
--- a/plugins/pacrunner.c
+++ b/plugins/pacrunner.c
@@ -464,4 +464,5 @@ static void pacrunner_exit(void)
}
CONNMAN_PLUGIN_DEFINE(pacrunner, "PAC runner proxy plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, pacrunner_init, pacrunner_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, pacrunner_init, pacrunner_exit,
+ NULL, NULL)
diff --git a/plugins/polkit.c b/plugins/polkit.c
index ae38364ac1e1..dd32ccdd7e65 100644
--- a/plugins/polkit.c
+++ b/plugins/polkit.c
@@ -52,4 +52,5 @@ static void polkit_exit(void)
}
CONNMAN_PLUGIN_DEFINE(polkit, "PolicyKit authorization plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, polkit_init, polkit_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, polkit_init, polkit_exit,
+ NULL, NULL)
diff --git a/plugins/session_policy_local.c b/plugins/session_policy_local.c
index f003c0e1befd..b39c8a7bae0e 100644
--- a/plugins/session_policy_local.c
+++ b/plugins/session_policy_local.c
@@ -822,4 +822,5 @@ static void session_policy_local_exit(void)
CONNMAN_PLUGIN_DEFINE(session_policy_local,
"Session local file policy configuration plugin",
VERSION, CONNMAN_PLUGIN_PRIORITY_DEFAULT,
- session_policy_local_init, session_policy_local_exit)
+ session_policy_local_init, session_policy_local_exit,
+ NULL, NULL)
diff --git a/plugins/vpn.c b/plugins/vpn.c
index c2a332ba8a02..3e40e76c658f 100644
--- a/plugins/vpn.c
+++ b/plugins/vpn.c
@@ -1882,4 +1882,5 @@ static void vpn_exit(void)
}
CONNMAN_PLUGIN_DEFINE(vpn, "VPN plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, vpn_init, vpn_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, vpn_init, vpn_exit,
+ NULL, NULL)
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 3ad60e21b729..fe6bb6a078b8 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -3538,13 +3538,6 @@ static int wifi_init(void)
return err;
}
- err = connman_technology_driver_register(&tech_driver);
- if (err < 0) {
- g_supplicant_unregister(&callbacks);
- connman_network_driver_unregister(&network_driver);
- return err;
- }
-
return 0;
}
@@ -3552,12 +3545,21 @@ static void wifi_exit(void)
{
DBG();
- connman_technology_driver_unregister(&tech_driver);
-
g_supplicant_unregister(&callbacks);
connman_network_driver_unregister(&network_driver);
}
+static int wifi_init_tech(void)
+{
+ return connman_technology_driver_register(&tech_driver);
+}
+
+static void wifi_exit_tech(void)
+{
+ connman_technology_driver_unregister(&tech_driver);
+}
+
CONNMAN_PLUGIN_DEFINE(wifi, "WiFi interface plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, wifi_init, wifi_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, wifi_init, wifi_exit,
+ wifi_init_tech, wifi_exit_tech)
diff --git a/src/connman.h b/src/connman.h
index 6d1831b15358..ef9ff194225e 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -143,8 +143,11 @@ void __connman_log_enable(struct connman_debug_desc *start,
#include <connman/plugin.h>
-int __connman_plugin_init(const char *pattern, const char *exclude);
+int __connman_plugin_parse(const char *pattern, const char *exclude);
+int __connman_plugin_init(void);
void __connman_plugin_cleanup(void);
+int __connman_plugin_technology_init(void);
+void __connman_plugin_technology_cleanup(void);
#include <connman/task.h>
diff --git a/src/main.c b/src/main.c
index e1532913b78d..4c67ab67971c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -743,9 +743,12 @@ int main(int argc, char *argv[])
else
config_init(option_config);
+ __connman_plugin_parse(option_plugin, option_noplugin);
+
__connman_util_init();
__connman_inotify_init();
__connman_technology_init();
+ __connman_plugin_technology_init();
__connman_notifier_init();
__connman_agent_init();
__connman_service_init();
@@ -774,7 +777,7 @@ int main(int argc, char *argv[])
__connman_timeserver_init();
__connman_connection_init();
- __connman_plugin_init(option_plugin, option_noplugin);
+ __connman_plugin_init();
__connman_resolver_init(option_dnsproxy);
__connman_rtnl_start();
@@ -801,6 +804,7 @@ int main(int argc, char *argv[])
__connman_wpad_cleanup();
__connman_dhcpv6_cleanup();
__connman_session_cleanup();
+ __connman_plugin_technology_cleanup();
__connman_plugin_cleanup();
__connman_provider_cleanup();
__connman_connection_cleanup();
diff --git a/src/plugin.c b/src/plugin.c
index 7d730582cf66..5ad6a2b0fa1d 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -105,18 +105,15 @@ static bool check_plugin(struct connman_plugin_desc *desc,
#include <builtin.h>
-int __connman_plugin_init(const char *pattern, const char *exclude)
+int __connman_plugin_parse(const char *pattern, const char *exclude)
{
gchar **patterns = NULL;
gchar **excludes = NULL;
- GSList *list;
GDir *dir;
const gchar *file;
gchar *filename;
unsigned int i;
- DBG("");
-
if (pattern)
patterns = g_strsplit_set(pattern, ":, ", -1);
@@ -172,6 +169,18 @@ int __connman_plugin_init(const char *pattern, const char
*exclude)
g_dir_close(dir);
}
+ g_strfreev(patterns);
+ g_strfreev(excludes);
+
+ return 0;
+}
+
+int __connman_plugin_init(void)
+{
+ GSList *list;
+
+ DBG("");
+
for (list = plugins; list; list = list->next) {
struct connman_plugin *plugin = list->data;
@@ -181,9 +190,6 @@ int __connman_plugin_init(const char *pattern, const char
*exclude)
plugin->active = true;
}
- g_strfreev(patterns);
- g_strfreev(excludes);
-
return 0;
}
@@ -207,3 +213,33 @@ void __connman_plugin_cleanup(void)
g_slist_free(plugins);
}
+
+int __connman_plugin_technology_init(void)
+{
+ GSList *list;
+
+ DBG("");
+
+ for (list = plugins; list; list = list->next) {
+ struct connman_plugin *plugin = list->data;
+
+ if (plugin->desc->init_tech && plugin->desc->init_tech() < 0)
+ continue;
+ }
+
+ return 0;
+}
+
+void __connman_plugin_technology_cleanup(void)
+{
+ GSList *list;
+
+ DBG("");
+
+ for (list = plugins; list; list = list->next) {
+ struct connman_plugin *plugin = list->data;
+
+ if (plugin->desc->exit_tech)
+ plugin->desc->exit_tech();
+ }
+}
diff --git a/vpn/main.c b/vpn/main.c
index ee88aacdbbf3..455de1fe77cd 100644
--- a/vpn/main.c
+++ b/vpn/main.c
@@ -325,7 +325,7 @@ int main(int argc, char *argv[])
__vpn_ipconfig_init();
__vpn_rtnl_init();
__connman_task_init();
- __connman_plugin_init(option_plugin, option_noplugin);
+ __connman_plugin_init();
__vpn_config_init();
__vpn_rtnl_start();
diff --git a/vpn/plugins/openconnect.c b/vpn/plugins/openconnect.c
index 87679bfacb69..4d121295ca87 100644
--- a/vpn/plugins/openconnect.c
+++ b/vpn/plugins/openconnect.c
@@ -579,4 +579,5 @@ static void openconnect_exit(void)
}
CONNMAN_PLUGIN_DEFINE(openconnect, "OpenConnect VPN plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, openconnect_init, openconnect_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, openconnect_init, openconnect_exit,
+ NULL, NULL)
diff --git a/vpn/plugins/openvpn.c b/vpn/plugins/openvpn.c
index e33950970b13..aec54ebb29c9 100644
--- a/vpn/plugins/openvpn.c
+++ b/vpn/plugins/openvpn.c
@@ -492,4 +492,5 @@ static void openvpn_exit(void)
}
CONNMAN_PLUGIN_DEFINE(openvpn, "OpenVPN plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, openvpn_init, openvpn_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, openvpn_init, openvpn_exit,
+ NULL, NULL)
diff --git a/vpn/plugins/vpnc.c b/vpn/plugins/vpnc.c
index af9dbe7678b3..55c50cd7a71d 100644
--- a/vpn/plugins/vpnc.c
+++ b/vpn/plugins/vpnc.c
@@ -381,4 +381,5 @@ static void vpnc_exit(void)
}
CONNMAN_PLUGIN_DEFINE(vpnc, "vpnc plugin", VERSION,
- CONNMAN_PLUGIN_PRIORITY_DEFAULT, vpnc_init, vpnc_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, vpnc_init, vpnc_exit,
+ NULL, NULL)
--
2.14.3
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 28, Issue 6
**************************************