summaryrefslogtreecommitdiff
path: root/src/technology.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/technology.c')
-rw-r--r--src/technology.c72
1 files changed, 31 insertions, 41 deletions
diff --git a/src/technology.c b/src/technology.c
index b3586001..e9e4cd61 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -589,6 +589,37 @@ static void append_devices(DBusMessageIter *iter, void *user_data)
DBUS_TYPE_STRING, &str);
}
}
+
+void __connman_technology_append_interfaces(DBusMessageIter *array,
+ enum connman_service_type type, const char *ifname)
+{
+ GSList *list;
+ struct connman_technology *technology = NULL;
+
+ for (list = technology_list; list; list = list->next) {
+ struct connman_technology *local_tech = list->data;
+
+ if (local_tech->type != type)
+ continue;
+
+ technology = local_tech;
+ break;
+ }
+
+ if (!technology)
+ return;
+
+ for (list = technology->device_list; list; list = list->next) {
+ struct connman_device *device = list->data;
+ const char *str = connman_device_get_string(device, "Interface");
+
+ if (g_strcmp0(ifname, str) == 0)
+ continue;
+
+ dbus_message_iter_append_basic(array,
+ DBUS_TYPE_STRING, &str);
+ }
+}
#endif
static void append_properties(DBusMessageIter *iter,
@@ -1755,45 +1786,6 @@ static DBusMessage *get_max_scan_ssid(DBusConnection *conn, DBusMessage *msg, vo
return reply;
}
-static DBusMessage *get_interfaces(DBusConnection *conn, DBusMessage *msg, void *data)
-{
- DBusMessage *reply;
- DBusMessageIter iter, array;
- GSList *list;
- struct connman_technology *technology = data;
- const char *default_interface = connman_option_get_string("DefaultWifiInterface");
-
- DBG("technology %p", technology);
-
- reply = dbus_message_new_method_return(msg);
- if (!reply)
- return NULL;
-
- if (technology->type != CONNMAN_SERVICE_TYPE_WIFI)
- return NULL;
-
- dbus_message_iter_init_append(reply, &iter);
- dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
- DBUS_TYPE_STRING_AS_STRING, &array);
-
- dbus_message_iter_append_basic(&array,
- DBUS_TYPE_STRING, &default_interface);
-
- for (list = technology->device_list; list; list = list->next) {
- struct connman_device *device = list->data;
- const char *str = connman_device_get_string(device, "Interface");
-
- if (g_strcmp0(default_interface, str) == 0)
- continue;
-
- dbus_message_iter_append_basic(&array,
- DBUS_TYPE_STRING, &str);
- }
-
- dbus_message_iter_close_container(&iter, &array);
- return reply;
-}
-
static int technology_enable_device(struct connman_technology *technology,
bool enable_device, const char *ifname, struct connman_device **device_out)
{
@@ -2497,8 +2489,6 @@ static const GDBusMethodTable technology_methods[] = {
get_5ghz_supported) },
{ GDBUS_METHOD("GetMaxScanSsid", NULL, GDBUS_ARGS({ "maxscanssid", "a{sv}" }),
get_max_scan_ssid) },
- { GDBUS_METHOD("GetInterfaces", NULL, GDBUS_ARGS({ "interface_list", "as" }),
- get_interfaces) },
{ GDBUS_ASYNC_METHOD("SetDevicePower",
GDBUS_ARGS({ "ifname", "s" }, { "value", "b" }),
NULL, set_device_power) },