From: Daniel Wagner <daniel.wag...@bmw-carit.de> Hi,
As result of your disucssion I completely rewrote the series. The main changes is that the session's configuration are tracked in service.c and that we track the connection request reason. With this information inside service.c, the auto connect algorithm can decide which service to add or remove from a session. #1 session: Remove service selection implementation Just git rid of all the implementation #2 session: Mark session active or inactive Another small cleanup and preperation for the stuff which is added in the following patches. #3 service: Add connect reason to __connman_service_connect() #4 service: Add connect reason to __connman_serice_auto_connect() In these two patches the connection reason code is added to the services. #5 service: Store config per session With this change the service.c file is aware of all activated sessions and their configuration. #6 session: Add functions to de/assign service to a session #7 service: Assign services to sessions These patches brings back one important feature. A free-ride session is now updated again, that is it gets serivces added or removed. #8 sevice: Disconnect service on last session deactivation Since we know who established a connection, we can also tear down after the last 'user' (session) is gone. If the connection was established via the Service API then we don't take it down. #9 service: Add session auto connect support The auto connect algorithm now can do decision part which service should be connected. I consider this version as starting point towards a smarter version. It is very simple and still gets the basic stuff correct. Which is if a session request a conneciton a matching service will be connected. #10 service: Enter session mode when config files are found This patch is just for dicussions. Without it the normal auto connect mode will race with the session connect mode on ConnMan's startup (before sessions are created). cheers, daniel Daniel Wagner (10): session: Remove service selection implementation session: Mark session active or inactive service: Add connect reason to __connman_service_connect() service: Add connect reason to __connman_serice_auto_connect() service: Store config per session session: Add functions to de/assign service to a session service: Assign services to sessions service: Disconnect service on last session deactivation service: Add session auto connect support service: Enter session mode when config files are found include/session.h | 1 + plugins/session_policy_local.c | 5 + src/config.c | 8 +- src/connman.h | 27 +- src/device.c | 4 +- src/network.c | 4 +- src/service.c | 310 +++++++++++++++--- src/session.c | 729 ++++++----------------------------------- 8 files changed, 395 insertions(+), 693 deletions(-) -- 1.8.5.3 _______________________________________________ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman