1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Fix example compilation on Windows.

Fixes #75.
This commit is contained in:
Matias Fontanini
2015-06-02 21:52:40 -07:00
parent 0f3441ccf6
commit 43217549eb
4 changed files with 41 additions and 22 deletions

View File

@@ -46,10 +46,9 @@ public:
: iface(interface), addr(address) { }
result_type trace() {
// ICMPs that aren't sent from us.
SnifferConfiguration config;
config.set_snap_len(500);
config.set_promisc_mode(false);
// ICMPs that aren't sent from us.
config.set_filter(
"ip proto \\icmp and not src host " + iface.addresses().ip_addr.to_string());
Sniffer sniffer(iface.name(), config);
@@ -65,10 +64,9 @@ public:
running = true;
// Start the sniff thread
std::thread sniff_thread(
&Sniffer::sniff_loop<decltype(handler)>,
&sniffer,
handler,
0
[&]() {
sniffer.sniff_loop(handler);
}
);
send_packets(sender);
sniff_thread.join();