X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/a500fb72810060e52d87ad2c2e4691531f0bcc5a..479b8853c2ab18c98926a9369a03888021e9b986:/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;