diff options
-rw-r--r-- | doc/network-lowlevel-api.txt | 24 | ||||
-rw-r--r-- | src/network.c | 54 |
2 files changed, 3 insertions, 75 deletions
diff --git a/doc/network-lowlevel-api.txt b/doc/network-lowlevel-api.txt index 96fe20fc..6572f0f1 100644 --- a/doc/network-lowlevel-api.txt +++ b/doc/network-lowlevel-api.txt @@ -12,16 +12,6 @@ Methods dict GetProperties() Possible Errors: [service].Error.InvalidArguments - void SetProperty(string name, variant value) - - Changes the value of the specified property. Only - properties that are listed as read-write are - changeable. On success a PropertyChanged signal - will be emitted. - - Possible Errors: [service].Error.InvalidArguments - [service].Error.InvalidProperty - Signals PropertyChanged(string name, variant value) This signal indicates a changed value of the given @@ -60,29 +50,21 @@ Properties string Address [readonly] If the network type is WiFi, then this property is present and contains the binary SSID value. - string WiFi.Mode [readonly, readwrite] + string WiFi.Mode [readonly] If the network type is WiFi, then this property is present and contains the mode of the network. The possible values are "managed" or "adhoc". - For scanned networks this value is read only, but in - case the network was manually created it is also - changeable. - - string WiFi.Security [readonly, readwrite] + string WiFi.Security [readonly] If the network type is WiFi, then this property is present and contains the security method or key management setting. - For scanned networks this value is read only, but in - case the network was manually created it is also - changeable. - Possible values are "none", "wep", "wpa" and "rsn". - string WiFi.Passphrase [readwrite] + string WiFi.Passphrase [readonly] If the network type is WiFi and a passhrase is requires, then this property is present and contains diff --git a/src/network.c b/src/network.c index b52b2f60..7c13f0d0 100644 --- a/src/network.c +++ b/src/network.c @@ -171,62 +171,8 @@ static DBusMessage *get_properties(DBusConnection *conn, return reply; } -static DBusMessage *set_property(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct connman_network *network = data; - DBusMessageIter iter, value; - const char *name; - int type; - - DBG("conn %p", conn); - - if (dbus_message_iter_init(msg, &iter) == FALSE) - return __connman_error_invalid_arguments(msg); - - dbus_message_iter_get_basic(&iter, &name); - dbus_message_iter_next(&iter); - dbus_message_iter_recurse(&iter, &value); - - if (__connman_security_check_privilege(msg, - CONNMAN_SECURITY_PRIVILEGE_MODIFY) < 0) - return __connman_error_permission_denied(msg); - - type = dbus_message_iter_get_arg_type(&value); - - if (g_str_equal(name, "WiFi.Passphrase") == TRUE) { - const char *passphrase; - - if (type != DBUS_TYPE_STRING) - return __connman_error_invalid_arguments(msg); - - if (__connman_security_check_privilege(msg, - CONNMAN_SECURITY_PRIVILEGE_SECRET) < 0) - return __connman_error_permission_denied(msg); - - dbus_message_iter_get_basic(&value, &passphrase); - - g_free(network->wifi.passphrase); - network->wifi.passphrase = g_strdup(passphrase); - } else if (g_str_has_prefix(name, "IPv4.") == TRUE) { - int err; - - if (network->ipconfig == NULL) - return __connman_error_invalid_property(msg); - - err = __connman_ipconfig_set_ipv4(network->ipconfig, - name + 5, &value); - if (err < 0) - return __connman_error_failed(msg, -err); - } else - return __connman_error_invalid_property(msg); - - return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); -} - static GDBusMethodTable network_methods[] = { { "GetProperties", "", "a{sv}", get_properties }, - { "SetProperty", "sv", "", set_property }, { }, }; |