static GNode *element_root = NULL;
static GSList *driver_list = NULL;
-static gchar *device_filter = NULL;
-static gchar *nodevice_filter = NULL;
+static gchar **device_filter = NULL;
+static gchar **nodevice_filter = NULL;
static gboolean started = FALSE;
gboolean __connman_element_device_isfiltered(const char *devname)
{
+ char **pattern;
+
if (device_filter == NULL)
goto nodevice;
- if (g_pattern_match_simple(device_filter, devname) == FALSE) {
- DBG("ignoring device %s (match)", devname);
- return TRUE;
+ for (pattern = device_filter; *pattern; pattern++) {
+ if (g_pattern_match_simple(*pattern, devname) == FALSE) {
+ DBG("ignoring device %s (match)", devname);
+ return TRUE;
+ }
}
nodevice:
if (nodevice_filter == NULL)
return FALSE;
- if (g_pattern_match_simple(nodevice_filter, devname) == TRUE) {
- DBG("ignoring device %s (no match)", devname);
- return TRUE;
+ for (pattern = nodevice_filter; *pattern; pattern++) {
+ if (g_pattern_match_simple(*pattern, devname) == TRUE) {
+ DBG("ignoring device %s (no match)", devname);
+ return TRUE;
+ }
}
return FALSE;
if (connection == NULL)
return -EIO;
- device_filter = g_strdup(device);
- nodevice_filter = g_strdup(nodevice);
+ if (device)
+ device_filter = g_strsplit(device, ",", -1);
+
+ if (nodevice)
+ nodevice_filter = g_strsplit(nodevice, ",", -1);
element = connman_element_create("root");
g_node_destroy(element_root);
element_root = NULL;
- g_free(nodevice_filter);
- g_free(device_filter);
+ g_strfreev(nodevice_filter);
+ g_strfreev(device_filter);
if (connection == NULL)
return;