Back to index

natlog  0.91.0
run.cc
Go to the documentation of this file.
00001 #include "natfork.ih"
00002 
00003 void NatFork::run()
00004 {
00005     if (string(d_options[0]) == "conntrack")
00006         conntrackMode();
00007     else if (d_options.nArgs() == 2)
00008         d_mode = PCAP;
00009     else
00010     {
00011         d_stdMsg << "[Fatal] invalid argument(s): `";
00012         for (size_t idx = 0, end = d_options.nArgs(); idx != end; ++idx)
00013             d_stdMsg << d_options[idx] << (idx + 1 == end ? '\'' : ' ');
00014         d_stdMsg << endl;
00015 
00016         throw Options::FAILED;
00017     }
00018 
00019     if (d_options.daemon())
00020         fork();
00021     else
00022         childProcess();
00023 }