当前位置: 首页>>代码示例>>Python>>正文


Python SAFI.unpack方法代码示例

本文整理汇总了Python中exabgp.protocol.family.SAFI.unpack方法的典型用法代码示例。如果您正苦于以下问题:Python SAFI.unpack方法的具体用法?Python SAFI.unpack怎么用?Python SAFI.unpack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在exabgp.protocol.family.SAFI的用法示例。


在下文中一共展示了SAFI.unpack方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: unpack_capability

# 需要导入模块: from exabgp.protocol.family import SAFI [as 别名]
# 或者: from exabgp.protocol.family.SAFI import unpack [as 别名]
	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
开发者ID:SaveTheRbtz,项目名称:exabgp,代码行数:11,代码来源:addpath.py

示例2: unpack

# 需要导入模块: from exabgp.protocol.family import SAFI [as 别名]
# 或者: from exabgp.protocol.family.SAFI import unpack [as 别名]
	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
开发者ID:Krychuu,项目名称:exabgp,代码行数:11,代码来源:addpath.py

示例3: unpack_capability

# 需要导入模块: from exabgp.protocol.family import SAFI [as 别名]
# 或者: from exabgp.protocol.family.SAFI import unpack [as 别名]
	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
开发者ID:Exa-Networks,项目名称:exabgp,代码行数:12,代码来源:nexthop.py

示例4: unpack_capability

# 需要导入模块: from exabgp.protocol.family import SAFI [as 别名]
# 或者: from exabgp.protocol.family.SAFI import unpack [as 别名]
	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)
开发者ID:Empia,项目名称:exabgp,代码行数:16,代码来源:graceful.py

示例5: unpack

# 需要导入模块: from exabgp.protocol.family import SAFI [as 别名]
# 或者: from exabgp.protocol.family.SAFI import unpack [as 别名]
	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)
开发者ID:Krychuu,项目名称:exabgp,代码行数:16,代码来源:graceful.py

示例6: unpack_capability

# 需要导入模块: from exabgp.protocol.family import SAFI [as 别名]
# 或者: from exabgp.protocol.family.SAFI import unpack [as 别名]
	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
开发者ID:CadeLaRen,项目名称:exabgp,代码行数:8,代码来源:mp.py

示例7: unpack

# 需要导入模块: from exabgp.protocol.family import SAFI [as 别名]
# 或者: from exabgp.protocol.family.SAFI import unpack [as 别名]
	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
开发者ID:henry-nicolas,项目名称:exabgp,代码行数:8,代码来源:mp.py

示例8: unpack_message

# 需要导入模块: from exabgp.protocol.family import SAFI [as 别名]
# 或者: from exabgp.protocol.family.SAFI import unpack [as 别名]
	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]))
开发者ID:xiaopeng163,项目名称:exabgp,代码行数:5,代码来源:eor.py


注:本文中的exabgp.protocol.family.SAFI.unpack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。