#ifndef NetUnitH
#define NetUnitH
-#include "stg/blowfish.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#include <list>
#include <string>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
+#include "stg/blowfish.h"
#define STG_HEADER "SG04"
#define OK_HEADER "OKHD"
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();
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;