#NEWLINE# def __get_filter( self , device ) : #NEWLINE# #INDENT# qdisc_parser = tcconfig . parser . TcQdiscParser ( ) #NEWLINE# filter_parser = tcconfig . parser . TcFilterParser ( ) #NEWLINE# command = ( 'tc qdisc show dev %s' % device ) #NEWLINE# proc = self . __subproc_wrapper . popen_command ( command ) #NEWLINE# ( qdisc_stdout , _stderr ) = proc . communicate ( ) #NEWLINE# qdisc_param = qdisc_parser . parse ( qdisc_stdout ) #NEWLINE# command = ( 'tc filter show dev %s' % device ) #NEWLINE# proc = self . __subproc_wrapper . popen_command ( command ) #NEWLINE# ( filter_stdout , _stderr ) = proc . communicate ( ) #NEWLINE# filter_table = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for filter_param in filter_parser . parse_filter ( filter_stdout ) : #NEWLINE# #INDENT# key_item_list = [ ] #NEWLINE# if dataproperty . is_not_empty_string ( filter_param . get ( 'network' ) ) : #NEWLINE# #INDENT# key_item_list . append ( ( 'network=' + filter_param . get ( 'network' ) ) ) #NEWLINE# #UNINDENT# if dataproperty . is_integer ( filter_param . get ( 'port' ) ) : #NEWLINE# #INDENT# key_item_list . append ( ( 'port=%d' % filter_param . get ( 'port' ) ) ) #NEWLINE# #UNINDENT# filter_key = ', ' . join ( key_item_list ) #NEWLINE# filter_table [ filter_key ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( filter_param . get ( 'flowid' ) == qdisc_param . get ( 'parent' ) ) : #NEWLINE# #INDENT# work_qdisc_param = dict ( qdisc_param ) #NEWLINE# del work_qdisc_param [ 'parent' ] #NEWLINE# filter_table [ filter_key ] = work_qdisc_param #NEWLINE# #UNINDENT# #UNINDENT# return filter_table