#NEWLINE# def set_routing_flow( self , cookie , priority , outport , dl_vlan = 0 , nw_src = 0 , src_mask = 32 , nw_dst = 0 , dst_mask = 32 , src_mac = 0 , dst_mac = 0 , idle_timeout = 0 , dec_ttl = False ) : #NEWLINE# #INDENT# ofp = self . dp . ofproto #NEWLINE# ofp_parser = self . dp . ofproto_parser #NEWLINE# dl_type = ether . ETH_TYPE_IP #NEWLINE# actions = [ ] #NEWLINE# if outport : #NEWLINE# #INDENT# actions . append ( ofp_parser . OFPActionDecNwTtl ( ) ) #NEWLINE# #UNINDENT# if src_mac : #NEWLINE# #INDENT# actions . append ( ofp_parser . OFPActionSetField ( eth_src = src_mac ) ) #NEWLINE# #UNINDENT# if dst_mac : #NEWLINE# #INDENT# actions . append ( ofp_parser . OFPActionSetField ( eth_dst = dst_mac ) ) #NEWLINE# #UNINDENT# if ( outport is not None ) : #NEWLINE# #INDENT# actions . append ( ofp_parser . OFPActionOutput ( outport , 0 ) ) #NEWLINE# #UNINDENT# self . set_flow ( cookie , priority , dl_type = dl_type , dl_vlan = dl_vlan , nw_src = nw_src , src_mask = src_mask , nw_dst = nw_dst , dst_mask = dst_mask , idle_timeout = idle_timeout , actions = actions )