Ejemplo n.º 1
0
 def c_ofp_flow_info_serialization(self, resp):
     wildcard = mul_nbapi.OFPFW_ALL & ~(mul_nbapi.OFPFW_NW_SRC_MASK) & ~(mul_nbapi.OFPFW_DL_TYPE)
     flow_id = self.flow_tbl.match(resp.datapath_id, resp.flow, wildcard, resp.oport, 0)
     return {'flow_id':flow_id, 'flow_info':{'dpid':'0x%lx' % resp.datapath_id, 
             'nw_src': mul_nbapi.nbapi_parse_nw_addr_to_str(resp.flow.nw_src),
             'nw_dst': mul_nbapi.nbapi_parse_nw_addr_to_str(resp.flow.nw_dst),
             'dl_src': mul_nbapi.nbapi_parse_mac_to_str(resp.flow.dl_src),
             'dl_dst': mul_nbapi.nbapi_parse_mac_to_str(resp.flow.dl_dst),
             'vlan': resp.flow.dl_vlan,
             'in_port': resp.flow.in_port,
             'out_port': resp.oport,
             'bps': mul_nbapi.nbapi_parse_bps_to_str(resp.bps),
             'pps': mul_nbapi.nbapi_parse_bps_to_str(resp.pps),
             'pkt_count': resp.packet_count,
             'byte_count': resp.byte_count}
             }
Ejemplo n.º 2
0
 def ofp_phy_port_serialization(self, resp):
     return {'port_no':resp.port_no, 'hw_addr':mul_nbapi.nbapi_parse_mac_to_str(resp.hw_addr), 
              'name':resp.name, 'config':resp.config, 'state':resp.state, 
              'curr':resp.curr, 'advertised':resp.advertised,
              'supported':resp.supported, 'peer':resp.peer} 
Ejemplo n.º 3
0
 def c_ofp_host_mod_serialization(self, resp):
     return {'dpid': resp.switch_id.datapath_id,
             'nw_src': mul_nbapi.nbapi_parse_nw_addr_to_str(resp.host_flow.nw_src),
             'dl_src': mul_nbapi.nbapi_parse_mac_to_str(resp.host_flow.dl_src),
             'in_port': resp.host_flow.in_port
             }