From: Christian Herdtweck Date: Thu, 26 Feb 2015 15:48:08 +0000 (+0100) Subject: added debug option enforcing dump of ICMP packets even if not broken X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=ec889dd16066cc55961d1504cd1c7cff61a35767;p=pingcheck added debug option enforcing dump of ICMP packets even if not broken --- diff --git a/src/icmp/icmppacketfactory.cpp b/src/icmp/icmppacketfactory.cpp index 78163ce..448e5c0 100644 --- a/src/icmp/icmppacketfactory.cpp +++ b/src/icmp/icmppacketfactory.cpp @@ -128,6 +128,7 @@ void dump_packet(const std::string &data) //----------------------------------------------------------------------------- bool dump_broken_packets = true; +bool dump_all_packets = false; /** * @brief Creates an ICMP packet from the input stream @c std::istream. @@ -166,7 +167,7 @@ IcmpPacketItem IcmpPacketFactory::create_icmp_packet( stringbuf data_backup; // read packet from stream, possibly copying data first - if (dump_broken_packets) + if (dump_broken_packets | dump_all_packets) { // read all data into backup ostream backup_filler(&data_backup); @@ -198,7 +199,7 @@ IcmpPacketItem IcmpPacketFactory::create_icmp_packet( } // dump data if had trouble with packet - if (dump_broken_packets && !icmp_packet) + if ( (dump_broken_packets && !icmp_packet) | dump_all_packets ) dump_packet(data_backup.str()); return icmp_packet;