On 11/07/2013 08:44 AM, Patrik Flykt wrote:

        Hi,

On Wed, 2013-11-06 at 14:47 -0500, Tysen Moore wrote:

The code seems to load the plug-in and during the session policy plug-in
init it registers by calling connman_session_policy_register.  The routine
then stores the policy in a list based on the priority, then calls
probe_policy.  probe_policy then cycles through all sessions and assigns
this session policy to any session without a policy reference.  I have a
couple concerns:
1. This occurs only at startup--unless these session policies can register
themselves outside of startup.  Therefore, there will never be any
sessions.  Therefore the code is a NOP, and is not called anywhere else.
2. If registration could happen later the second plug-in would never get
assigned.

Policy - and other - plugins are all loaded at startup, not during run
time. Was this the answer you were looking for?

The other issue is that there never seems to be a probe-like callback even
when a session is created.  The session is assigned the highest priority
session policy no matter what.  Typically systems I've used would probe all
plug-ins in priority order and stop if the plug-in returns that it handled
the probe.  This would allow the plug-in to be specialized for more
targeted use and allow for more than one supported plug-in.  Currently the
highest priority wins.

In that case there seems to be a probe() session policy module function
missing. Please add one, other APIs like network and device have probe()
functionality.

The probing is shortcuted because I didn't see any real reason to support
more than one policy plugin at runtime.

It gets really fast tricky if something changes when a session already is
in use. What should happen if policy plugin A decides it is not applicable?
Should policy plugin B now be asked for a configuration? My assumption was
that one plugin is enough when the system is running. If you need to have
your own plugin, it should handle all sessions, not part of them, that
was my thinking.

cheers,
daniel


_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to