X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/1347f3d1e04bedd1508589173f577673ee2c5554..30a838da28667633e16040250680b793dee271c7:/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h?ds=inline diff --git a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h index a13a11db..fb851f52 100644 --- a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h +++ b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h @@ -27,17 +27,6 @@ #ifndef INETACCESS_H #define INETACCESS_H -#include -#include - -#include -#include -#include -#include -#include -#include -#include - #include "stg/os_int.h" #include "stg/auth.h" #include "stg/store.h" @@ -51,6 +40,17 @@ #include "stg/utime.h" #include "stg/logger.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include + #define IA_PROTO_VER (6) //#define IA_DEBUG (1) @@ -92,7 +92,6 @@ public: void SetPhase2(); void SetPhase3(); void SetPhase4(); - void SetPhase5(); int GetPhase() const; void UpdateTime(); @@ -205,10 +204,11 @@ public: virtual ~AUTH_IA_SETTINGS() {} const std::string & GetStrError() const { return errorStr; } int ParseSettings(const MODULE_SETTINGS & s); - int GetUserDelay() const { return userDelay; } - int GetUserTimeout() const { return userTimeout; } + UTIME GetUserDelay() const { return UTIME(userDelay); } + UTIME GetUserTimeout() const { return UTIME(userTimeout); } uint16_t GetUserPort() const { return port; } FREEMB GetFreeMbShowType() const { return freeMbShowType; } + bool LogProtocolErrors() const { return logProtocolErrors; } private: int userDelay; @@ -216,13 +216,14 @@ private: uint16_t port; std::string errorStr; FREEMB freeMbShowType; + bool logProtocolErrors; }; //----------------------------------------------------------------------------- class AUTH_IA; //----------------------------------------------------------------------------- class DEL_USER_NOTIFIER: public NOTIFIER_BASE { public: - DEL_USER_NOTIFIER(AUTH_IA & a) : auth(a) {} + explicit DEL_USER_NOTIFIER(AUTH_IA & a) : auth(a) {} virtual ~DEL_USER_NOTIFIER() {} void Notify(const USER_PTR & user); @@ -246,7 +247,7 @@ public: int Start(); int Stop(); - int Reload() { return 0; } + int Reload(const MODULE_SETTINGS & ms); bool IsRunning() { return isRunningRunTimeouter || isRunningRun; } const std::string & GetStrError() const { return errorStr; } @@ -266,7 +267,7 @@ private: int FinalizeNet(); void DelUser(USER_PTR u); int RecvData(char * buffer, int bufferSize); - int CheckHeader(const char * buffer, int * protoVer); + int CheckHeader(const char * buffer, uint32_t sip, int * protoVer); int PacketProcessor(void * buff, size_t dataLen, uint32_t sip, uint16_t sport, int protoVer, USER_PTR user); int Process_CONN_SYN_6(CONN_SYN_6 * connSyn, IA_USER * iaUser, uint32_t sip); @@ -368,7 +369,7 @@ private: //----------------------------------------------------------------------------- class UnauthorizeUser : std::unary_function &, void> { public: - UnauthorizeUser(AUTH_IA * a) : auth(a) {} + explicit UnauthorizeUser(AUTH_IA * a) : auth(a) {} UnauthorizeUser(const UnauthorizeUser & rvalue) : auth(rvalue.auth) {} void operator()(const std::pair & p) {