Hello,
 
I'm using Connman (v-1.32) on my Raspberry Pi and I wanted to try the session mode.
I found quite few interesting mailings and I looked over the code (session.c, test-session) and the doc, but it looks like session is not really a nowadays topic.
Does someone use the Connman's session? and for which application? Can you give me an example?
 
So here is what I understood so far about the session mode:
Connman session allows the application to use specific network setting as selected technologies, roaming policy...
Connman uses Iptable to do so. Connman creates rules in the mangle table to mark the packet based on the UID/GID. 
Then rules are added to the filter table depending on the allowed bearers, and other properties.
This routing is only functional when the connman state option is ON.
 
Connman  proposes two ways to create a session :
First, the application creates it's own session using the method form /net.connman.manager. I try to use this method with a python script, the application creates a session, connects to it and sends UDP packet to a local host via ethernet. But I didn't manage to setup the AllowedBearers, neither with
manager.CreateSession({"AllowedBearers":Glib.Variant('s','ethernet')},notifier_path)
nor
Session.Change("AllowedBeares",Glib.Variant('s','ethernet')).
I have Variant encoding issue. Do you have any advice or exemple?
I was also wondering how does the mangle table identify the application's packet? (or maybe it's just the UID again?)
 
The second way is to use  session_policy. With this method you can mark packet only based on the UID or GID. I need to create UID.policy in var/lib/connman/session_policy_local which contained the different parameters. But when I turn the Connman's state session On, nothing happened... My pi user is still able to use wifi even if the pi.policy have only Ethernet as AllowedBearers. I suspect the issue comes from user rights or something... Does somebody had similar issue?
By the way, is the session priority only for notification hierarchy or does the session priority have some effect on the network traffic (during congestion?)?
 
Hope these questions aren't too basic for you, and can help other.
If you have any literature which could help, I'll take it!
 
Thank you,
Benjamin