X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/0907aa4037b12b6b88ee24495d4577a064d4f8db..b9bafe1042839cd7295adf84448b4d08de9f5f46:/projects/stargazer/plugins/capture/pcap/pcap_cap.h diff --git a/projects/stargazer/plugins/capture/pcap/pcap_cap.h b/projects/stargazer/plugins/capture/pcap/pcap_cap.h index f47c6b8d..e72c3e74 100644 --- a/projects/stargazer/plugins/capture/pcap/pcap_cap.h +++ b/projects/stargazer/plugins/capture/pcap/pcap_cap.h @@ -26,9 +26,12 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#include +#pragma GCC diagnostic pop #include -#include #include namespace STG @@ -45,7 +48,7 @@ struct Settings; struct DEV { DEV() : device("any"), filterExpression("ip"), handle(NULL), fd(-1) {} - DEV(const std::string & d) : device(d), filterExpression("ip"), handle(NULL), fd(-1) {} + explicit DEV(const std::string & d) : device(d), filterExpression("ip"), handle(NULL), fd(-1) {} DEV(const std::string & d, const std::string & f) : device(d), filterExpression(f), handle(NULL), fd(-1) {} @@ -84,12 +87,11 @@ private: void TryRead(const fd_set & set); void TryReadDev(const DEV & dev); - static void * Run(void *); + void Run(std::stop_token token); mutable std::string errorStr; - pthread_t thread; - bool nonstop; + std::jthread m_thread; bool isRunning; STG::ModuleSettings settings; DEV_MAP devices;