X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8e80bb9cec2c90dd61f810fb1525932a434288eb..1cb912e4f90473f78d2f0f10ab5c9b2c5bd36440:/projects/stargazer/plugins/capture/ether_linux/ether_cap.h?ds=inline diff --git a/projects/stargazer/plugins/capture/ether_linux/ether_cap.h b/projects/stargazer/plugins/capture/ether_linux/ether_cap.h index cf776a45..fa3af3bd 100644 --- a/projects/stargazer/plugins/capture/ether_linux/ether_cap.h +++ b/projects/stargazer/plugins/capture/ether_linux/ether_cap.h @@ -25,19 +25,21 @@ #pragma once -#include - -#include - #include "stg/plugin.h" #include "stg/module_settings.h" #include "stg/logger.h" +#include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#include +#pragma GCC diagnostic pop + namespace STG { -struct Users; -struct Tariffs; +class Users; +class Tariffs; struct Admins; struct TraffCounter; struct Settings; @@ -66,15 +68,14 @@ private: ETHER_CAP(const ETHER_CAP & rvalue); ETHER_CAP & operator=(const ETHER_CAP & rvalue); - static void * Run(void *); + void Run(std::stop_token token); int EthCapOpen(); int EthCapClose(); int EthCapRead(void * buffer, int blen, char ** iface); mutable std::string errorStr; - pthread_t thread; - bool nonstop; + std::jthread m_thread; bool isRunning; int capSock;