From 2cf61403e186cda93c48ffb4310ff46eddb8dd20 Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Tue, 25 Aug 2015 20:15:04 -0700 Subject: [PATCH] Update docs on sniff_loop handle persistency [ci skip] --- include/tins/sniffer.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/tins/sniffer.h b/include/tins/sniffer.h index 47221f8..8de0831 100644 --- a/include/tins/sniffer.h +++ b/include/tins/sniffer.h @@ -156,6 +156,13 @@ namespace Tins { * Sniffing will stop when either max_packets are sniffed(if it is != 0), * or when the functor returns false. * + * Note that the pcap handle stored in a BaseSniffer will always be the + * same. This means that if you start sniffing using sniff_loop, then stop + * and at some point in the future you call sniff_loop again, you will keep + * iterating over the same handle. If the handle points to a pcap file, then + * you will continue processing packets from it. If the handle points to + * a network device, you will keep sniffing from it. + * * This method catches both malformed_packet and pdu_not_found exceptions, * which allows writing much cleaner code, since you can call PDU::rfind_pdu * without worrying about catching the exception that can be thrown. This