/* Returns TRUE if the given device should capture in monitor mode by default  */
gboolean prefs_capture_device_monitor_mode(const char *name)
/* Returns TRUE if the given device should capture in monitor mode by default  */
gboolean prefs_capture_device_monitor_mode(const char *name)
{
    gchar *tok, *devices;
    size_t len;
    if (prefs.capture_devices_monitor_mode && name) {
        devices = g_strdup (prefs.capture_devices_monitor_mode);
        len = strlen (name);
        for (tok = strtok (devices, ","); tok; tok = strtok(NULL, ",")) {
            if (strlen (tok) == len && strcmp (name, tok) == 0) {
                g_free (devices);
                return TRUE;
            }
        }
        g_free (devices);
    }
    return FALSE;
}