Back to index

natlog  0.91.0
run.cc
Go to the documentation of this file.
00001 #include "devices.ih"
00002 
00003 void Devices::run(ostream &parent)
00004 {
00005     PcapFilter in(d_options[0], d_record, PcapRecord::IN);
00006     PcapFilter out(d_options[1], d_record, PcapRecord::OUT);
00007 
00008     parent << 0 << endl;                    // all OK
00009 
00010     Signal::instance().add(SIGTERM, in);
00011     Signal::instance().add(SIGTERM, out);
00012 
00013     d_stdMsg << "starting: capturing " << d_options[0] << 
00014                               " and " << d_options[1] << endl;
00015 
00016     thread inThread(in);
00017     thread outThread(out);
00018 
00019     inThread.join();
00020     outThread.join();
00021 }
00022 
00023 
00024 
00025 
00026