function to convert cidr to mask