parameters: (self, target_ip)
docstring: Starts a network emulation by setting up Dummynet rules.
  
      Args:
          target_ip: The IP address of the interface that shall be that have the
              network constraints applied to it.
docstring_summary: Starts a network emulation by setting up Dummynet rules.
docstring_tokens: Starts a network emulation by setting up Dummynet rules .
function: def emulate(self, target_ip):
      """Starts a network emulation by setting up Dummynet rules.
  
      Args:
          target_ip: The IP address of the interface that shall be that have the
              network constraints applied to it.
      """
      receive_pipe_id = self._create_dummynet_pipe(
          self._connection_config.receive_bw_kbps,
          self._connection_config.delay_ms,
          self._connection_config.packet_loss_percent,
          self._connection_config.queue_slots)
      logging.debug('Created receive pipe: %s', receive_pipe_id)
      send_pipe_id = self._create_dummynet_pipe(
          self._connection_config.send_bw_kbps,
          self._connection_config.delay_ms,
          self._connection_config.packet_loss_percent,
          self._connection_config.queue_slots)
      logging.debug('Created send pipe: %s', send_pipe_id)
  
      # Adding the rules will start the emulation.
      incoming_rule_id = self._create_dummynet_rule(receive_pipe_id, 'any',
                                                    target_ip, self._port_range)
      logging.debug('Created incoming rule: %s', incoming_rule_id)
      outgoing_rule_id = self._create_dummynet_rule(send_pipe_id, target_ip,
                                                    'any', self._port_range)
      logging.debug('Created outgoing rule: %s', outgoing_rule_id)
function_tokens: def emulate ( self , target_ip ) : receive_pipe_id = self . _create_dummynet_pipe ( self . _connection_config . receive_bw_kbps , self . _connection_config . delay_ms , self . _connection_config . packet_loss_percent , self . _connection_config . queue_slots ) logging . debug ( 'Created receive pipe: %s' , receive_pipe_id ) send_pipe_id = self . _create_dummynet_pipe ( self . _connection_config . send_bw_kbps , self . _connection_config . delay_ms , self . _connection_config . packet_loss_percent , self . _connection_config . queue_slots ) logging . debug ( 'Created send pipe: %s' , send_pipe_id ) # Adding the rules will start the emulation. incoming_rule_id = self . _create_dummynet_rule ( receive_pipe_id , 'any' , target_ip , self . _port_range ) logging . debug ( 'Created incoming rule: %s' , incoming_rule_id ) outgoing_rule_id = self . _create_dummynet_rule ( send_pipe_id , target_ip , 'any' , self . _port_range ) logging . debug ( 'Created outgoing rule: %s' , outgoing_rule_id )