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

Modified some examples fixed some doxygen documentation.

This commit is contained in:
Matias Fontanini
2013-10-06 23:00:20 -03:00
parent 58e2c93e30
commit 01b2a9c7b2
17 changed files with 74 additions and 83 deletions

View File

@@ -54,7 +54,11 @@ public:
PacketSender sender;
// Create our handler
auto handler = make_sniffer_handler(this, &Traceroute::sniff_callback);
auto handler = std::bind(
&Traceroute::sniff_callback,
this,
std::placeholders::_1
);
// We're running
running = true;
// Start the sniff thread
@@ -98,10 +102,10 @@ private:
}
bool sniff_callback(PDU &pdu) {
IP &ip = pdu.rfind_pdu<IP>();
const IP &ip = pdu.rfind_pdu<IP>();
ttl_map::const_iterator iter;
// Fetch the IP PDU attached to the ICMP response
IP inner_ip = pdu.rfind_pdu<RawPDU>().to<IP>();
const IP inner_ip = pdu.rfind_pdu<RawPDU>().to<IP>();
// Critical section
{
std::lock_guard<std::mutex> _(lock);