Ejemplo n.º 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
Ejemplo n.º 2
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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 6
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 - (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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 13
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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 17
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
Ejemplo n.º 18
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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 21
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
Ejemplo n.º 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
Ejemplo n.º 23
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
Ejemplo n.º 24
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
Ejemplo n.º 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
Ejemplo n.º 26
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
Ejemplo n.º 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