added addr_perm and range_perm functions