On 11/07/2013 01:50 PM, Tysen Moore wrote:
Patrik, thanks, I do understand the plug-ins are loaded at startup, this is what makes the code a bit confusing. It loads the plug-in, then adds the newly loaded policy to all *existing* session. As I see it, there is no way to have a session at that point in time, unless for some reason the plug-in is reloaded at runtime--which it is now. Therefore this code appears to be a NOP.
Right, I got carried away while writing this. I don't see a need to support this. Patches are highly appreciated :)
The other point was that on one hand it seems like the code supports loading more than one plug-in because, for example, the code keeps a sorted list of policies based on priority. But on the other hand, the assignment of the policy to a newly created session just grabs the highest priority policy--no probing or other logic. It was difficult to see the intent in the code: single or multiple plug-in support. The intent here was part of what I was looking for and I think Daniel answered that; only one plug-in is really supported. Also to clarify, the intent was not to swap an existing assigned plug-in during runtime, I agree this would be difficult to manage. The point I was trying to make was that more than one plug-in gives greater flexibility over the sessions. Currently if I want to add more policy logic to a session, and keep the session-policy-local policy plug-in functionality I have one option; modify the session-policy-local to add more filtering--or whatever the case may be. If more than one plug-in were supported you could create a new plug-in that support other features and possibly add features/functionality easier. It seems like the policy plug-ins should operate differently than the other plug-ins in that you want a "chain" of policies for a session, not just a single plug-in. One policy plug-in may not cover all that is needed for the system, unlike a technology where WiFi HW uses the WiFi plug-in. What seem likely is that the create/destroy calls all policy plug-ins each time. This allows the plug-in to decide whether it should do something or not.
Adding a probe function and then picking the right pluging should be not too difficult to add. It doesn't really make sense to have the current code being able to handle several plugins but then only using one and only one. Again patches wont be turned down :) cheers, daniel _______________________________________________ connman mailing list [email protected] https://lists.connman.net/mailman/listinfo/connman
