本文整理汇总了Python中util.unpack_port_no函数的典型用法代码示例。如果您正苦于以下问题:Python unpack_port_no函数的具体用法?Python unpack_port_no怎么用?Python unpack_port_no使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unpack_port_no函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: unpack
def unpack(reader):
obj = port()
_type = reader.read("!H")[0]
assert(_type == 0)
_length = reader.read("!H")[0]
orig_reader = reader
reader = orig_reader.slice(_length - (2 + 2))
obj.value = util.unpack_port_no(reader)
return obj
示例2: unpack
def unpack(reader):
obj = queue_stats_entry()
obj.port_no = util.unpack_port_no(reader)
reader.skip(2)
obj.queue_id = reader.read("!L")[0]
obj.tx_bytes = reader.read("!Q")[0]
obj.tx_packets = reader.read("!Q")[0]
obj.tx_errors = reader.read("!Q")[0]
return obj
示例3: unpack
def unpack(reader):
obj = output()
_type = reader.read("!H")[0]
assert(_type == 0)
_len = reader.read("!H")[0]
orig_reader = reader
reader = orig_reader.slice(_len, 4)
obj.port = util.unpack_port_no(reader)
obj.max_len = reader.read("!H")[0]
return obj
示例4: unpack
def unpack(reader):
obj = bsn_vport_l2gre()
_type = reader.read("!H")[0]
assert(_type == 1)
_length = reader.read("!H")[0]
orig_reader = reader
reader = orig_reader.slice(_length - (2 + 2))
obj.flags = reader.read("!L")[0]
obj.port_no = util.unpack_port_no(reader)
obj.loopback_port_no = util.unpack_port_no(reader)
obj.local_mac = list(reader.read('!6B'))
obj.nh_mac = list(reader.read('!6B'))
obj.src_ip = reader.read("!L")[0]
obj.dst_ip = reader.read("!L")[0]
obj.dscp = reader.read("!B")[0]
obj.ttl = reader.read("!B")[0]
reader.skip(2)
obj.vpn = reader.read("!L")[0]
obj.if_name = reader.read("!16s")[0].rstrip("\x00")
return obj
示例5: unpack
def unpack(buf):
obj = output()
if type(buf) == loxi.generic_util.OFReader:
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
_type = reader.read("!H")[0]
assert(_type == 0)
_len = reader.read("!H")[0]
obj.port = util.unpack_port_no(reader)
obj.max_len = reader.read("!H")[0]
return obj
示例6: unpack
def unpack(buf):
obj = queue_stats_entry()
if type(buf) == loxi.generic_util.OFReader:
reader = buf
else:
reader = loxi.generic_util.OFReader(buf)
obj.port_no = util.unpack_port_no(reader)
reader.skip(2)
obj.queue_id = reader.read("!L")[0]
obj.tx_bytes = reader.read("!Q")[0]
obj.tx_packets = reader.read("!Q")[0]
obj.tx_errors = reader.read("!Q")[0]
return obj