]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/radius/radius.cpp
Небольшой рефакторинг плагина radius
[stg.git] / projects / stargazer / plugins / other / radius / radius.cpp
index 8c7d53d1116aad3f0b015a25b7c1581f8b3bbea6..4dd18c469fcf4f292f98a6b5e11d0f74a1c6318b 100644 (file)
@@ -26,8 +26,8 @@
  *
  */
 
+#include <csignal>
 #include <algorithm>
-#include <signal.h>
 
 #include "radius.h"
 #include "common.h"
@@ -71,35 +71,6 @@ return radc.GetPlugin();
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-uint16_t RAD_SETTINGS::GetPort() const
-{
-return port;
-}
-//-----------------------------------------------------------------------------
-int RAD_SETTINGS::GetPassword(string * password) const
-{
-*password = RAD_SETTINGS::password;
-return 0;
-}
-//-----------------------------------------------------------------------------
-int RAD_SETTINGS::GetAuthServices(list<string> * svcs) const
-{
-*svcs = authServices;
-return 0;
-}
-//-----------------------------------------------------------------------------
-int RAD_SETTINGS::GetAcctServices(list<string> * svcs) const
-{
-*svcs = acctServices;
-return 0;
-}
-//-----------------------------------------------------------------------------
-int RAD_SETTINGS::ParseIP(const string & str, uint32_t * IP)
-{
-*IP = inet_addr(str.c_str());
-return *IP == INADDR_NONE ? -1 : 0;
-}
-//-----------------------------------------------------------------------------
 int RAD_SETTINGS::ParseIntInRange(const string & str, int min, int max, int * val)
 {
 if (str2x(str.c_str(), *val))
@@ -279,11 +250,10 @@ return 0;
 //-----------------------------------------------------------------------------
 int RADIUS::Start()
 {
-string password;
+string password(radSettings.GetPassword());
 
-radSettings.GetPassword(&password);
-radSettings.GetAuthServices(&authServices);
-radSettings.GetAcctServices(&acctServices);
+authServices = radSettings.GetAuthServices();
+acctServices = radSettings.GetAcctServices();
 
 InitEncrypt(&ctx, password);