On 19.10.2012 23:03, Patrik Flykt wrote:
On ons, 2012-10-17 at 14:42 +0200, Daniel Wagner wrote:
From: Daniel Wagner <daniel.wag...@bmw-carit.de>

---
  include/session.h |  4 +++
  src/session.c     | 76 +++++++++++++++++++++++++++++++++++++------------------
  2 files changed, 56 insertions(+), 24 deletions(-)

diff --git a/include/session.h b/include/session.h
index afad9fb..9b5a1f0 100644
--- a/include/session.h
+++ b/include/session.h
@@ -87,6 +87,10 @@ GSList *connman_session_allowed_bearers_any(void);
  void connman_session_free_bearers(GSList *bearers);
  struct connman_session_config *connman_session_create_default_config(void);

+enum connman_session_roaming_policy connman_session_parse_roaming_policy(const 
char *policy);
+enum connman_session_type connman_session_parse_connection_type(const char 
*type);
+int connman_session_parse_allowed_bearers(const char *token, GSList **list);

Functionality for connman_session_parse_allowed_bearers already exists
in src/main.c

I don't see it in my tree. Which line (assuming I am blind again)?

as the function parse_service_types(), but that one does
not interpret the '*' wildcard.

parse_service_types() parses the service type not the session ConnectionType. Not the same type.

+
  const char *connman_session_get_owner(struct connman_session *session);

  #ifdef __cplusplus
diff --git a/src/session.c b/src/session.c
index b39dd0a..d13c26b 100644
--- a/src/session.c
+++ b/src/session.c
@@ -160,7 +160,23 @@ static const char *type2string(enum connman_session_type 
type)
        return NULL;
  }

-static enum connman_session_type string2type(const char *type)
+enum connman_session_roaming_policy connman_session_parse_roaming_policy(const 
char *policy)
+{
+       if (g_strcmp0(policy, "default") == 0)
+               return CONNMAN_SESSION_ROAMING_POLICY_DEFAULT;
+       else if (g_strcmp0(policy, "always") == 0)
+               return CONNMAN_SESSION_ROAMING_POLICY_ALWAYS;
+       else if (g_strcmp0(policy, "forbidden") == 0)
+               return CONNMAN_SESSION_ROAMING_POLICY_FORBIDDEN;
+       else if (g_strcmp0(policy, "national") == 0)
+               return CONNMAN_SESSION_ROAMING_POLICY_NATIONAL;
+       else if (g_strcmp0(policy, "international") == 0)
+               return CONNMAN_SESSION_ROAMING_POLICY_INTERNATIONAL;
+       else
+               return CONNMAN_SESSION_ROAMING_POLICY_UNKNOWN;
+}
+
+enum connman_session_type connman_session_parse_connection_type(const char 
*type)
  {
        if (g_strcmp0(type, "any") == 0)
                return CONNMAN_SESSION_TYPE_ANY;

Hmm, a service is 'ready' or 'online' while a session is 'local' or
'internet'. Maybe that should be fixed to reduce confusion... Especially
when it involves humans an text files.

I completely agree. I find 'ready' always a good source of confusions. But since the Service API is stable, we can only change the Session API to 'ready' and 'internet'. That will break connline though.

Tomasz, any objections? Any requirements when and how we update this?

cheers,
daniel

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to