summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2013-05-31 07:13:35 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-31 11:43:19 (GMT)
commit2ffa1d665f4a279c8a97264daf6568cf1d13cb95 (patch)
treea3f8ab3346c7085fb25bbcff6663fd15297f4bc2
parent9c5cb53a5d85f9416bbbe4ebdc350474f61274b7 (diff)
downloadconnman-2ffa1d665f4a279c8a97264daf6568cf1d13cb95.zip
connman-2ffa1d665f4a279c8a97264daf6568cf1d13cb95.tar.gz
connman-2ffa1d665f4a279c8a97264daf6568cf1d13cb95.tar.bz2
session: Add session identification method to config
The session core needs to the know which kind of session identification method has been selected in the plugin in order to use the right iptables rules etc.
-rw-r--r--include/session.h9
-rw-r--r--src/session.c4
2 files changed, 13 insertions, 0 deletions
diff --git a/include/session.h b/include/session.h
index 5b7e07b..61cc264 100644
--- a/include/session.h
+++ b/include/session.h
@@ -49,6 +49,13 @@ enum connman_session_type {
CONNMAN_SESSION_TYPE_INTERNET = 3,
};
+enum connman_session_id_type {
+ CONNMAN_SESSION_ID_TYPE_UNKNOWN = 0,
+ CONNMAN_SESSION_ID_TYPE_UID = 1,
+ CONNMAN_SESSION_ID_TYPE_GID = 2,
+ CONNMAN_SESSION_ID_TYPE_LSM = 3,
+};
+
struct cb_data {
void *cb;
void *user_data;
@@ -69,6 +76,8 @@ static inline struct cb_data *cb_data_new(void *cb, void *user_data)
struct connman_session;
struct connman_session_config {
+ enum connman_session_id_type id_type;
+ char *id;
connman_bool_t priority;
enum connman_session_roaming_policy roaming_policy;
enum connman_session_type type;
diff --git a/src/session.c b/src/session.c
index 236c599..bdb22d0 100644
--- a/src/session.c
+++ b/src/session.c
@@ -414,6 +414,10 @@ void connman_session_policy_unregister(struct connman_session_policy *policy)
void connman_session_set_default_config(struct connman_session_config *config)
{
+ config->id_type = CONNMAN_SESSION_ID_TYPE_UNKNOWN;
+ g_free(config->id);
+ config->id = NULL;
+
config->priority = FALSE;
config->roaming_policy = CONNMAN_SESSION_ROAMING_POLICY_DEFAULT;
config->type = CONNMAN_SESSION_TYPE_ANY;