git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Radius (#7)
[stg.git]
/
projects
/
stargazer
/
plugins
/
capture
/
ether_linux
/
ether_cap.h
diff --git
a/projects/stargazer/plugins/capture/ether_linux/ether_cap.h
b/projects/stargazer/plugins/capture/ether_linux/ether_cap.h
index cf776a4526bd1ec63d255491372f18cec7e46569..fa3af3bd3009b3a884481e657b11420804a07aa9 100644
(file)
--- 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
#pragma once
-#include <pthread.h>
-
-#include <string>
-
#include "stg/plugin.h"
#include "stg/module_settings.h"
#include "stg/logger.h"
#include "stg/plugin.h"
#include "stg/module_settings.h"
#include "stg/logger.h"
+#include <string>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
+#include <jthread.hpp>
+#pragma GCC diagnostic pop
+
namespace STG
{
namespace STG
{
-
struct
Users;
-
struct
Tariffs;
+
class
Users;
+
class
Tariffs;
struct Admins;
struct TraffCounter;
struct Settings;
struct Admins;
struct TraffCounter;
struct Settings;
@@
-66,15
+68,14
@@
private:
ETHER_CAP(const ETHER_CAP & rvalue);
ETHER_CAP & operator=(const ETHER_CAP & rvalue);
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;
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;
bool isRunning;
int capSock;