#NEWLINE# def __set_pre_network_filter( self , qdisc_major_id ) : #NEWLINE# #INDENT# if all ( [ dataproperty . is_empty_string ( self . network ) , ( not dataproperty . is_integer ( self . port ) ) ] ) : #NEWLINE# #INDENT# flowid = ( '%x:%d' % ( qdisc_major_id , self . __get_qdisc_minor_id ( ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# flowid = ( '%x:2' % qdisc_major_id ) #NEWLINE# #UNINDENT# command_list = [ 'tc filter add' , ( 'dev ' + self . __get_tc_device ( ) ) , 'protocol ip' , ( 'parent %x:' % command_list ) , ( 'prio 2 u32 match ip %s 0.0.0.0/0' % self . __get_network_direction_str ( ) ) , ( 'flowid ' + flowid ) ] #NEWLINE# return self . __subproc_wrapper . run ( ' ' . join ( command_list ) )