Metric and ultrametric spaces of resistances