Rewrite compute_distance2outer to use rpacket_t and storage_model_t arguments