summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-09-26 11:03:29 +0200
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-09-27 10:28:27 +0200
commit864d1fda21f25216d9dc592f8c2d034d3723bddf (patch)
treefc52e45868467ff39540370d5dc540ab543ffe07
parent7ebbc177367ef304e617b6c5613666c4947f1657 (diff)
downloadconnman-864d1fda21f25216d9dc592f8c2d034d3723bddf.tar.gz
connman-864d1fda21f25216d9dc592f8c2d034d3723bddf.tar.bz2
connman-864d1fda21f25216d9dc592f8c2d034d3723bddf.zip
session: Rename session_config to session_policy
-rw-r--r--include/session.h6
-rw-r--r--plugins/session_policy.c20
-rw-r--r--src/session.c44
3 files changed, 35 insertions, 35 deletions
diff --git a/include/session.h b/include/session.h
index 5aa3e5e4..fb2f3909 100644
--- a/include/session.h
+++ b/include/session.h
@@ -31,14 +31,14 @@ extern "C" {
/*
* The session are identified through the pid is only a temporary solution
*/
-struct connman_session_config {
+struct connman_session_policy {
const char *name;
int (*get_bool) (const char *id, const char *key, connman_bool_t *val);
int (*get_string) (const char *id, const char *key, char **val);
};
-int connman_session_config_register(struct connman_session_config *config);
-void connman_session_config_unregister(struct connman_session_config *config);
+int connman_session_policy_register(struct connman_session_policy *config);
+void connman_session_policy_unregister(struct connman_session_policy *config);
int connman_session_update_bool(const char *id, const char *key,
connman_bool_t val);
diff --git a/plugins/session_policy.c b/plugins/session_policy.c
index 626d9bb7..b001ea83 100644
--- a/plugins/session_policy.c
+++ b/plugins/session_policy.c
@@ -33,7 +33,7 @@
#include <connman/log.h>
#include <connman/session.h>
-static int config_get_bool(const char *id, const char *key, connman_bool_t *val)
+static int policy_get_bool(const char *id, const char *key, connman_bool_t *val)
{
DBG("id %s key %s", id, key);
@@ -47,7 +47,7 @@ static int config_get_bool(const char *id, const char *key, connman_bool_t *val)
return 0;
}
-static int config_get_string(const char *id, const char *key, char **val)
+static int policy_get_string(const char *id, const char *key, char **val)
{
DBG("id %s key %s", id, key);
@@ -59,28 +59,28 @@ static int config_get_string(const char *id, const char *key, char **val)
return 0;
}
-static struct connman_session_config session_config = {
+static struct connman_session_policy session_policy = {
.name = "session policy configuration",
- .get_bool = config_get_bool,
- .get_string = config_get_string,
+ .get_bool = policy_get_bool,
+ .get_string = policy_get_string,
};
-static int session_config_init(void)
+static int session_policy_init(void)
{
int err;
- err = connman_session_config_register(&session_config);
+ err = connman_session_policy_register(&session_policy);
if (err < 0)
return err;
return 0;
}
-static void session_config_exit(void)
+static void session_policy_exit(void)
{
- connman_session_config_unregister(&session_config);
+ connman_session_policy_unregister(&session_policy);
}
CONNMAN_PLUGIN_DEFINE(session_policy, "Session policy configuration plugin",
VERSION, CONNMAN_PLUGIN_PRIORITY_DEFAULT,
- session_config_init, session_config_exit)
+ session_policy_init, session_policy_exit)
diff --git a/src/session.c b/src/session.c
index 96b2e598..24fdf9a6 100644
--- a/src/session.c
+++ b/src/session.c
@@ -36,7 +36,7 @@ static DBusConnection *connection;
static GHashTable *session_hash;
static connman_bool_t sessionmode;
static struct connman_session *ecall_session;
-static struct connman_session_config *session_config;
+static struct connman_session_policy *session_policy;
enum connman_session_trigger {
CONNMAN_SESSION_TRIGGER_UNKNOWN = 0,
@@ -252,24 +252,24 @@ static char *service2bearer(enum connman_service_type type)
return "";
}
-static int config_get_bool(const char *id, const char *key, connman_bool_t *val)
+static int policy_get_bool(const char *id, const char *key, connman_bool_t *val)
{
- if (session_config == NULL) {
+ if (session_policy == NULL) {
*val = FALSE;
return -EINVAL;
}
- return (*session_config->get_bool)(id, key, val);
+ return (*session_policy->get_bool)(id, key, val);
}
-static int config_get_string(const char *id, const char *key, char **val)
+static int policy_get_string(const char *id, const char *key, char **val)
{
- if (session_config == NULL) {
+ if (session_policy == NULL) {
*val = NULL;
return -EINVAL;
}
- return (*session_config->get_string)(id, key, val);
+ return (*session_policy->get_string)(id, key, val);
}
static void cleanup_bearer_info(gpointer data, gpointer user_data)
@@ -1486,9 +1486,9 @@ int __connman_session_create(DBusMessage *msg)
info = session->info;
info_last = session->info_last;
- config_get_bool(owner, "Priority", &priority);
- config_get_bool(owner, "EmergencyCall", &ecall_app);
- config_get_string(owner, "RoamingPolicy", &roaming_policy_str);
+ policy_get_bool(owner, "Priority", &priority);
+ policy_get_bool(owner, "EmergencyCall", &ecall_app);
+ policy_get_string(owner, "RoamingPolicy", &roaming_policy_str);
roaming_policy = string2roamingpolicy(roaming_policy_str);
session->owner = g_strdup(owner);
@@ -1812,34 +1812,34 @@ int connman_session_update_string(const char *id, const char *key,
return -EINVAL;
}
-int connman_session_config_register(struct connman_session_config *config)
+int connman_session_policy_register(struct connman_session_policy *policy)
{
- DBG("name %s", config->name);
+ DBG("name %s", policy->name);
- if (session_config != NULL) {
- connman_warn("A session configuration plugin '%s' is "
+ if (session_policy != NULL) {
+ connman_warn("A session policy plugin '%s' is "
"already registerd. Skipping registration "
"of plugin '%s'",
- session_config->name, config->name);
+ session_policy->name, policy->name);
return -EALREADY;
}
- session_config = config;
+ session_policy = policy;
return 0;
}
-void connman_session_config_unregister(struct connman_session_config *config)
+void connman_session_policy_unregister(struct connman_session_policy *policy)
{
- DBG("name %s", config->name);
+ DBG("name %s", policy->name);
- if (config != session_config) {
- connman_warn("Trying to unregister session configuration "
- "plugin '%s'", config->name);
+ if (policy != session_policy) {
+ connman_warn("Trying to unregister session policy "
+ "plugin '%s'", policy->name);
return;
}
- session_config = NULL;
+ session_policy = NULL;
}
int __connman_session_init(void)