summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-03-31 12:36:12 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-31 12:36:12 +0200
commiteca42aa6eefa7dadb1d0d8829f753c6a76b66f70 (patch)
treee24f1a0abb5d370a442a5c85729f7e45aaec67b3 /src/manager.c
parent70534def72a9e59f0df63c7c02ba34c883c88fe1 (diff)
downloadconnman-eca42aa6eefa7dadb1d0d8829f753c6a76b66f70.tar.gz
connman-eca42aa6eefa7dadb1d0d8829f753c6a76b66f70.tar.bz2
connman-eca42aa6eefa7dadb1d0d8829f753c6a76b66f70.zip
session: Refactor session API
Refactor the D-Bus API of the session according the documentation. All function and properties are only empty stubs.
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/src/manager.c b/src/manager.c
index 198875da..349ddb41 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -589,40 +589,28 @@ static DBusMessage *unregister_counter(DBusConnection *conn,
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
-static DBusMessage *request_session(DBusConnection *conn,
+static DBusMessage *create_session(DBusConnection *conn,
DBusMessage *msg, void *data)
{
- const char *bearer, *sender, *service_path;
- struct connman_service *service;
+ int err;
DBG("conn %p", conn);
- sender = dbus_message_get_sender(msg);
-
- dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &bearer,
- DBUS_TYPE_INVALID);
-
- service = __connman_session_request(bearer, sender);
- if (service == NULL)
- return __connman_error_failed(msg, EINVAL);
-
- service_path = __connman_service_get_path(service);
+ err = __connman_session_create(msg);
+ if (err < 0)
+ return __connman_error_failed(msg, -err);
- return g_dbus_create_reply(msg, DBUS_TYPE_OBJECT_PATH, &service_path,
- DBUS_TYPE_INVALID);
+ return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
-static DBusMessage *release_session(DBusConnection *conn,
+static DBusMessage *destroy_session(DBusConnection *conn,
DBusMessage *msg, void *data)
{
- const char *sender;
int err;
DBG("conn %p", conn);
- sender = dbus_message_get_sender(msg);
-
- err = __connman_session_release(sender);
+ err = __connman_session_destroy(msg);
if (err < 0)
return __connman_error_failed(msg, -err);
@@ -651,8 +639,8 @@ static GDBusMethodTable manager_methods[] = {
{ "UnregisterAgent", "o", "", unregister_agent },
{ "RegisterCounter", "ouu", "", register_counter },
{ "UnregisterCounter", "o", "", unregister_counter },
- { "RequestSession", "s", "o", request_session },
- { "ReleaseSession", "s", "", release_session },
+ { "CreateSession", "a{sv}o", "o", create_session },
+ { "DestroySession", "o", "", destroy_session },
{ },
};