This commit is contained in:
Andrea Bontempi 2012-05-23 14:19:39 +02:00
commit a841b93b33
2 changed files with 3 additions and 2 deletions

View file

@ -53,6 +53,7 @@ int main(int argc, char **argv) {
if (cin.eof()) break;
packet* pkg = packet::factory(r_packet);
cout << "[" << std::dec << pkg->getEpoch() << " " << setfill('0') << std::setw(6) << pkg->getMillis() << "] Size: " << pkg->getPacketLength() << " byte" << endl;
cout << " From " << pkg->getSenderMac().to_string() << " to "<< pkg->getTargetMac().to_string() << endl;

View file

@ -135,12 +135,12 @@ int main(int argc, char **argv) {
if (pcap_compile(pcap_handle, &fp, filter.c_str(), 0, net) == -1)
{
cerr<< ">> Couldn't parse filter '"<<filter<<"': "<<pcap_geterr(pcap_handle)<<endl;
cerr<< "ERROR >> Couldn't parse filter '"<<filter<<"': "<<pcap_geterr(pcap_handle)<<endl;
return(2);
}
if (pcap_setfilter(pcap_handle, &fp) == -1) {
cerr<< ">> Couldn't install filter '"<<filter<<"': "<<pcap_geterr(pcap_handle)<<endl;
cerr<< "ERROR >> Couldn't install filter '"<<filter<<"': "<<pcap_geterr(pcap_handle)<<endl;
return(2);
}
}