diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-03-22 17:20:19 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-03-22 17:20:19 +0000 |
commit | ed83ee24ed636f5f2d213bc825d702cc45c20b8f (patch) | |
tree | e3717ec3d43bf94cbf209589fe62381309862640 /network | |
parent | b8773553381ed1d070c7bc2a60c7a8b3f5f96552 (diff) |
network: Added Server.SetSecurity
Diffstat (limited to 'network')
-rw-r--r-- | network/server.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/network/server.c b/network/server.c index 6a91de7c..982c0830 100644 --- a/network/server.c +++ b/network/server.c @@ -135,10 +135,30 @@ static DBusHandlerResult set_routing(DBusConnection *conn, DBusMessage *msg, return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } -static DBusHandlerResult set_security(DBusConnection *conn, DBusMessage *msg, - void *data) +static DBusHandlerResult set_security(DBusConnection *conn, + DBusMessage *msg, void *data) { - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + struct network_server *ns = data; + DBusMessage *reply; + DBusError derr; + dbus_bool_t secure; + + reply = dbus_message_new_method_return(msg); + if (!reply) + return DBUS_HANDLER_RESULT_NEED_MEMORY; + + dbus_error_init(&derr); + if (!dbus_message_get_args(msg, &derr, + DBUS_TYPE_BOOLEAN, &secure, + DBUS_TYPE_INVALID)) { + err_invalid_args(conn, msg, derr.message); + dbus_error_free(&derr); + return DBUS_HANDLER_RESULT_HANDLED; + } + + ns->secure = secure; + + return send_message_and_unref(conn, reply); } static DBusHandlerResult get_security(DBusConnection *conn, |