4 #include "stg/plugin.h"
6 #include "stg/module_settings.h"
7 #include "stg/subscriptions.h"
8 #include "stg/logger.h"
11 #include <boost/asio.hpp>
15 #include <jthread.hpp>
16 #include <cstdint> //uint8_t, uint32_t
22 class RADIUS : public Auth
26 RADIUS(const RADIUS&) = delete;
27 RADIUS& operator=(const RADIUS&) = delete;
29 void SetUsers(Users* u) override { m_users = u; }
30 void SetSettings(const ModuleSettings& s) override { m_settings = s; }
31 int ParseSettings() override;
35 int Reload(const ModuleSettings& /*ms*/) override { return 0; }
36 bool IsRunning() override;
38 const std::string& GetStrError() const override { return m_errorStr; }
39 std::string GetVersion() const override;
41 uint16_t GetStartPosition() const override { return 0; }
42 uint16_t GetStopPosition() const override { return 0; }
44 int SendMessage(const Message& /*msg*/, uint32_t /*ip*/) const override { return 0; }
49 boost::asio::io_context m_ioContext;
50 void SetRunning(bool val);
51 int Run(std::stop_token token);
53 mutable std::string m_errorStr;
55 ModuleSettings m_settings;
59 std::jthread m_thread;
61 PluginLogger m_logger;
63 std::unique_ptr<Server> m_server;