Commit 948a10a0 authored by filatov's avatar filatov
Browse files

delay parameter in pcap_file

parent 37d478ad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ pcap_layer::pcap_layer(const std::string& p_type, const std::string& param) :
    *_bin2hex(buf, sizeof(buf), mac, 6) = 0;
    mac_src = buf;
    loggers::get_instance().user("pcap_layer::pcap_layer: local MAC is %s", mac_src.c_str());
    _params.[params::mac_src] = mac_src;
    _params[params::mac_src] = mac_src;
  }
  
  std::string mac_bc;
+8 −1
Original line number Diff line number Diff line
@@ -145,8 +145,15 @@ void* pcap_offline_layer::thread() {

  _running = TRUE;

  int delay = 1000;
  params::const_iterator it;
  it = _params.find(std::string("delay"));
  if(it != _params.cend()){
    delay = std::stoi(it->second);
  }

  // wait a bit before sending first packet
  std::this_thread::sleep_for(std::chrono::milliseconds(500));
  std::this_thread::sleep_for(std::chrono::milliseconds(delay));

  while (_running) { // Loop while _running flag is up
    // get next frame
+1 −1

File changed.

Contains only whitespace changes.