made nicer static variables of packet dump mode and location
[pingcheck] / src / icmp / icmppacketfactory.h
index 3c481f7..384126b 100644 (file)
 
 void dump_packet(const std::string &data);
 
+enum DumpMode {
+    DUMP_NEVER = 0,
+    DUMP_IF_ERROR = 1,
+    DUMP_ALWAYS = 2
+};
+
 //-----------------------------------------------------------------------------
 // IcmpPacketFactory
 //-----------------------------------------------------------------------------
@@ -50,10 +56,14 @@ void dump_packet(const std::string &data);
 class IcmpPacketFactory
 {
 public:
+    /// directory and file name start used to dump packets;
+    /// will be concatenated with time and pattern that ensures unique file name
+    static std::string DumpFilePrefix;
+    static DumpMode PacketDumpMode;
+
     static IcmpPacketItem create_icmp_packet(
             const boost::asio::ip::icmp::socket::protocol_type &protocol,
-            std::istream &is,
-            int dump_mode=1
+            std::istream &is
     );
     static IcmpPacketItem create_icmp_packet_echo_request(
             const boost::asio::ip::icmp::socket::protocol_type &protocol,