'Parses addr/netbits or addr/netmask
Returns (IPAddr6,netbits)'

@staticmethod
def parse_cidr(addr_and_net, allow_host=False):

    addr = addr_and_net
    def check(r0, r1):
        a = r0.num
        b = r1
        if ((not allow_host) and (a & ((1 << b) - 1))):
            raise RuntimeError(('Host    part    of    CIDR    address    is    not    zero    (%s)' % (addr,)))
        return (r0, (128 - r1))
    addr = addr.split('/', 2)
    if (len(addr) == 1):
        return check(IPAddr6(addr[0]), 0)
    try:
        wild = (128 - int(addr[1]))
    except:
        m = IPAddr6(addr[1]).num
        b = 0
        while (m & (1 << 127)):
            b += 1
            m <<= 1
        if ((m & ((1 << 127) - 1)) != 0):
            raise RuntimeError((('Netmask    ' + str(addr[1])) + '    is    not    CIDR-compatible'))
        wild = (128 - b)
        assert ((wild >= 0) and (wild <= 128))
        return check(IPAddr6(addr[0]), wild)
    assert ((wild >= 0) and (wild <= 128))
    return check(IPAddr6(addr[0]), wild)
