예제 #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
파일: common.py 프로젝트: xiaolanxia/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, 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
파일: action.py 프로젝트: ducwindow/oftest
 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
파일: action.py 프로젝트: ducwindow/oftest
 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