_ZN4pcpp6Logger11getInstanceEv:
  367|  1.15k|		{
  368|  1.15k|			static Logger instance;
  369|  1.15k|			return instance;
  370|  1.15k|		}
_ZN4pcpp6Logger12suppressLogsEv:
  319|    359|		{
  320|    359|			m_LogsEnabled = false;
  321|    359|		}
_ZN4pcpp9LogSourceC2ENS_9LogModuleEPKcS3_i:
  137|    359|		    : file(file), function(function), line(line), logModule(logModule)
  138|    359|		{}
_ZN4pcpp8internal10LogContext4initENS_8LogLevelERKNS_9LogSourceE:
  187|    359|			{
  188|    359|				m_Source = source;
  189|    359|				m_Level = level;
  190|    359|				m_Stream.clear();
  191|    359|				m_Stream.str({});
  192|    359|			}
_ZNK4pcpp6Logger9shouldLogENS_8LogLevelENS_9LogModuleE:
  287|    795|		{
  288|    795|			return level != LogLevel::Off && m_LogModulesArray[module] >= level;
  ------------------
  |  Branch (288:11): [True: 795, False: 0]
  |  Branch (288:37): [True: 359, False: 436]
  ------------------
  289|    795|		}
_ZN4pcpp8internal10LogContextlsINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEERS1_RKT_:
  198|    195|			{
  199|    195|				m_Stream << value;
  200|    195|				return *this;
  201|    195|			}
_ZN4pcpp8internal10LogContextlsIA2_cEERS1_RKT_:
  198|    195|			{
  199|    195|				m_Stream << value;
  200|    195|				return *this;
  201|    195|			}
_ZN4pcpp8internal10LogContextlsIjEERS1_RKT_:
  198|     48|			{
  199|     48|				m_Stream << value;
  200|     48|				return *this;
  201|     48|			}
_ZN4pcpp8internal10LogContextlsIA31_cEERS1_RKT_:
  198|    113|			{
  199|    113|				m_Stream << value;
  200|    113|				return *this;
  201|    113|			}
_ZN4pcpp8internal10LogContextlsIA27_cEERS1_RKT_:
  198|      3|			{
  199|      3|				m_Stream << value;
  200|      3|				return *this;
  201|      3|			}
_ZN4pcpp8internal10LogContextlsIA33_cEERS1_RKT_:
  198|     46|			{
  199|     46|				m_Stream << value;
  200|     46|				return *this;
  201|     46|			}
_ZN4pcpp8internal10LogContextlsIA36_cEERS1_RKT_:
  198|      2|			{
  199|      2|				m_Stream << value;
  200|      2|				return *this;
  201|      2|			}
_ZN4pcpp8internal10LogContextlsIA34_cEERS1_RKT_:
  198|    147|			{
  199|    147|				m_Stream << value;
  200|    147|				return *this;
  201|    147|			}
_ZN4pcpp8internal10LogContextlsIA15_cEERS1_RKT_:
  198|     48|			{
  199|     48|				m_Stream << value;
  200|     48|				return *this;
  201|     48|			}
_ZN4pcpp8internal10LogContextlsIA14_cEERS1_RKT_:
  198|     48|			{
  199|     48|				m_Stream << value;
  200|     48|				return *this;
  201|     48|			}
_ZN4pcpp9LogSourceC2Ev:
  124|      2|		constexpr LogSource() = default;
_ZN4pcpp8internal10LogContextC2Ev:
  175|      2|			LogContext() = default;

_ZN4pcpp10MacAddressC2Ehhhhhh:
   73|      4|		    : m_Address{ firstOctet, secondOctet, thirdOctet, fourthOctet, fifthOctet, sixthOctet }
   74|      4|		{}

_ZN4pcpp8internal17DynamicObjectPoolINS0_10LogContextELb1EED2Ev:
   57|      1|			{
   58|      1|				clear();
   59|      1|			}
_ZN4pcpp8internal17DynamicObjectPoolINS0_10LogContextELb1EE5clearEv:
  175|      1|			{
  176|      1|				std::unique_lock<std::mutex> lock(m_Mutex);
  177|      3|				while (!m_Pool.empty())
  ------------------
  |  Branch (177:12): [True: 2, False: 1]
  ------------------
  178|      2|				{
  179|      2|					delete m_Pool.top();
  180|      2|					m_Pool.pop();
  181|      2|				}
  182|      1|			}
_ZN4pcpp8internal17DynamicObjectPoolINS0_10LogContextELb1EE11preallocateEm:
  158|      1|			{
  159|      1|				std::unique_lock<std::mutex> lock(m_Mutex);
  160|       |
  161|      1|				if (m_MaxPoolSize < count)
  ------------------
  |  Branch (161:9): [True: 0, False: 1]
  ------------------
  162|      0|				{
  163|      0|					throw std::invalid_argument("Preallocated objects cannot exceed the maximum pool size");
  164|      0|				}
  165|       |
  166|       |				// If the pool is already larger than the requested count, we don't need to do anything.
  167|      3|				for (std::size_t i = m_Pool.size(); i < count; i++)
  ------------------
  |  Branch (167:41): [True: 2, False: 1]
  ------------------
  168|      2|				{
  169|      2|					m_Pool.push(new T());
  170|      2|				}
  171|      1|			}
_ZN4pcpp8internal17DynamicObjectPoolINS0_10LogContextELb1EEC2Emm:
   36|      1|			    : m_MaxPoolSize(maxPoolSize)
   37|      1|			{
   38|      1|				if (initialSize > maxPoolSize)
  ------------------
  |  Branch (38:9): [True: 0, False: 1]
  ------------------
   39|      0|				{
   40|      0|					throw std::invalid_argument("Preallocated objects cannot exceed the maximum pool size");
   41|      0|				}
   42|       |
   43|      1|				if (initialSize > 0)
  ------------------
  |  Branch (43:9): [True: 1, False: 0]
  ------------------
   44|      1|				{
   45|      1|					this->preallocate(initialSize);
   46|      1|				}
   47|      1|			}
_ZN4pcpp8internal17DynamicObjectPoolINS0_10LogContextELb1EE13acquireObjectEv:
   68|    359|			{
   69|    359|				return std::unique_ptr<T>(acquireObjectRaw());
   70|    359|			}
_ZN4pcpp8internal17DynamicObjectPoolINS0_10LogContextELb1EE16acquireObjectRawEv:
   79|    359|			{
   80|    359|				std::unique_lock<std::mutex> lock(m_Mutex);
   81|       |
   82|    359|				if (m_Pool.empty())
  ------------------
  |  Branch (82:9): [True: 0, False: 359]
  ------------------
   83|      0|				{
   84|       |					// We don't need the lock anymore, so release it.
   85|      0|					lock.unlock();
   86|      0|					return new T();
   87|      0|				}
   88|       |
   89|    359|				T* obj = m_Pool.top();
   90|    359|				m_Pool.pop();
   91|    359|				return obj;
   92|    359|			}
_ZN4pcpp8internal17DynamicObjectPoolINS0_10LogContextELb1EE13releaseObjectENSt3__110unique_ptrIS2_NS4_14default_deleteIS2_EEEE:
  101|    359|			{
  102|    359|				releaseObjectRaw(obj.release());
  103|    359|			}
_ZN4pcpp8internal17DynamicObjectPoolINS0_10LogContextELb1EE16releaseObjectRawEPS2_:
  112|    359|			{
  113|    359|				std::unique_lock<std::mutex> lock(m_Mutex);
  114|       |
  115|    359|				if (m_MaxPoolSize == INFINITE_POOL_SIZE || m_Pool.size() < m_MaxPoolSize)
  ------------------
  |  Branch (115:9): [True: 0, False: 359]
  |  Branch (115:48): [True: 359, False: 0]
  ------------------
  116|    359|				{
  117|    359|					m_Pool.push(obj);
  118|    359|				}
  119|      0|				else
  120|      0|				{
  121|       |					// We don't need the lock anymore, so release it.
  122|      0|					lock.unlock();
  123|      0|					delete obj;
  124|      0|				}
  125|    359|			}

_ZN4pcpp13PointerVectorINS_9RawPacketENSt3__114default_deleteIS1_EEEC2Ev:
   59|    164|		PointerVector() = default;
_ZN4pcpp13PointerVectorINS_9RawPacketENSt3__114default_deleteIS1_EEED2Ev:
   78|    164|		{
   79|    164|			freeVectorUnsafe(m_Vector);
   80|    164|		}
_ZN4pcpp13PointerVectorINS_9RawPacketENSt3__114default_deleteIS1_EEE16freeVectorUnsafeERKNS2_6vectorIPS1_NS2_9allocatorIS7_EEEE:
  362|    164|		{
  363|    164|			for (auto& obj : origin)
  ------------------
  |  Branch (363:19): [True: 108, False: 164]
  ------------------
  364|    108|			{
  365|    108|				Deleter{}(obj);
  366|    108|			}
  367|    164|		}
_ZNK4pcpp13PointerVectorINS_9RawPacketENSt3__114default_deleteIS1_EEE5frontEv:
  238|    108|		{
  239|    108|			return m_Vector.front();
  240|    108|		}
_ZN4pcpp13PointerVectorINS_9RawPacketENSt3__114default_deleteIS1_EEE8pushBackEPS1_b:
  147|    108|		{
  148|    108|			if (element == nullptr)
  ------------------
  |  Branch (148:8): [True: 0, False: 108]
  ------------------
  149|      0|			{
  150|      0|				throw std::invalid_argument("Element is nullptr");
  151|      0|			}
  152|       |
  153|    108|			try
  154|    108|			{
  155|    108|				m_Vector.push_back(element);
  156|    108|			}
  157|    108|			catch (const std::exception&)
  158|    108|			{
  159|      0|				if (freeElementOnError)
  ------------------
  |  Branch (159:9): [True: 0, False: 0]
  ------------------
  160|      0|				{
  161|      0|					Deleter{}(element);
  162|      0|				}
  163|      0|				throw;
  164|      0|			}
  165|    108|		}

_ZN4pcpp11IPv4AddressC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   64|      4|	{
   65|      4|		if (inet_pton(AF_INET, addrAsString.data(), m_Bytes.data()) <= 0)
  ------------------
  |  Branch (65:7): [True: 0, False: 4]
  ------------------
   66|      0|		{
   67|      0|			throw std::invalid_argument("Not a valid IPv4 address: " + addrAsString);
   68|      0|		}
   69|      4|	}
_ZN4pcpp11IPv6AddressC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  133|      2|	{
  134|      2|		if (inet_pton(AF_INET6, addrAsString.data(), m_Bytes.data()) <= 0)
  ------------------
  |  Branch (134:7): [True: 0, False: 2]
  ------------------
  135|      0|		{
  136|      0|			throw std::invalid_argument("Not a valid IPv6 address: " + addrAsString);
  137|      0|		}
  138|      2|	}

_ZN4pcpp6LoggerC2Ev:
   55|      1|	Logger::Logger() : m_LogsEnabled(true), m_LogPrinter(&printToCerr)
   56|      1|	{
   57|      1|		m_LogModulesArray.fill(LogLevel::Info);
   58|      1|	}
_ZN4pcpp6Logger16createLogContextENS_8LogLevelERKNS_9LogSourceE:
   89|    359|	{
   90|    359|		if (m_UseContextPooling)
  ------------------
  |  Branch (90:7): [True: 359, False: 0]
  ------------------
   91|    359|		{
   92|    359|			auto ctx = m_LogContextPool.acquireObject();
   93|    359|			ctx->init(level, source);
   94|    359|			return ctx;
   95|    359|		}
   96|      0|		return std::make_unique<internal::LogContext>(level, source);
   97|    359|	}
_ZN4pcpp6Logger4emitENSt3__110unique_ptrINS_8internal10LogContextENS1_14default_deleteIS4_EEEE:
  100|    359|	{
  101|    359|		emit(message->m_Source, message->m_Level, message->m_Stream.str());
  102|       |		// Pushes the message back to the pool if pooling is enabled. Otherwise, the message is deleted.
  103|    359|		if (m_UseContextPooling)
  ------------------
  |  Branch (103:7): [True: 359, False: 0]
  ------------------
  104|    359|		{
  105|    359|			m_LogContextPool.releaseObject(std::move(message));
  106|    359|		}
  107|    359|	}
_ZN4pcpp6Logger4emitERKNS_9LogSourceENS_8LogLevelERKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE:
  110|    359|	{
  111|       |		// If the log level is an error, save the error to the last error message variable.
  112|    359|		if (logLevel == LogLevel::Error)
  ------------------
  |  Branch (112:7): [True: 359, False: 0]
  ------------------
  113|    359|		{
  114|    359|			static_assert(m_LastError.size() >= 1,
  115|    359|			              "Last error buffer size must be at least 1 to hold a null terminator");
  116|       |
  117|       |			// Copy the message to the last error buffer, leaving space for null terminator
  118|    359|			auto const copied = message.copy(m_LastError.data(), m_LastError.size() - 1);
  119|    359|			m_LastError[copied] = '\0';
  120|    359|		}
  121|    359|		if (m_LogsEnabled)
  ------------------
  |  Branch (121:7): [True: 0, False: 359]
  ------------------
  122|      0|		{
  123|      0|			m_LogPrinter(logLevel, message, source.file, source.function, source.line);
  124|      0|		}
  125|    359|	}

_ZN4pcpp9RawPacketC2Ev:
  312|    164|		RawPacket() = default;

_ZN4pcpp9RawPacketD2Ev:
   22|    164|	{
   23|    164|		clear();
   24|    164|	}
_ZN4pcpp9RawPacket10setRawDataEPKhib8timespecNS_13LinkLayerTypeEi:
   97|  1.22k|	{
   98|  1.22k|		return doSetRawData(pRawData, rawDataLen, takeOwnership, timestamp, layerType, frameLength);
   99|  1.22k|	}
_ZN4pcpp9RawPacket12doSetRawDataEPKhib8timespecNS_13LinkLayerTypeEi:
  103|  1.22k|	{
  104|  1.22k|		clear();
  105|       |
  106|  1.22k|		m_OwnsRawData = takeOwnership;
  107|  1.22k|		m_FrameLength = (frameLength == -1) ? rawDataLen : frameLength;
  ------------------
  |  Branch (107:19): [True: 234, False: 995]
  ------------------
  108|  1.22k|		m_RawData = (uint8_t*)pRawData;
  109|  1.22k|		m_RawDataLen = rawDataLen;
  110|  1.22k|		m_TimeStamp = timestamp;
  111|  1.22k|		m_RawPacketSet = true;
  112|  1.22k|		m_LinkLayerType = layerType;
  113|  1.22k|		return true;
  114|  1.22k|	}
_ZN4pcpp9RawPacket5clearEv:
  123|  1.39k|	{
  124|  1.39k|		if (m_RawData != nullptr && m_OwnsRawData)
  ------------------
  |  Branch (124:7): [True: 401, False: 992]
  |  Branch (124:31): [True: 401, False: 0]
  ------------------
  125|    401|			delete[] m_RawData;
  126|       |
  127|  1.39k|		m_RawData = nullptr;
  128|  1.39k|		m_RawDataLen = 0;
  129|  1.39k|		m_FrameLength = 0;
  130|  1.39k|		m_RawPacketSet = false;
  131|  1.39k|	}

_ZN4pcpp17IFilterableDeviceC2Ev:
   47|    359|		IFilterableDevice() = default;
_ZN4pcpp7IDeviceC2Ev:
   23|    359|		IDevice() = default;
_ZN4pcpp7IDeviceD2Ev:
   26|    359|		virtual ~IDevice() = default;

_ZN4pcpp23IPcapStatisticsProviderD2Ev:
   27|    359|		virtual ~IPcapStatisticsProvider() = default;

_ZN4pcpp11IFileDevice21reportPacketProcessedEm:
   66|  1.22k|		{
   67|  1.22k|			m_NumOfPacketsProcessed += numPackets;
   68|  1.22k|		}
_ZN4pcpp21SnoopFileReaderDeviceC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  567|    359|		    : IFileReaderDevice(fileName), m_PcapLinkLayerType(LINKTYPE_ETHERNET)
  568|    359|		{}
_ZNK4pcpp21SnoopFileReaderDevice8isOpenedEv:
  597|  1.39k|		{
  598|  1.39k|			return m_SnoopFile.is_open();
  599|  1.39k|		}

_ZN4pcpp16BpfFilterWrapperC2Ev:
   92|    359|		BpfFilterWrapper() = default;

_ZN4pcpp11IFileDeviceC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  219|    359|	{
  220|    359|		m_FileName = fileName;
  221|    359|	}
_ZNK4pcpp11IFileDevice13getStatisticsERNS_9PcapStatsE:
  229|    164|	{
  230|    164|		PCPP_LOG_DEBUG("Statistics requested for file device for filename '" << m_FileName << "'");
  ------------------
  |  |  425|    164|#	define PCPP_LOG_DEBUG(message) PCPP_LOG(pcpp::LogLevel::Debug, message)
  |  |  ------------------
  |  |  |  |  412|    164|	do                                                                                                                 \
  |  |  |  |  413|    164|	{                                                                                                                  \
  |  |  |  |  414|    164|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|    164|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|    164|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 0, False: 164]
  |  |  |  |  ------------------
  |  |  |  |  416|    164|		{                                                                                                              \
  |  |  |  |  417|      0|			auto ctx =                                                                                                 \
  |  |  |  |  418|      0|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|      0|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|      0|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|      0|		}                                                                                                              \
  |  |  |  |  422|    164|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 164]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|    164|		stats.packetsRecv = m_NumOfPacketsProcessed;
  232|    164|		stats.packetsDrop = m_NumOfPacketsDropped;
  233|    164|		stats.packetsDropByInterface = 0;
  234|    164|	}
_ZN4pcpp11IFileDevice22resetStatisticCountersEv:
  237|    359|	{
  238|    359|		m_NumOfPacketsProcessed = 0;
  239|    359|		m_NumOfPacketsDropped = 0;
  240|    359|	}
_ZN4pcpp17IFileReaderDeviceC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  256|    359|	IFileReaderDevice::IFileReaderDevice(const std::string& fileName) : IFileDevice(fileName)
  257|    359|	{}
_ZN4pcpp17IFileReaderDevice9getReaderERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  260|    359|	{
  261|    359|		const auto extensionPos = fileName.find_last_of('.');
  262|    359|		const auto fileExtension = extensionPos != std::string::npos ? fileName.substr(extensionPos) : "";
  ------------------
  |  Branch (262:30): [True: 359, False: 0]
  ------------------
  263|       |
  264|    359|		if (fileExtension == ".pcapng" || fileExtension == ".zstd" || fileExtension == ".zst")
  ------------------
  |  Branch (264:7): [True: 0, False: 359]
  |  Branch (264:37): [True: 0, False: 359]
  |  Branch (264:65): [True: 0, False: 359]
  ------------------
  265|      0|			return new PcapNgFileReaderDevice(fileName);
  266|    359|		else if (fileExtension == ".snoop")
  ------------------
  |  Branch (266:12): [True: 359, False: 0]
  ------------------
  267|    359|			return new SnoopFileReaderDevice(fileName);
  268|       |
  269|      0|		return new PcapFileReaderDevice(fileName);
  270|    359|	}
_ZN4pcpp17IFileReaderDevice14getNextPacketsERNS_13PointerVectorINS_9RawPacketENSt3__114default_deleteIS2_EEEEi:
  279|    164|	{
  280|    164|		int numOfPacketsRead = 0;
  281|       |
  282|    272|		for (; numOfPacketsToRead < 0 || numOfPacketsRead < numOfPacketsToRead; numOfPacketsRead++)
  ------------------
  |  Branch (282:10): [True: 0, False: 272]
  |  Branch (282:36): [True: 164, False: 108]
  ------------------
  283|    164|		{
  284|    164|			RawPacket* newPacket = new RawPacket();
  285|    164|			bool packetRead = getNextPacket(*newPacket);
  286|    164|			if (packetRead)
  ------------------
  |  Branch (286:8): [True: 108, False: 56]
  ------------------
  287|    108|			{
  288|    108|				packetVec.pushBack(newPacket);
  289|    108|			}
  290|     56|			else
  291|     56|			{
  292|     56|				delete newPacket;
  293|     56|				break;
  294|     56|			}
  295|    164|		}
  296|       |
  297|    164|		return numOfPacketsRead;
  298|    164|	}
_ZN4pcpp21SnoopFileReaderDeviceD2Ev:
 1191|    359|	{
 1192|    359|		m_SnoopFile.close();
 1193|    359|	}
_ZN4pcpp21SnoopFileReaderDevice4openEv:
 1196|    359|	{
 1197|    359|		if (m_SnoopFile.is_open())
  ------------------
  |  Branch (1197:7): [True: 0, False: 359]
  ------------------
 1198|      0|		{
 1199|      0|			PCPP_LOG_ERROR("File already open");
  ------------------
  |  |  443|      0|#	define PCPP_LOG_ERROR(message) PCPP_LOG(pcpp::LogLevel::Error, message)
  |  |  ------------------
  |  |  |  |  412|      0|	do                                                                                                                 \
  |  |  |  |  413|      0|	{                                                                                                                  \
  |  |  |  |  414|      0|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|      0|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  416|      0|		{                                                                                                              \
  |  |  |  |  417|      0|			auto ctx =                                                                                                 \
  |  |  |  |  418|      0|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|      0|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|      0|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|      0|		}                                                                                                              \
  |  |  |  |  422|      0|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1200|      0|			return false;
 1201|      0|		}
 1202|       |
 1203|    359|		resetStatisticCounters();
 1204|       |
 1205|    359|		std::ifstream snoopFile;
 1206|    359|		snoopFile.open(m_FileName.c_str(), std::ifstream::binary);
 1207|    359|		if (!snoopFile.is_open())
  ------------------
  |  Branch (1207:7): [True: 0, False: 359]
  ------------------
 1208|      0|		{
 1209|      0|			PCPP_LOG_ERROR("Cannot open snoop reader device for filename '" << m_FileName << "'");
  ------------------
  |  |  443|      0|#	define PCPP_LOG_ERROR(message) PCPP_LOG(pcpp::LogLevel::Error, message)
  |  |  ------------------
  |  |  |  |  412|      0|	do                                                                                                                 \
  |  |  |  |  413|      0|	{                                                                                                                  \
  |  |  |  |  414|      0|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|      0|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  416|      0|		{                                                                                                              \
  |  |  |  |  417|      0|			auto ctx =                                                                                                 \
  |  |  |  |  418|      0|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|      0|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|      0|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|      0|		}                                                                                                              \
  |  |  |  |  422|      0|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1210|      0|			return false;
 1211|      0|		}
 1212|       |
 1213|    359|		snoop_file_header_t snoop_file_header;
 1214|    359|		snoopFile.read(reinterpret_cast<char*>(&snoop_file_header), sizeof(snoop_file_header_t));
 1215|    359|		if (!snoopFile)
  ------------------
  |  Branch (1215:7): [True: 2, False: 357]
  ------------------
 1216|      2|		{
 1217|      2|			PCPP_LOG_ERROR("Cannot read snoop file header for '" << m_FileName << "'");
  ------------------
  |  |  443|      2|#	define PCPP_LOG_ERROR(message) PCPP_LOG(pcpp::LogLevel::Error, message)
  |  |  ------------------
  |  |  |  |  412|      2|	do                                                                                                                 \
  |  |  |  |  413|      2|	{                                                                                                                  \
  |  |  |  |  414|      2|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|      2|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      2|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  416|      2|		{                                                                                                              \
  |  |  |  |  417|      2|			auto ctx =                                                                                                 \
  |  |  |  |  418|      2|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      2|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|      2|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|      2|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|      2|		}                                                                                                              \
  |  |  |  |  422|      2|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|      2|			return false;
 1219|      2|		}
 1220|       |
 1221|    357|		if (be64toh(snoop_file_header.identification_pattern) != 0x736e6f6f70000000 ||
  ------------------
  |  Branch (1221:7): [True: 102, False: 255]
  ------------------
 1222|    357|		    be32toh(snoop_file_header.version_number) != 2)
  ------------------
  |  Branch (1222:7): [True: 45, False: 210]
  ------------------
 1223|    147|		{
 1224|    147|			PCPP_LOG_ERROR("Malformed snoop file header for '" << m_FileName << "'");
  ------------------
  |  |  443|    147|#	define PCPP_LOG_ERROR(message) PCPP_LOG(pcpp::LogLevel::Error, message)
  |  |  ------------------
  |  |  |  |  412|    147|	do                                                                                                                 \
  |  |  |  |  413|    147|	{                                                                                                                  \
  |  |  |  |  414|    147|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|    147|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|    147|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  416|    147|		{                                                                                                              \
  |  |  |  |  417|    147|			auto ctx =                                                                                                 \
  |  |  |  |  418|    147|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|    147|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|    147|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|    147|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|    147|		}                                                                                                              \
  |  |  |  |  422|    147|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 147]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1225|    147|			return false;
 1226|    147|		}
 1227|       |
 1228|       |		// From https://datatracker.ietf.org/doc/html/rfc1761
 1229|    210|		static const pcpp::LinkLayerType snoop_encap[] = {
 1230|    210|			LINKTYPE_ETHERNET,   /// IEEE 802.3
 1231|    210|			LINKTYPE_NULL,       /// IEEE 802.4 Token Bus
 1232|    210|			LINKTYPE_IEEE802_5,  /// IEEE 802.5
 1233|    210|			LINKTYPE_NULL,       /// IEEE 802.6 Metro Net
 1234|    210|			LINKTYPE_ETHERNET,   /// Ethernet
 1235|    210|			LINKTYPE_C_HDLC,     /// HDLC
 1236|    210|			LINKTYPE_NULL,       /// Character Synchronous, e.g. bisync
 1237|    210|			LINKTYPE_NULL,       /// IBM Channel-to-Channel
 1238|    210|			LINKTYPE_FDDI        /// FDDI
 1239|    210|		};
 1240|    210|		uint32_t datalink_type = be32toh(snoop_file_header.datalink_type);
 1241|    210|		if (datalink_type > ARRAY_SIZE(snoop_encap) - 1)
  ------------------
  |  Branch (1241:7): [True: 46, False: 164]
  ------------------
 1242|     46|		{
 1243|     46|			PCPP_LOG_ERROR("Cannot read data link type for '" << m_FileName << "'");
  ------------------
  |  |  443|     46|#	define PCPP_LOG_ERROR(message) PCPP_LOG(pcpp::LogLevel::Error, message)
  |  |  ------------------
  |  |  |  |  412|     46|	do                                                                                                                 \
  |  |  |  |  413|     46|	{                                                                                                                  \
  |  |  |  |  414|     46|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|     46|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|     46|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 46, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  416|     46|		{                                                                                                              \
  |  |  |  |  417|     46|			auto ctx =                                                                                                 \
  |  |  |  |  418|     46|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|     46|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|     46|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|     46|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|     46|		}                                                                                                              \
  |  |  |  |  422|     46|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 46]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1244|     46|			return false;
 1245|     46|		}
 1246|       |
 1247|    164|		m_SnoopFile = std::move(snoopFile);
 1248|    164|		m_PcapLinkLayerType = snoop_encap[datalink_type];
 1249|       |
 1250|    164|		constexpr uint32_t maxPacketLength = 15'000;
 1251|    164|		m_ReadBuffer.resize(maxPacketLength);
 1252|       |
 1253|    164|		PCPP_LOG_DEBUG("Successfully opened file reader device for filename '" << m_FileName << "'");
  ------------------
  |  |  425|    164|#	define PCPP_LOG_DEBUG(message) PCPP_LOG(pcpp::LogLevel::Debug, message)
  |  |  ------------------
  |  |  |  |  412|    164|	do                                                                                                                 \
  |  |  |  |  413|    164|	{                                                                                                                  \
  |  |  |  |  414|    164|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|    164|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|    164|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 0, False: 164]
  |  |  |  |  ------------------
  |  |  |  |  416|    164|		{                                                                                                              \
  |  |  |  |  417|      0|			auto ctx =                                                                                                 \
  |  |  |  |  418|      0|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|      0|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|      0|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|      0|		}                                                                                                              \
  |  |  |  |  422|    164|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 164]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1254|    164|		return true;
 1255|    210|	}
_ZN4pcpp21SnoopFileReaderDevice14readNextPacketER8timespecPhjRjS4_:
 1259|  1.39k|	{
 1260|  1.39k|		snoop_packet_header_t snoop_packet_header;
 1261|  1.39k|		m_SnoopFile.read(reinterpret_cast<char*>(&snoop_packet_header), sizeof(snoop_packet_header_t));
 1262|  1.39k|		if (!m_SnoopFile)
  ------------------
  |  Branch (1262:7): [True: 113, False: 1.28k]
  ------------------
 1263|    113|		{
 1264|    113|			PCPP_LOG_ERROR("Failed to read packet metadata");
  ------------------
  |  |  443|    113|#	define PCPP_LOG_ERROR(message) PCPP_LOG(pcpp::LogLevel::Error, message)
  |  |  ------------------
  |  |  |  |  412|    113|	do                                                                                                                 \
  |  |  |  |  413|    113|	{                                                                                                                  \
  |  |  |  |  414|    113|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|    113|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|    113|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 113, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  416|    113|		{                                                                                                              \
  |  |  |  |  417|    113|			auto ctx =                                                                                                 \
  |  |  |  |  418|    113|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|    113|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|    113|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|    113|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|    113|		}                                                                                                              \
  |  |  |  |  422|    113|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 113]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1265|    113|			return false;
 1266|    113|		}
 1267|       |
 1268|  1.28k|		capturedLength = be32toh(snoop_packet_header.included_length);
 1269|  1.28k|		if (capturedLength > packetDataLen)
  ------------------
  |  Branch (1269:7): [True: 48, False: 1.23k]
  ------------------
 1270|     48|		{
 1271|     48|			PCPP_LOG_ERROR("Packet length " << capturedLength << " is too large");
  ------------------
  |  |  443|     48|#	define PCPP_LOG_ERROR(message) PCPP_LOG(pcpp::LogLevel::Error, message)
  |  |  ------------------
  |  |  |  |  412|     48|	do                                                                                                                 \
  |  |  |  |  413|     48|	{                                                                                                                  \
  |  |  |  |  414|     48|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|     48|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|     48|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 48, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  416|     48|		{                                                                                                              \
  |  |  |  |  417|     48|			auto ctx =                                                                                                 \
  |  |  |  |  418|     48|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|     48|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|     48|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|     48|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|     48|		}                                                                                                              \
  |  |  |  |  422|     48|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 48]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1272|     48|			return false;
 1273|     48|		}
 1274|       |
 1275|  1.23k|		m_SnoopFile.read(reinterpret_cast<char*>(packetData), capturedLength);
 1276|  1.23k|		if (!m_SnoopFile)
  ------------------
  |  Branch (1276:7): [True: 3, False: 1.22k]
  ------------------
 1277|      3|		{
 1278|      3|			PCPP_LOG_ERROR("Failed to read packet data");
  ------------------
  |  |  443|      3|#	define PCPP_LOG_ERROR(message) PCPP_LOG(pcpp::LogLevel::Error, message)
  |  |  ------------------
  |  |  |  |  412|      3|	do                                                                                                                 \
  |  |  |  |  413|      3|	{                                                                                                                  \
  |  |  |  |  414|      3|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|      3|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      3|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  416|      3|		{                                                                                                              \
  |  |  |  |  417|      3|			auto ctx =                                                                                                 \
  |  |  |  |  418|      3|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      3|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|      3|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|      3|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|      3|		}                                                                                                              \
  |  |  |  |  422|      3|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1279|      3|			return false;
 1280|      3|		}
 1281|       |
 1282|  1.22k|		packetTimestamp = { static_cast<time_t>(be32toh(snoop_packet_header.time_sec)),
 1283|  1.22k|			                static_cast<long>(be32toh(snoop_packet_header.time_usec)) * 1000 };
 1284|       |
 1285|  1.22k|		frameLength = be32toh(snoop_packet_header.original_length);
 1286|       |
 1287|  1.22k|		auto pad = be32toh(snoop_packet_header.packet_record_length) -
 1288|  1.22k|		           (sizeof(snoop_packet_header_t) + be32toh(snoop_packet_header.included_length));
 1289|       |
 1290|  1.22k|		m_SnoopFile.ignore(pad);
 1291|       |
 1292|  1.22k|		return true;
 1293|  1.23k|	}
_ZN4pcpp21SnoopFileReaderDevice13getNextPacketERNS_9RawPacketE:
 1296|  1.39k|	{
 1297|  1.39k|		if (!isOpened())
  ------------------
  |  Branch (1297:7): [True: 0, False: 1.39k]
  ------------------
 1298|      0|		{
 1299|      0|			PCPP_LOG_ERROR("File device not open");
  ------------------
  |  |  443|      0|#	define PCPP_LOG_ERROR(message) PCPP_LOG(pcpp::LogLevel::Error, message)
  |  |  ------------------
  |  |  |  |  412|      0|	do                                                                                                                 \
  |  |  |  |  413|      0|	{                                                                                                                  \
  |  |  |  |  414|      0|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|      0|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  416|      0|		{                                                                                                              \
  |  |  |  |  417|      0|			auto ctx =                                                                                                 \
  |  |  |  |  418|      0|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|      0|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|      0|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|      0|		}                                                                                                              \
  |  |  |  |  422|      0|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1300|      0|			return false;
 1301|      0|		}
 1302|       |
 1303|  1.39k|		timespec packetTimestamp{};
 1304|  1.39k|		uint32_t capturedLength = 0, frameLength = 0;
 1305|       |
 1306|  1.39k|		while (readNextPacket(packetTimestamp, m_ReadBuffer.data(), m_ReadBuffer.size(), capturedLength, frameLength))
  ------------------
  |  Branch (1306:10): [True: 1.22k, False: 164]
  ------------------
 1307|  1.22k|		{
 1308|  1.22k|			if (m_BpfWrapper.matches(m_ReadBuffer.data(), capturedLength, packetTimestamp, m_PcapLinkLayerType))
  ------------------
  |  Branch (1308:8): [True: 1.22k, False: 0]
  ------------------
 1309|  1.22k|			{
 1310|  1.22k|				auto packetData = std::make_unique<uint8_t[]>(capturedLength);
 1311|  1.22k|				std::copy(m_ReadBuffer.begin(), m_ReadBuffer.begin() + capturedLength, packetData.get());
 1312|       |
 1313|  1.22k|				rawPacket.setRawData(capturedLength > 0 ? packetData.release() : nullptr, capturedLength, true,
  ------------------
  |  Branch (1313:26): [True: 401, False: 828]
  ------------------
 1314|  1.22k|				                     packetTimestamp, m_PcapLinkLayerType, frameLength);
 1315|  1.22k|				reportPacketProcessed();
 1316|  1.22k|				return true;
 1317|  1.22k|			}
 1318|      0|			PCPP_LOG_DEBUG("Packet doesn't match filter");
  ------------------
  |  |  425|      0|#	define PCPP_LOG_DEBUG(message) PCPP_LOG(pcpp::LogLevel::Debug, message)
  |  |  ------------------
  |  |  |  |  412|      0|	do                                                                                                                 \
  |  |  |  |  413|      0|	{                                                                                                                  \
  |  |  |  |  414|      0|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|      0|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  416|      0|		{                                                                                                              \
  |  |  |  |  417|      0|			auto ctx =                                                                                                 \
  |  |  |  |  418|      0|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|      0|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|      0|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|      0|		}                                                                                                              \
  |  |  |  |  422|      0|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1319|      0|		}
 1320|       |
 1321|    164|		return false;
 1322|  1.39k|	}
_ZN4pcpp21SnoopFileReaderDevice5closeEv:
 1325|    108|	{
 1326|    108|		m_SnoopFile.close();
 1327|    108|		PCPP_LOG_DEBUG("File reader closed for file '" << m_FileName << "'");
  ------------------
  |  |  425|    108|#	define PCPP_LOG_DEBUG(message) PCPP_LOG(pcpp::LogLevel::Debug, message)
  |  |  ------------------
  |  |  |  |  412|    108|	do                                                                                                                 \
  |  |  |  |  413|    108|	{                                                                                                                  \
  |  |  |  |  414|    108|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|    108|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|    108|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 0, False: 108]
  |  |  |  |  ------------------
  |  |  |  |  416|    108|		{                                                                                                              \
  |  |  |  |  417|      0|			auto ctx =                                                                                                 \
  |  |  |  |  418|      0|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleFileDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|      0|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|      0|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|      0|		}                                                                                                              \
  |  |  |  |  422|    108|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 108]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1328|    108|	}
_ZN4pcpp10ARRAY_SIZEIKNS_13LinkLayerTypeELm9EEEmRAT0__T_:
   42|    210|	{
   43|    210|		return N;
   44|    210|	}

_ZNK4pcpp16BpfFilterWrapper7matchesEPKhj8timespect:
  104|  1.22k|	{
  105|  1.22k|		if (m_FilterStr.empty())
  ------------------
  |  Branch (105:7): [True: 1.22k, False: 0]
  ------------------
  106|  1.22k|			return true;
  107|       |
  108|      0|#ifdef USE_PCAP
  109|       |		// Handle uncompiled program or link type mismatch
  110|      0|		if (m_CachedProgram == nullptr || linkType != static_cast<uint16_t>(m_CachedProgramLinkType))
  ------------------
  |  Branch (110:7): [True: 0, False: 0]
  |  Branch (110:37): [True: 0, False: 0]
  ------------------
  111|      0|		{
  112|      0|			auto newProgram = compileFilter(m_FilterStr, static_cast<LinkLayerType>(linkType));
  113|      0|			if (newProgram == nullptr)
  ------------------
  |  Branch (113:8): [True: 0, False: 0]
  ------------------
  114|      0|			{
  115|      0|				PCPP_LOG_ERROR("Couldn't compile BPF filter: '" << m_FilterStr << "' for link type: " << linkType);
  ------------------
  |  |  443|      0|#	define PCPP_LOG_ERROR(message) PCPP_LOG(pcpp::LogLevel::Error, message)
  |  |  ------------------
  |  |  |  |  412|      0|	do                                                                                                                 \
  |  |  |  |  413|      0|	{                                                                                                                  \
  |  |  |  |  414|      0|		auto& logger = pcpp::Logger::getInstance();                                                                    \
  |  |  |  |  415|      0|		if (logger.shouldLog(level, LOG_MODULE))                                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleLiveDevice
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (415:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  416|      0|		{                                                                                                              \
  |  |  |  |  417|      0|			auto ctx =                                                                                                 \
  |  |  |  |  418|      0|			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |    1|      0|#define LOG_MODULE PcapLogModuleLiveDevice
  |  |  |  |  ------------------
  |  |  |  |               			    logger.createLogContext(level, pcpp::LogSource(LOG_MODULE, PCAPPP_FILENAME, __FUNCTION__, __LINE__));  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|       |#	define PCAPPP_FILENAME __FILE_NAME__
  |  |  |  |  ------------------
  |  |  |  |  419|      0|			(*ctx) << message;                                                                                         \
  |  |  |  |  420|      0|			logger.emit(std::move(ctx));                                                                               \
  |  |  |  |  421|      0|		}                                                                                                              \
  |  |  |  |  422|      0|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (422:11): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|      0|				return false;
  117|      0|			}
  118|      0|			m_CachedProgram = std::move(newProgram);
  119|      0|			m_CachedProgramLinkType = static_cast<LinkLayerType>(linkType);
  120|      0|		}
  121|       |
  122|       |		// Test the packet against the filter
  123|      0|		pcap_pkthdr pktHdr;
  124|      0|		pktHdr.caplen = packetDataLength;
  125|      0|		pktHdr.len = packetDataLength;
  126|      0|		pktHdr.ts = internal::toTimeval(timestamp);
  127|      0|		return (pcap_offline_filter(m_CachedProgram.get(), &pktHdr, packetData) != 0);
  128|       |#else
  129|       |		PCPP_LOG_ERROR("pcap is not available");
  130|       |		return false;
  131|       |#endif
  132|      0|	}

FuzzTarget.cpp:_ZL18dumpDataToPcapFilePKhmPKc:
    8|    359|{
    9|    359|	FILE* fd;
   10|    359|	int written = 0;
   11|       |
   12|    359|	fd = fopen(path, "wb");
   13|    359|	if (fd == nullptr)
  ------------------
  |  Branch (13:6): [True: 0, False: 359]
  ------------------
   14|      0|	{
   15|      0|		std::cerr << "Error opening pcap file for writing\n";
   16|      0|		return -1;
   17|      0|	}
   18|       |
   19|    359|	written = fwrite(data, 1, size, fd);
   20|    359|	if (static_cast<size_t>(written) != size)
  ------------------
  |  Branch (20:6): [True: 0, False: 359]
  ------------------
   21|      0|	{
   22|      0|		std::cerr << "Error writing pcap file\n";
   23|      0|		fclose(fd);
   24|      0|		return -1;
   25|      0|	}
   26|       |
   27|    359|	fclose(fd);
   28|    359|	return 0;
   29|    359|}

LLVMFuzzerTestOneInput:
   11|    359|{
   12|    359|	if (tmpName.empty())
  ------------------
  |  Branch (12:6): [True: 1, False: 358]
  ------------------
   13|      1|		tmpName = tmpnam(nullptr);
   14|       |
   15|    359|	if (tmpFile.empty())
  ------------------
  |  Branch (15:6): [True: 1, False: 358]
  ------------------
   16|      1|		tmpFile = tmpName + FILE_EXT;
   17|       |
   18|    359|	if (dumpDataToPcapFile(data, size, tmpFile.c_str()) != 0)
  ------------------
  |  Branch (18:6): [True: 0, False: 359]
  ------------------
   19|      0|	{
   20|      0|		std::cerr << "Can't Dump buffer to the '" << tmpFile << "' file!!!!\n";
   21|      0|		return -1;
   22|      0|	}
   23|       |
   24|    359|	pcpp::Logger::getInstance().suppressLogs();
   25|       |
   26|    359|	std::unique_ptr<pcpp::IFileReaderDevice> reader(pcpp::IFileReaderDevice::getReader(tmpFile));
   27|    359|	if (!reader->open())
  ------------------
  |  Branch (27:6): [True: 195, False: 164]
  ------------------
   28|    195|	{
   29|    195|		std::cerr << "Error opening the '" << tmpFile << "' file\n";
   30|    195|		return -1;
   31|    195|	}
   32|       |
   33|    164|	pcpp::PcapStats stats;
   34|    164|	reader->getStatistics(stats);
   35|    164|	std::cout << "Read " << stats.packetsRecv << " packets successfully and " << stats.packetsDrop
   36|    164|	          << " packets could not be read" << std::endl;
   37|       |
   38|    164|	if (auto ngReader = dynamic_cast<pcpp::PcapNgFileReaderDevice*>(reader.get()))
  ------------------
  |  Branch (38:11): [True: 0, False: 164]
  ------------------
   39|      0|	{
   40|      0|		std::cout << "OS is '" << ngReader->getOS() << "'; Hardware is '" << ngReader->getHardware() << "'"
   41|      0|		          << "'; CaptureApplication is '" << ngReader->getCaptureApplication() << "'; CaptureFileComment is '"
   42|      0|		          << ngReader->getCaptureFileComment() << "'" << std::endl;
   43|      0|	}
   44|       |
   45|    164|	pcpp::RawPacketVector packets;
   46|    164|	if (reader->getNextPackets(packets, 1) != 1)
  ------------------
  |  Branch (46:6): [True: 56, False: 108]
  ------------------
   47|     56|	{
   48|     56|		std::cerr << "Couldn't read the first packet in the file\n";
   49|     56|		return 0;
   50|     56|	}
   51|       |
   52|    108|	pcpp::RawPacket& rawPacket = *packets.front();
   53|    108|	do
   54|  1.22k|	{
   55|       |		// go deeper only for .pcap and .pcapng format
   56|       |		// for .snoop we are only fuzzing the reader
   57|  1.22k|		if (0 == strcmp(FILE_EXT, ".pcap") || 0 == strcmp(FILE_EXT, ".pcapng"))
  ------------------
  |  Branch (57:7): [Folded, False: 0]
  |  Branch (57:41): [Folded, False: 0]
  ------------------
   58|      0|		{
   59|      0|			pcpp::Packet parsedPacket(&rawPacket);
   60|      0|			parsedPacket.toString();
   61|      0|			auto layer = parsedPacket.getFirstLayer();
   62|      0|			while (layer != nullptr)
  ------------------
  |  Branch (62:11): [True: 0, False: 0]
  ------------------
   63|      0|			{
   64|      0|				std::cout << layer->toString() << std::endl;
   65|      0|				layer->getHeaderLen();
   66|      0|				readParsedPacket(parsedPacket, layer);
   67|      0|				layer = layer->getNextLayer();
   68|      0|			}
   69|      0|			parsedPacket.computeCalculateFields();
   70|      0|		}
   71|  1.22k|	} while (reader->getNextPacket(rawPacket));
  ------------------
  |  Branch (71:11): [True: 1.12k, False: 108]
  ------------------
   72|       |
   73|    108|	reader->close();
   74|    108|	return 0;
   75|    164|}

