Rev

Rev 3322 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | Bug Tracker

Rev 3322 Rev 3333
Line 142... Line 142...
142
  loggers::get_instance().log(">>> pcap_offline_layer::run");
142
  loggers::get_instance().log(">>> pcap_offline_layer::run");
143
143
144
  memset(&lh, 0, sizeof(lh));
144
  memset(&lh, 0, sizeof(lh));
145
145
146
  _running = TRUE;
146
  _running = TRUE;
-
 
147
-
 
148
  int delay = 1000;
-
 
149
  params::const_iterator it;
-
 
150
  it = _params.find(std::string("delay"));
-
 
151
  if(it != _params.cend()){
-
 
152
    delay = std::stoi(it->second);
-
 
153
  }
147
154
148
  // wait a bit before sending first packet
155
  // wait a bit before sending first packet
149
  std::this_thread::sleep_for(std::chrono::milliseconds(500));
156
  std::this_thread::sleep_for(std::chrono::milliseconds(delay));
150
157
151
  while (_running) { // Loop while _running flag is up
158
  while (_running) { // Loop while _running flag is up
152
    // get next frame
159
    // get next frame
153
    int result = pcap_next_ex(_device, (struct pcap_pkthdr**)&pkt_header, &pkt_data);
160
    int result = pcap_next_ex(_device, (struct pcap_pkthdr**)&pkt_header, &pkt_data);
154
    if(result == 2){
161
    if(result == 2){