X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/6bd4918f85f22955197b200d79972d22159e89d8..1b2e8014ab6bc93d0ab0fe320ad3cfc8ed94ab81:/stglibs/srvconf.lib/include/stg/netunit.h diff --git a/stglibs/srvconf.lib/include/stg/netunit.h b/stglibs/srvconf.lib/include/stg/netunit.h index 332670d6..664eee63 100644 --- a/stglibs/srvconf.lib/include/stg/netunit.h +++ b/stglibs/srvconf.lib/include/stg/netunit.h @@ -27,14 +27,14 @@ #ifndef NetUnitH #define NetUnitH -#include "stg/blowfish.h" +#include +#include +#include #include #include -#include -#include -#include +#include "stg/blowfish.h" #define STG_HEADER "SG04" #define OK_HEADER "OKHD" @@ -78,13 +78,18 @@ confData class NETTRANSACT { public: - NETTRANSACT(const std::string & server, uint16_t port, - const std::string & login, const std::string & password); + NETTRANSACT(); int Transact(const char * data); const std::string & GetError() const; void SetRxCallback(void * data, RxCallback_t); + void SetServer(const char * serverName); + void SetServerPort(short unsigned p); + + void SetLogin(const char * l); + void SetPassword(const char * p); + //////////////////////////////////////////// int Connect(); int Disconnect(); void Reset(); @@ -99,15 +104,10 @@ private: int RxLoginSAnswer(); int TxData(const char * text); - int TxData(char * data); int RxDataAnswer(); - void Encrypt(char * d, const char * s, BLOWFISH_CTX *ctx); - void EnDecryptInit(const char * passwd, int passwdLen, BLOWFISH_CTX *ctx); - void Decrypt(char * d, const char * s, BLOWFISH_CTX *ctx); - std::string server; - uint16_t port; + short unsigned port; std::string login; std::string password; int outerSocket;