

@staticmethod
def decode(afi, bgp):
    mask = ord(bgp[0])
    size = CIDR.size(mask)
    if (len(bgp) < (size + 1)):
        raise Notify(3, 10, 'could not decode CIDR')
    padding = ('\x00' * (IP.length(afi) - size))
    return ((bgp[1:(size + 1)] + padding), mask)

dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/bgp/message/update/nlri/cidr.py CIDR.decode/original