#NEWLINE# def __setup_ifb( self ) : #NEWLINE# #INDENT# if ( self . direction != TrafficDirection . INCOMING ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if dataproperty . is_empty_string ( self . ifb_device ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# return_code = 0 #NEWLINE# command = 'modprobe ifb' #NEWLINE# return_code |= self . __subproc_wrapper . run ( command ) #NEWLINE# command = ( 'ip link add %s type ifb' % self . ifb_device ) #NEWLINE# return_code |= self . __subproc_wrapper . run ( command ) #NEWLINE# command = ( 'ip link set dev %s up' % self . ifb_device ) #NEWLINE# return_code |= self . __subproc_wrapper . run ( command ) #NEWLINE# command = ( 'tc qdisc add dev %s ingress' % self . __device ) #NEWLINE# return_code |= self . __subproc_wrapper . run ( command ) #NEWLINE# command_list = [ 'tc filter add' , ( 'dev ' + self . __device ) , 'parent ffff: protocol ip u32 match u32 0 0' , ( 'flowid %x:' % self . __get_device_qdisc_major_id ( ) ) , 'action mirred egress redirect' , ( 'dev ' + self . ifb_device ) ] #NEWLINE# return_code |= self . __subproc_wrapper . run ( ' ' . join ( command_list ) ) #NEWLINE# return return_code