def _ip(ip, ip_type, cidr):
    """
    Helper for ipv4 and ipv6

    """
    if ip is False:
        return True
    if not isinstance(ip, str):
        raise TypeError('ipv4 must be false or string.')
    elif ip == cidr:
        return True
    elif ip == 'nat':
        return True
    elif ip == 'tor':
        return True
    else:
        raise ValueError('{} must be one of: False|{}'.format(ip_type, cidr))
