mirror of
https://github.com/mfontanini/libtins
synced 2026-01-29 04:54:28 +01:00
Updated example.
This commit is contained in:
@@ -54,8 +54,12 @@ int main(int argc, char *argv[])
|
||||
std::cout << "Usage: " << *argv << " <interface>" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
// Sniff on the provided interface, maximum packet size 2000
|
||||
// in promiscuos mode and only udp packets sent to port 53
|
||||
Sniffer sniffer(argv[1], 2000, true, "udp and dst port 53");
|
||||
// Sniff on the provided interface in promiscuos mode
|
||||
Sniffer sniffer(argv[1], Sniffer::PROMISC);
|
||||
|
||||
// Only capture udp packets sent to port 53
|
||||
sniffer.set_filter("udp and dst port 53");
|
||||
|
||||
// Start the capture
|
||||
sniffer.sniff_loop(callback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user