@classmethod
	def unpack_nlri (cls, afi, safi, bgp, action, addpath):

		length = ord(bgp[0])

		if length == 0:
			return cls(afi,safi,action,ASN(0),None),bgp[1:]

		if length < 8*4:
			raise Exception("incorrect RT lenght: %d (should be >=32,<=96)" % length)

		# We are reseting the flags on the RouteTarget extended
		# community, because they do not make sense for an RTC route

		return cls(
			afi, safi, action,
			ASN(unpack('!L', bgp[1:5])[0]),
			RouteTarget.unpack(
				RTC.resetFlags(bgp[5])+bgp[6:13]
			)
		),bgp[13:]
dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/bgp/message/update/nlri/rtc.py/RTC.unpack_nlri/original