From: Daniel Wagner <[email protected]>

Hi,

Here is my first draft version for supporting service name match
through the policy plugin, e.g:

  $ cat /var/lib/connman/session_policy_local/test.policy 
  [policy_foo]
  uid=wagi
  AllowedBearers=ethernet_082e5f290035_cable

Note, this is not supported via the D-Bus API. 

This series is based on 

https://github.com/bmwcarit/connman/tree/secmark-v7

and also available as

https://github.com/bmwcarit/connman/tree/policy-services-v0


  01 session: Use service iterator instead of match/creation callbacks

The first patch is prepers the stage for removing the GSequence in
session.c It is not strickly necessary but I found exposing the
implementation details from session.c in service.c just worth
keeping this internal API complex. 

  02 session: Use GList instead of GSequence for service list

There is no special need for GSequence in session.c so let's remove it
and use simple GList for this. The only thing worth to notice is that
the owner ship of the service_entry is moved to the hash table.

  03 session: Use strings as bearer type

Let's bring back the possiblitly to hand in 'random' strings from
the policy plugin.

  04 session: Refactor session list sorting

The sort API provided glib doesn't cut to well with what I am trying
to do. The simplest way to sort the service list is to use a pick
sort. The runtime for this particular implementation is by O(n*m)
where n is the number of services and m the number of bearers. 
I expect the number of bearers small so we can say it's around
O(n).

  05 session: Add service name matching for policy plugin

And this one just adds the service ident match.

cheers,
daniel

Daniel Wagner (5):
  session: Use service iterator instead of match/creation callbacks
  session: Use GList instead of GSequence for service list
  session: Use strings as bearer type
  session: Refactor session list sorting
  session: Add service name matching for policy plugin

 include/session.h              |   1 -
 plugins/session_policy_local.c |  23 ++-
 src/connman.h                  |  15 +-
 src/service.c                  |  25 +--
 src/session.c                  | 350 +++++++++++++++++++----------------------
 5 files changed, 186 insertions(+), 228 deletions(-)

-- 
1.8.2.rc3.16.gce432ca

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

Reply via email to