X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/3f5b16beee49132958b11a586d5573ad426b851f..38cfd057eaa3aa82b37659b5b587ef92cac3bfea:/projects/stargazer/plugins/other/radius/server.h diff --git a/projects/stargazer/plugins/other/radius/server.h b/projects/stargazer/plugins/other/radius/server.h index e33a23b3..7abcff3d 100644 --- a/projects/stargazer/plugins/other/radius/server.h +++ b/projects/stargazer/plugins/other/radius/server.h @@ -11,13 +11,16 @@ namespace STG { + class Users; + class Server { public: - Server(boost::asio::io_service& io_service, const std::string& secret, uint16_t port, const std::string& filePath, std::stop_token token, PluginLogger& logger); + Server(boost::asio::io_service& io_service, const std::string& secret, uint16_t port, const std::string& filePath, std::stop_token token, PluginLogger& logger, Users* users); void stop(); private: RadProto::Packet makeResponse(const RadProto::Packet& request); + bool findUser(const RadProto::Packet& packet); void handleReceive(const boost::system::error_code& error, const std::optional& packet, const boost::asio::ip::udp::endpoint& source); void handleSend(const boost::system::error_code& ec); void start(); @@ -25,6 +28,7 @@ namespace STG RadProto::Socket m_radius; RadProto::Dictionaries m_dictionaries; + Users* m_users; std::stop_token m_token; PluginLogger& m_logger;