return ret;
}
-
PcapPacketWriter::PcapPacketWriter(const string& fname, PcapPacketReader& ppr) : d_fname(fname), d_ppr(ppr)
{
d_fp=fopen(fname.c_str(),"w");
if(!d_fp)
unixDie("Unable to open file");
-
int flags=fcntl(fileno(d_fp),F_GETFL,0);
fcntl(fileno(d_fp), F_SETFL,flags&(~O_NONBLOCK)); // bsd needs this in stdin (??)
fwrite(&ppr.d_pfh, 1, sizeof(ppr.d_pfh), d_fp);
-
}
void PcapPacketWriter::write()
cout<<i->first<<"\t"<<i->second<<endl;
uint32_t sum=0;
- ofstream stats("stats");
+ // ofstream stats("stats");
uint32_t totpackets=0;
double tottime=0;
for(cumul_t::const_iterator i=cumul.begin(); i!=cumul.end(); ++i) {
- stats<<i->first<<"\t"<<(sum+=i->second)<<"\n";
+ // stats<<i->first<<"\t"<<(sum+=i->second)<<"\n";
totpackets+=i->second;
tottime+=i->first*i->second;
}