def _checkPrefix(ip, prefixlen, version):
 bits = _ipVersionToLen(version)
 if ((prefixlen < 0) or (prefixlen > bits)):
  return None
 if (ip == 0):
  zbits = (bits + 1)
 else:
  zbits = _count0Bits(ip)
 if (zbits < (bits - prefixlen)):
  return 0
 else:
  return 1

def _checkPrefix ( ip , prefixlen , version ) : bits = _ipVersionToLen ( version ) if ( ( prefixlen < 0 ) or ( prefixlen > bits ) ) : return None if ( ip == 0 ) : zbits = ( bits + 1 ) else : zbits = _count0Bits ( ip ) if ( zbits < ( bits - prefixlen ) ) : return 0 else : return 1
check the validity of a prefix checks if the variant part of a prefix only has 0s .