mfontanini / libtins

High-level, multiplatform C++ network packet sniffing and crafting library.
http://libtins.github.io/
BSD 2-Clause "Simplified" License
1.91k stars 375 forks source link

How to get access to the interface Name/device in the sniff loop callback handler ?? #349

Closed chirayu-patel closed 5 years ago

chirayu-patel commented 5 years ago

Is there any way to get access to the interface Name/device name in the sniff loop callback handler ??

chirayu-patel commented 5 years ago

Can anyone update on this plz ??

mfontanini commented 5 years ago

Can't you just bind it in the callback? The interface is something you provide so you should be able to keep track of it.

chirayu-patel commented 5 years ago

Thanks !! That worked .. This is what I used :

string interface(interfaceName); namespace ph = std::placeholders; sniffer.sniff_loop(std::bind(dns_callback_handler,ph::_1,interface));