From: Patrik Flykt <[email protected]> Hi,
This patch set implements loading of all provider settings of a matching type when a provider driver is registered. When a provider driver is registered, all providers for this driver type are loaded (patch 07) by fetching a list of all saved providers (patch 01). As the settings files need to be opened for checking if the provider type matches, it makes sense to factor out provider creation from keyfile (patch 04) in order to avoid multiple openings of the same keyfile. If the provider was successfully created, a service is created for it. Code for doing this is factored out (patch 05) from __connman_provider_create_and_connect(). A check for the case that the driver_hash creation in vpn.c failed was added (patch 02), and an unnecessary provider->name setting was removed (patch 03). In order not to load provider settings twice, provider settings loading was moved away from provider_register() (patch 06). When the provider indicates error, the service is no longer removed (patch 08). What is still "missing" after this patch set is a method of automatically connecting a provider when a non-vpn service becomes ready or goes online. Such functionality is currently left for later. Version 2 of this patch removes the unnecessary provider struct lookup and creation (old patch 04) and adds the error indication patch 08. Cheers, Patrik Patrik Flykt (8): storage: Function to fetch all saved providers vpn: Add check for properly initialized driver_hash provider: Don't set provider->name when creating provider struct provider: Factor out keyfile loading provider: Factor out service creation provider: Handle connman_provider_load() in provider_create() provider: Load providers at provider driver registration time provider: Don't remove a provider on error plugins/vpn.c | 7 ++- src/connman.h | 1 + src/provider.c | 149 ++++++++++++++++++++++++++++++++++++++++++++------------ src/storage.c | 49 ++++++++++++++++++ 4 files changed, 174 insertions(+), 32 deletions(-) -- 1.7.2.5 _______________________________________________ connman mailing list [email protected] http://lists.connman.net/listinfo/connman
