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

Updated the examples to work with the new Sniffer constructor using the SnifferConfiguration object.

This commit is contained in:
Santiago Alessandri
2014-08-29 18:20:15 -07:00
parent 49f451ecd1
commit 039b41cb76
9 changed files with 38 additions and 17 deletions

View File

@@ -47,10 +47,12 @@ public:
result_type trace() {
// ICMPs that aren't sent from us.
Sniffer sniffer(
iface.name(), 500, false,
"ip proto \\icmp and not src host " + iface.addresses().ip_addr.to_string()
);
SnifferConfiguration config;
config.set_snap_len(500);
config.set_promisc_mode(false);
config.set_filter(
"ip proto \\icmp and not src host " + iface.addresses().ip_addr.to_string());
Sniffer sniffer(iface.name(), config);
PacketSender sender;
// Create our handler