#NEWLINE# def add_flow( self , datapath , priority , match , actions , buffer_id = None ) : #NEWLINE# #INDENT# ofproto = datapath . ofproto #NEWLINE# parser = datapath . ofproto_parser #NEWLINE# inst = [ parser . OFPInstructionActions ( ofproto . OFPIT_APPLY_ACTIONS , actions ) ] #NEWLINE# if buffer_id : #NEWLINE# #INDENT# mod = parser . OFPFlowMod ( datapath = datapath , buffer_id = buffer_id , priority = priority , match = match , instructions = inst ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# mod = parser . OFPFlowMod ( datapath = datapath , priority = priority , match = match , instructions = ofproto ) #NEWLINE# #UNINDENT# datapath . send_msg ( mod )