summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-04-20 14:41:19 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-04-20 15:18:56 +0200
commit55e275762c011595ed1d106bbb3867be415a8a07 (patch)
tree2e0772ed478c4d0b4ab8289714f7ca4b3f623747 /src/manager.c
parentabb0215152df00c6556cf6ba0b99686f895d2d9c (diff)
downloadconnman-55e275762c011595ed1d106bbb3867be415a8a07.tar.gz
connman-55e275762c011595ed1d106bbb3867be415a8a07.tar.bz2
connman-55e275762c011595ed1d106bbb3867be415a8a07.zip
manager: Add hooks for the PrivateNetwork API
RequestPrivateNetwork() doesn't return an fd yet and both of them are completely dummy.
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c
index 4afed269..05146555 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -591,6 +591,40 @@ static DBusMessage *destroy_session(DBusConnection *conn,
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
+static DBusMessage *request_private_network(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ const char *sender;
+ int err;
+
+ DBG("conn %p", conn);
+
+ sender = dbus_message_get_sender(msg);
+
+ err = __connman_private_network_request(sender);
+ if (err < 0)
+ return __connman_error_failed(msg, -err);
+
+ return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
+}
+
+static DBusMessage *release_private_network(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ const char *sender;
+ int err;
+
+ DBG("conn %p", conn);
+
+ sender = dbus_message_get_sender(msg);
+
+ err = __connman_private_network_release(sender);
+ if (err < 0)
+ return __connman_error_failed(msg, -err);
+
+ return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
+}
+
static GDBusMethodTable manager_methods[] = {
{ "GetProperties", "", "a{sv}", get_properties },
{ "SetProperty", "sv", "", set_property },
@@ -615,6 +649,10 @@ static GDBusMethodTable manager_methods[] = {
{ "UnregisterCounter", "o", "", unregister_counter },
{ "CreateSession", "a{sv}o", "o", create_session },
{ "DestroySession", "o", "", destroy_session },
+ { "RequestPrivateNetwork", "", "",
+ request_private_network },
+ { "ReleasePrivateNetwork", "", "",
+ release_private_network },
{ },
};