+ return ret;
+}
+
+static void map_pd_inst_channels(void *key, void *value, void *user_data)
+{
+ GHashTable *channel_map;
+ GHashTable *channel_indices;
+ GSList *channel_list;
+ struct srd_decoder_inst *di;
+ GVariant *var;
+ void *channel_id;
+ void *channel_target;
+ struct sr_channel *ch;
+ GHashTableIter iter;
+
+ channel_map = value;
+ channel_list = user_data;
+
+ di = srd_inst_find_by_id(srd_sess, key);
+ if (!di) {
+ g_critical("Protocol decoder instance \"%s\" not found.",
+ (char *)key);
+ return;
+ }
+ channel_indices = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
+ (GDestroyNotify)g_variant_unref);
+
+ g_hash_table_iter_init(&iter, channel_map);
+ while (g_hash_table_iter_next(&iter, &channel_id, &channel_target)) {
+ ch = find_channel(channel_list, channel_target);
+ if (!ch) {
+ g_printerr("cli: No channel with name \"%s\" found.\n",
+ (char *)channel_target);
+ continue;