function cmd::list::_iter_confs() {
  # Usage: cmd::list::_iter_confs <filter_type> <callback>
  local filter_type="$1"
  local callback="$2"
  local dir
  dir="$(ctx::clients)"

  for conf in "${dir}"/*.conf; do
    [[ -f "$conf" ]] || continue
    local client_name
    client_name=$(basename "$conf" .conf)
    local ip="${p_ips[$client_name]:-}"
    if [[ -z "$ip" ]]; then
      ip=$(grep "^Address" "$conf" | awk '{print $3}' | cut -d'/' -f1)
    fi
    local type
    type=$(peers::get_type_from_ip "$ip")
    [[ -n "$filter_type" && "$type" != "$filter_type" ]] && continue
    "$callback" "$client_name" "$ip" "$type"
  done
}