def unpack_capability (instance, data, capability=None): # pylint: disable=W0613 # XXX: FIXME: should check that we have not yet seen the capability while data: afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[2]) sr = ord(data[3]) instance.add_path(afi,safi,sr) data = data[4:] return instance
def unpack_capability (instance, data, capability=None): # pylint: disable=W0613 # XXX: FIXME: should check that we have not yet seen the capability while data: afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[2]) sr = ord_(data[3]) instance.add_path(afi,safi,sr) data = data[4:] return instance
def unpack (capability,instance,data): # XXX: FIXME: should check that we have not yet seen the capability while data: afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[2]) sr = ord(data[3]) instance.add_path(afi,safi,sr) data = data[4:] return instance
def unpack(capability, instance, data): # XXX: FIXME: should check that we have not yet seen the capability while data: afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[2]) sr = ord(data[3]) instance.add_path(afi, safi, sr) data = data[4:] return instance
def unpack_capability(instance, data, capability=None): # pylint: disable=W0613 # XXX: FIXME: we should complain if we have twice the same AFI/SAFI # XXX: FIXME: should check that we have not yet seen the capability while data: afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[3]) nexthop = AFI.unpack(data[4:6]) instance.add_nexthop(afi, safi, nexthop) data = data[6:] return instance
def unpack_capability (instance, data, capability=None): # pylint: disable=W0613 # XXX: FIXME: we should complain if we have twice the same AFI/SAFI # XXX: FIXME: should check that we have not yet seen the capability while data: afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[3]) nexthop = AFI.unpack(data[4:6]) instance.add_nexthop(afi, safi, nexthop) data = data[6:] return instance
def unpack_capability(instance, data, _=None): # XXX: FIXME: should raise if instance was already setup restart = unpack('!H', data[:2])[0] restart_flag = restart >> 12 restart_time = restart & Graceful.TIME_MASK data = data[2:] families = [] while data: afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[2]) flag_family = ord(data[0]) families.append((afi, safi, flag_family)) data = data[4:] return instance.set(restart_flag, restart_time, families)
def unpack_capability (instance, data, capability=None): # pylint: disable=W0613 # XXX: FIXME: should raise if instance was already setup restart = unpack('!H',data[:2])[0] restart_flag = restart >> 12 restart_time = restart & Graceful.TIME_MASK data = data[2:] families = [] while data: afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[2]) flag_family = ord(data[3]) families.append((afi,safi,flag_family)) data = data[4:] return instance.set(restart_flag,restart_time,families)
def unpack (what,instance,data): # XXX: FIXME: should raise if instance was already setup restart = unpack('!H',data[:2])[0] restart_flag = restart >> 12 restart_time = restart & Graceful.TIME_MASK data = data[2:] families = [] while data: afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[2]) flag_family = ord(data[0]) families.append((afi,safi,flag_family)) data = data[4:] return instance.set(restart_flag,restart_time,families)
def unpack_message(cls, data, negotiated): header_length = len(EOR.NLRI.PREFIX) return cls(AFI.unpack(data[header_length:header_length + 2]), SAFI.unpack(data[header_length + 2]))
def unpack_capability (instance, data, capability=None): # pylint: disable=W0613 # XXX: FIXME: we should raise if we have twice the same AFI/SAFI afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[3]) instance.append((afi,safi)) return instance
def unpack (what,instance,data): # XXX: FIXME: we should raise if we have twice the same AFI/SAFI afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[3]) instance.append((afi,safi)) return instance
def unpack_capability (instance,data,_=None): # XXX: FIXME: we should raise if we have twice the same AFI/SAFI afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[3]) instance.append((afi,safi)) return instance
def unpack_message (cls, data, negotiated): header_length = len(EOR.NLRI.PREFIX) return cls(AFI.unpack(data[header_length:header_length+2]),SAFI.unpack(data[header_length+2]))
def unpack(what, instance, data): # XXX: FIXME: we should raise if we have twice the same AFI/SAFI afi = AFI.unpack(data[:2]) safi = SAFI.unpack(data[3]) instance.append((afi, safi)) return instance