示例#1
0
 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
0
文件: common.py 项目: wuzhiwu/oftest
 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
0
 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
示例#4
0
 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
示例#5
0
 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
示例#6
0
文件: common.py 项目: Milstein/oftest
 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
示例#7
0
 def unpack(reader):
     obj = enqueue()
     _type = reader.read("!H")[0]
     assert(_type == 11)
     _len = reader.read("!H")[0]
     orig_reader = reader
     reader = orig_reader.slice(_len, 4)
     obj.port = util.unpack_port_no(reader)
     reader.skip(6)
     obj.queue_id = reader.read("!L")[0]
     return obj
示例#8
0
 def unpack(reader):
     obj = enqueue()
     _type = reader.read("!H")[0]
     assert(_type == 11)
     _len = reader.read("!H")[0]
     orig_reader = reader
     reader = orig_reader.slice(_len, 4)
     obj.port = util.unpack_port_no(reader)
     reader.skip(6)
     obj.queue_id = reader.read("!L")[0]
     return obj
示例#9
0
 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
示例#10
0
 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, 4)
     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.rate_limit = reader.read("!L")[0]
     obj.if_name = reader.read("!16s")[0].rstrip("\x00")
     return obj
示例#11
0
 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
示例#12
0
 def unpack(reader):
     obj = port_desc()
     obj.port_no = util.unpack_port_no(reader)
     obj.hw_addr = list(reader.read('!6B'))
     obj.name = reader.read("!16s")[0].rstrip("\x00")
     obj.config = reader.read("!L")[0]
     obj.state = reader.read("!L")[0]
     obj.curr = reader.read("!L")[0]
     obj.advertised = reader.read("!L")[0]
     obj.supported = reader.read("!L")[0]
     obj.peer = reader.read("!L")[0]
     return obj
示例#13
0
文件: common.py 项目: wuzhiwu/oftest
 def unpack(reader):
     obj = port_desc()
     obj.port_no = util.unpack_port_no(reader)
     obj.hw_addr = list(reader.read('!6B'))
     obj.name = reader.read("!16s")[0].rstrip("\x00")
     obj.config = reader.read("!L")[0]
     obj.state = reader.read("!L")[0]
     obj.curr = reader.read("!L")[0]
     obj.advertised = reader.read("!L")[0]
     obj.supported = reader.read("!L")[0]
     obj.peer = reader.read("!L")[0]
     return obj
示例#14
0
 def unpack(buf):
     obj = enqueue()
     if type(buf) == loxi.generic_util.OFReader:
         reader = buf
     else:
         reader = loxi.generic_util.OFReader(buf)
     _type = reader.read("!H")[0]
     assert(_type == 11)
     _len = reader.read("!H")[0]
     obj.port = util.unpack_port_no(reader)
     reader.skip(6)
     obj.queue_id = reader.read("!L")[0]
     return obj
示例#15
0
 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
示例#16
0
 def unpack(buf):
     obj = enqueue()
     if type(buf) == loxi.generic_util.OFReader:
         reader = buf
     else:
         reader = loxi.generic_util.OFReader(buf)
     _type = reader.read("!H")[0]
     assert (_type == 11)
     _len = reader.read("!H")[0]
     obj.port = util.unpack_port_no(reader)
     reader.skip(6)
     obj.queue_id = reader.read("!L")[0]
     return obj
示例#17
0
文件: common.py 项目: dtalayco/oftest
 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
示例#18
0
文件: common.py 项目: dtalayco/oftest
 def unpack(buf):
     obj = port_desc()
     if type(buf) == loxi.generic_util.OFReader:
         reader = buf
     else:
         reader = loxi.generic_util.OFReader(buf)
     obj.port_no = util.unpack_port_no(reader)
     obj.hw_addr = list(reader.read("!6B"))
     obj.name = reader.read("!16s")[0].rstrip("\x00")
     obj.config = reader.read("!L")[0]
     obj.state = reader.read("!L")[0]
     obj.curr = reader.read("!L")[0]
     obj.advertised = reader.read("!L")[0]
     obj.supported = reader.read("!L")[0]
     obj.peer = reader.read("!L")[0]
     return obj
示例#19
0
 def unpack(buf):
     obj = port_desc()
     if type(buf) == loxi.generic_util.OFReader:
         reader = buf
     else:
         reader = loxi.generic_util.OFReader(buf)
     obj.port_no = util.unpack_port_no(reader)
     obj.hw_addr = list(reader.read('!6B'))
     obj.name = reader.read("!16s")[0].rstrip("\x00")
     obj.config = reader.read("!L")[0]
     obj.state = reader.read("!L")[0]
     obj.curr = reader.read("!L")[0]
     obj.advertised = reader.read("!L")[0]
     obj.supported = reader.read("!L")[0]
     obj.peer = reader.read("!L")[0]
     return obj
示例#20
0
 def unpack(reader):
     obj = port_stats_entry()
     obj.port_no = util.unpack_port_no(reader)
     reader.skip(6)
     obj.rx_packets = reader.read("!Q")[0]
     obj.tx_packets = reader.read("!Q")[0]
     obj.rx_bytes = reader.read("!Q")[0]
     obj.tx_bytes = reader.read("!Q")[0]
     obj.rx_dropped = reader.read("!Q")[0]
     obj.tx_dropped = reader.read("!Q")[0]
     obj.rx_errors = reader.read("!Q")[0]
     obj.tx_errors = reader.read("!Q")[0]
     obj.rx_frame_err = reader.read("!Q")[0]
     obj.rx_over_err = reader.read("!Q")[0]
     obj.rx_crc_err = reader.read("!Q")[0]
     obj.collisions = reader.read("!Q")[0]
     return obj
示例#21
0
文件: common.py 项目: wuzhiwu/oftest
 def unpack(reader):
     obj = port_stats_entry()
     obj.port_no = util.unpack_port_no(reader)
     reader.skip(6)
     obj.rx_packets = reader.read("!Q")[0]
     obj.tx_packets = reader.read("!Q")[0]
     obj.rx_bytes = reader.read("!Q")[0]
     obj.tx_bytes = reader.read("!Q")[0]
     obj.rx_dropped = reader.read("!Q")[0]
     obj.tx_dropped = reader.read("!Q")[0]
     obj.rx_errors = reader.read("!Q")[0]
     obj.tx_errors = reader.read("!Q")[0]
     obj.rx_frame_err = reader.read("!Q")[0]
     obj.rx_over_err = reader.read("!Q")[0]
     obj.rx_crc_err = reader.read("!Q")[0]
     obj.collisions = reader.read("!Q")[0]
     return obj
示例#22
0
 def unpack(reader):
     obj = match_v1()
     obj.wildcards = util.unpack_wc_bmap(reader)
     obj.in_port = util.unpack_port_no(reader)
     obj.eth_src = list(reader.read('!6B'))
     obj.eth_dst = list(reader.read('!6B'))
     obj.vlan_vid = reader.read("!H")[0]
     obj.vlan_pcp = reader.read("!B")[0]
     reader.skip(1)
     obj.eth_type = reader.read("!H")[0]
     obj.ip_dscp = reader.read("!B")[0]
     obj.ip_proto = reader.read("!B")[0]
     reader.skip(2)
     obj.ipv4_src = reader.read("!L")[0]
     obj.ipv4_dst = reader.read("!L")[0]
     obj.tcp_src = reader.read("!H")[0]
     obj.tcp_dst = reader.read("!H")[0]
     return obj
示例#23
0
文件: common.py 项目: wuzhiwu/oftest
 def unpack(reader):
     obj = match_v1()
     obj.wildcards = util.unpack_wc_bmap(reader)
     obj.in_port = util.unpack_port_no(reader)
     obj.eth_src = list(reader.read('!6B'))
     obj.eth_dst = list(reader.read('!6B'))
     obj.vlan_vid = reader.read("!H")[0]
     obj.vlan_pcp = reader.read("!B")[0]
     reader.skip(1)
     obj.eth_type = reader.read("!H")[0]
     obj.ip_dscp = reader.read("!B")[0]
     obj.ip_proto = reader.read("!B")[0]
     reader.skip(2)
     obj.ipv4_src = reader.read("!L")[0]
     obj.ipv4_dst = reader.read("!L")[0]
     obj.tcp_src = reader.read("!H")[0]
     obj.tcp_dst = reader.read("!H")[0]
     return obj
示例#24
0
文件: common.py 项目: dtalayco/oftest
 def unpack(buf):
     obj = port_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(6)
     obj.rx_packets = reader.read("!Q")[0]
     obj.tx_packets = reader.read("!Q")[0]
     obj.rx_bytes = reader.read("!Q")[0]
     obj.tx_bytes = reader.read("!Q")[0]
     obj.rx_dropped = reader.read("!Q")[0]
     obj.tx_dropped = reader.read("!Q")[0]
     obj.rx_errors = reader.read("!Q")[0]
     obj.tx_errors = reader.read("!Q")[0]
     obj.rx_frame_err = reader.read("!Q")[0]
     obj.rx_over_err = reader.read("!Q")[0]
     obj.rx_crc_err = reader.read("!Q")[0]
     obj.collisions = reader.read("!Q")[0]
     return obj
示例#25
0
 def unpack(buf):
     obj = port_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(6)
     obj.rx_packets = reader.read("!Q")[0]
     obj.tx_packets = reader.read("!Q")[0]
     obj.rx_bytes = reader.read("!Q")[0]
     obj.tx_bytes = reader.read("!Q")[0]
     obj.rx_dropped = reader.read("!Q")[0]
     obj.tx_dropped = reader.read("!Q")[0]
     obj.rx_errors = reader.read("!Q")[0]
     obj.tx_errors = reader.read("!Q")[0]
     obj.rx_frame_err = reader.read("!Q")[0]
     obj.rx_over_err = reader.read("!Q")[0]
     obj.rx_crc_err = reader.read("!Q")[0]
     obj.collisions = reader.read("!Q")[0]
     return obj
示例#26
0
文件: common.py 项目: dtalayco/oftest
 def unpack(buf):
     obj = match_v1()
     if type(buf) == loxi.generic_util.OFReader:
         reader = buf
     else:
         reader = loxi.generic_util.OFReader(buf)
     obj.wildcards = util.unpack_wc_bmap(reader)
     obj.in_port = util.unpack_port_no(reader)
     obj.eth_src = list(reader.read("!6B"))
     obj.eth_dst = list(reader.read("!6B"))
     obj.vlan_vid = reader.read("!H")[0]
     obj.vlan_pcp = reader.read("!B")[0]
     reader.skip(1)
     obj.eth_type = reader.read("!H")[0]
     obj.ip_dscp = reader.read("!B")[0]
     obj.ip_proto = reader.read("!B")[0]
     reader.skip(2)
     obj.ipv4_src = reader.read("!L")[0]
     obj.ipv4_dst = reader.read("!L")[0]
     obj.tcp_src = reader.read("!H")[0]
     obj.tcp_dst = reader.read("!H")[0]
     return obj
示例#27
0
 def unpack(buf):
     obj = match_v1()
     if type(buf) == loxi.generic_util.OFReader:
         reader = buf
     else:
         reader = loxi.generic_util.OFReader(buf)
     obj.wildcards = util.unpack_wc_bmap(reader)
     obj.in_port = util.unpack_port_no(reader)
     obj.eth_src = list(reader.read('!6B'))
     obj.eth_dst = list(reader.read('!6B'))
     obj.vlan_vid = reader.read("!H")[0]
     obj.vlan_pcp = reader.read("!B")[0]
     reader.skip(1)
     obj.eth_type = reader.read("!H")[0]
     obj.ip_dscp = reader.read("!B")[0]
     obj.ip_proto = reader.read("!B")[0]
     reader.skip(2)
     obj.ipv4_src = reader.read("!L")[0]
     obj.ipv4_dst = reader.read("!L")[0]
     obj.tcp_src = reader.read("!H")[0]
     obj.tcp_dst = reader.read("!H")[0]
     return obj