X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/37324ea9b8c06d96b9383be993da02a01f103253..c57f51df2406db09088196b6adf78e373c97591f:/projects/stargazer/plugins/other/radius/radius.h diff --git a/projects/stargazer/plugins/other/radius/radius.h b/projects/stargazer/plugins/other/radius/radius.h index 4e06e463..59cbf0d5 100644 --- a/projects/stargazer/plugins/other/radius/radius.h +++ b/projects/stargazer/plugins/other/radius/radius.h @@ -1,39 +1,65 @@ #pragma once #include "stg/auth.h" +#include "stg/plugin.h" +#include "config.h" +#include "stg/module_settings.h" +#include "stg/subscriptions.h" #include "stg/logger.h" +#include "server.h" +#include #include +#include #include #include +#include //uint8_t, uint32_t namespace STG { + class Users; + class RADIUS : public Auth { public: RADIUS(); + RADIUS(const RADIUS&) = delete; + RADIUS& operator=(const RADIUS&) = delete; + + void SetUsers(Users* u) override { m_users = u; } + void SetSettings(const ModuleSettings& s) override { m_settings = s; } + int ParseSettings() override; int Start() override; int Stop() override; - int Reload(const ModuleSettings & /*ms*/) override { return 0; } + int Reload(const ModuleSettings& /*ms*/) override { return 0; } bool IsRunning() override; - void SetRunning(bool val); - int ParseSettings() override { return 0; } - const std::string & GetStrError() const override { return m_errorStr; } + + const std::string& GetStrError() const override { return m_errorStr; } std::string GetVersion() const override; + uint16_t GetStartPosition() const override { return 0; } uint16_t GetStopPosition() const override { return 0; } - int SendMessage(const Message & msg, uint32_t ip) const override { return 0; } + int SendMessage(const Message& /*msg*/, uint32_t /*ip*/) const override { return 0; } private: std::mutex m_mutex; + + boost::asio::io_context m_ioContext; + void SetRunning(bool val); + int Run(std::stop_token token); + mutable std::string m_errorStr; - std::jthread m_thread; + Config m_config; + ModuleSettings m_settings; + bool m_running; + + std::jthread m_thread; + Users* m_users; PluginLogger m_logger; - int Run(std::stop_token token); + std::unique_ptr m_server; }; }