}
supplicant_dbus_property_get_all(path,
- SUPPLICANT_INTERFACE ".Interface.Network",
+ SUPPLICANT_INTERFACE ".Network",
network_property, network);
}
}
supplicant_dbus_property_get_all(path,
- SUPPLICANT_INTERFACE ".Interface.BSS",
+ SUPPLICANT_INTERFACE ".BSS",
bss_property, bss);
}
{ SUPPLICANT_INTERFACE ".Interface", "NetworkAdded", signal_network_added },
{ SUPPLICANT_INTERFACE ".Interface", "NetworkRemoved", signal_network_removed },
- { SUPPLICANT_INTERFACE ".Interface.BSS", "PropertiesChanged", signal_bss_changed },
+ { SUPPLICANT_INTERFACE ".BSS", "PropertiesChanged", signal_bss_changed },
{ }
};
if (interface->scanning == TRUE)
return -EALREADY;
+ switch (interface->state) {
+ case G_SUPPLICANT_STATE_AUTHENTICATING:
+ case G_SUPPLICANT_STATE_ASSOCIATING:
+ case G_SUPPLICANT_STATE_ASSOCIATED:
+ case G_SUPPLICANT_STATE_4WAY_HANDSHAKE:
+ case G_SUPPLICANT_STATE_GROUP_HANDSHAKE:
+ return -EBUSY;
+ case G_SUPPLICANT_STATE_UNKNOWN:
+ case G_SUPPLICANT_STATE_DISCONNECTED:
+ case G_SUPPLICANT_STATE_INACTIVE:
+ case G_SUPPLICANT_STATE_SCANNING:
+ case G_SUPPLICANT_STATE_COMPLETED:
+ break;
+ }
+
data = dbus_malloc0(sizeof(*data));
if (data == NULL)
return -ENOMEM;
return -EINPROGRESS;
}
-static void interface_disconnect_result(const char *error,
+static void network_remove_result(const char *error,
DBusMessageIter *iter, void *user_data)
{
struct interface_data *data = user_data;
dbus_free(data);
}
+static void network_remove_params(DBusMessageIter *iter, void *user_data)
+{
+ struct interface_data *data = user_data;
+ const char *path = data->interface->network_path;
+
+ SUPPLICANT_DBG("path %s", path);
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &path);
+}
+
+static int network_remove(struct interface_data *data)
+{
+ GSupplicantInterface *interface = data->interface;
+
+ SUPPLICANT_DBG("");
+
+ return supplicant_dbus_method_call(interface->path,
+ SUPPLICANT_INTERFACE ".Interface", "RemoveNetwork",
+ network_remove_params, network_remove_result, data);
+}
+
+static void interface_disconnect_result(const char *error,
+ DBusMessageIter *iter, void *user_data)
+{
+ struct interface_data *data = user_data;
+
+ SUPPLICANT_DBG("");
+
+ if (error != NULL && data->callback != NULL) {
+ data->callback(-EIO, data->interface, data->user_data);
+ return;
+ }
+
+ network_remove(data);
+}
+
int g_supplicant_interface_disconnect(GSupplicantInterface *interface,
GSupplicantInterfaceCallback callback,
void *user_data)
static const char *g_supplicant_rule3 = "type=signal,"
"interface=" SUPPLICANT_INTERFACE ".Interface.WPS";
static const char *g_supplicant_rule4 = "type=signal,"
- "interface=" SUPPLICANT_INTERFACE ".Interface.BSS";
+ "interface=" SUPPLICANT_INTERFACE ".BSS";
static const char *g_supplicant_rule5 = "type=signal,"
- "interface=" SUPPLICANT_INTERFACE ".Interface.Network";
-static const char *g_supplicant_rule6 = "type=signal,"
- "interface=" SUPPLICANT_INTERFACE ".Interface.Blob";
+ "interface=" SUPPLICANT_INTERFACE ".Network";
static void invoke_introspect_method(void)
{
dbus_bus_add_match(connection, g_supplicant_rule3, NULL);
dbus_bus_add_match(connection, g_supplicant_rule4, NULL);
dbus_bus_add_match(connection, g_supplicant_rule5, NULL);
- dbus_bus_add_match(connection, g_supplicant_rule6, NULL);
dbus_connection_flush(connection);
if (dbus_bus_name_has_owner(connection,
SUPPLICANT_DBG("");
if (connection != NULL) {
- dbus_bus_remove_match(connection, g_supplicant_rule6, NULL);
dbus_bus_remove_match(connection, g_supplicant_rule5, NULL);
dbus_bus_remove_match(connection, g_supplicant_rule4, NULL);
dbus_bus_remove_match(connection, g_supplicant_rule3, NULL);