Beispiel #1
0
	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
Beispiel #2
0
	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
Beispiel #3
0
	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
Beispiel #4
0
 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
Beispiel #5
0
 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
Beispiel #6
0
	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
Beispiel #7
0
 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)
Beispiel #8
0
	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)
Beispiel #9
0
	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)
Beispiel #10
0
 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]))
Beispiel #11
0
	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
Beispiel #12
0
	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
Beispiel #13
0
	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
Beispiel #14
0
	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]))
Beispiel #15
0
 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