}
//-----------------------------------------------------------------------------
AUTH_AO::AUTH_AO()
- : users(NULL),
+ : errorStr(),
+ users(NULL),
+ usersList(),
isRunning(false),
+ settings(),
+ BeforeChgAONotifierList(),
+ AfterChgAONotifierList(),
+ BeforeChgIPNotifierList(),
+ AfterChgIPNotifierList(),
onAddUserNotifier(*this),
onDelUserNotifier(*this)
{
class AUTH_AO;
class USERS;
//-----------------------------------------------------------------------------
-template <typename varParamType>
-class CHG_BEFORE_NOTIFIER : public PROPERTY_NOTIFIER_BASE<varParamType> {
+template <typename T>
+class CHG_BEFORE_NOTIFIER : public PROPERTY_NOTIFIER_BASE<T> {
public:
CHG_BEFORE_NOTIFIER(AUTH_AO & a, USER_PTR u) : user(u), auth(a) {}
- void Notify(const varParamType & oldValue, const varParamType & newValue);
+ CHG_BEFORE_NOTIFIER(const CHG_BEFORE_NOTIFIER<T> & rvalue)
+ : user(rvalue.user), auth(rvalue.auth)
+ {}
+ void Notify(const T & oldValue, const T & newValue);
USER_PTR GetUser() const { return user; }
private:
+ CHG_BEFORE_NOTIFIER<T> & operator=(const CHG_BEFORE_NOTIFIER<T> & rvalue);
+
USER_PTR user;
const AUTH_AO & auth;
};
//-----------------------------------------------------------------------------
-template <typename varParamType>
-class CHG_AFTER_NOTIFIER : public PROPERTY_NOTIFIER_BASE<varParamType> {
+template <typename T>
+class CHG_AFTER_NOTIFIER : public PROPERTY_NOTIFIER_BASE<T> {
public:
CHG_AFTER_NOTIFIER(AUTH_AO & a, USER_PTR u) : user(u), auth(a) {}
- void Notify(const varParamType & oldValue, const varParamType & newValue);
+ CHG_AFTER_NOTIFIER(const CHG_AFTER_NOTIFIER<T> & rvalue)
+ : user(rvalue.user), auth(rvalue.auth)
+ {}
+ void Notify(const T & oldValue, const T & newValue);
USER_PTR GetUser() const { return user; }
private:
+ CHG_AFTER_NOTIFIER<T> & operator=(const CHG_AFTER_NOTIFIER<T> & rvalue);
+
USER_PTR user;
const AUTH_AO & auth;
};
int SendMessage(const STG_MSG & msg, uint32_t ip) const;
private:
+ AUTH_AO(const AUTH_AO & rvalue);
+ AUTH_AO & operator=(const AUTH_AO & rvalue);
+
void GetUsers();
void SetUserNotifiers(USER_PTR u);
void UnSetUserNotifiers(USER_PTR u);
public:
ADD_USER_NONIFIER(AUTH_AO & a) : auth(a) {}
virtual ~ADD_USER_NONIFIER() {}
-
- void Notify(const USER_PTR & user)
- {
- auth.AddUser(user);
- }
+ void Notify(const USER_PTR & user) { auth.AddUser(user); }
private:
+ ADD_USER_NONIFIER(const ADD_USER_NONIFIER & rvalue);
+ ADD_USER_NONIFIER & operator=(const ADD_USER_NONIFIER & rvalue);
+
AUTH_AO & auth;
} onAddUserNotifier;
public:
DEL_USER_NONIFIER(AUTH_AO & a) : auth(a) {}
virtual ~DEL_USER_NONIFIER() {}
-
- void Notify(const USER_PTR & user)
- {
- auth.DelUser(user);
- }
+ void Notify(const USER_PTR & user) { auth.DelUser(user); }
private:
+ DEL_USER_NONIFIER(const DEL_USER_NONIFIER & rvalue);
+ DEL_USER_NONIFIER & operator=(const DEL_USER_NONIFIER & rvalue);
+
AUTH_AO & auth;
} onDelUserNotifier;
: userDelay(0),
userTimeout(0),
port(0),
+ errorStr(),
freeMbShowType(freeMbCash)
{
}
#ifdef IA_PHASE_DEBUG
IA_PHASE::IA_PHASE()
: phase(1),
+ phaseTime(),
flog(NULL)
{
gettimeofday(&phaseTime, NULL);
}
#else
IA_PHASE::IA_PHASE()
- : phase(1)
+ : phase(1),
+ phaseTime()
{
gettimeofday(&phaseTime, NULL);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
AUTH_IA::AUTH_IA()
- : nonstop(false),
+ : ctxS(),
+ errorStr(),
+ iaSettings(),
+ settings(),
+ nonstop(false),
isRunningRun(false),
isRunningRunTimeouter(false),
users(NULL),
stgSettings(NULL),
+ ip2user(),
+ recvThread(),
+ timeouterThread(),
+ mutex(),
listenSocket(-1),
+ connSynAck6(),
+ connSynAck8(),
+ disconnSynAck6(),
+ disconnSynAck8(),
+ aliveSyn6(),
+ aliveSyn8(),
+ fin6(),
+ fin8(),
+ packetTypes(),
WriteServLog(GetStgLogger()),
enabledDirs(0xFFffFFff),
onDelUserNotifier(*this)
IA_USER()
: login(),
user(NULL),
+ phase(),
lastSendAlive(0),
rnd(random()),
port(0),
+ ctx(),
+ messagesToSend(),
protoVer(0),
password("NO PASSWORD")
{
lastSendAlive(u.lastSendAlive),
rnd(u.rnd),
port(u.port),
+ ctx(),
messagesToSend(u.messagesToSend),
protoVer(u.protoVer),
password(u.password)
#ifdef IA_DEBUG
bool aliveSent;
#endif
+
+private:
+ IA_USER & operator=(const IA_USER & rvalue);
};
//-----------------------------------------------------------------------------
class AUTH_IA_SETTINGS {
void Notify(const USER_PTR & user);
private:
+ DEL_USER_NOTIFIER(const DEL_USER_NOTIFIER & rvalue);
+ DEL_USER_NOTIFIER & operator=(const DEL_USER_NOTIFIER & rvalue);
+
AUTH_IA & auth;
};
//-----------------------------------------------------------------------------
int SendMessage(const STG_MSG & msg, uint32_t ip) const;
private:
+ AUTH_IA(const AUTH_IA & rvalue);
+ AUTH_IA & operator=(const AUTH_IA & rvalue);
+
static void * Run(void *);
static void * RunTimeouter(void * d);
int PrepareNet();
class UnauthorizeUser : std::unary_function<const std::pair<uint32_t, IA_USER> &, void> {
public:
UnauthorizeUser(AUTH_IA * a) : auth(a) {}
+ UnauthorizeUser(const UnauthorizeUser & rvalue) : auth(rvalue.auth) {}
void operator()(const std::pair<uint32_t, IA_USER> & p)
{
auth->users->Unauthorize(p.second.user->GetLogin(), auth);
}
private:
+ UnauthorizeUser & operator=(const UnauthorizeUser & rvalue);
+
AUTH_IA * auth;
};
NF_CAP::NF_CAP()
: traffCnt(NULL),
- tidTCP(0),
- tidUDP(0),
+ settings(),
+ tidTCP(),
+ tidUDP(),
runningTCP(false),
runningUDP(false),
stoppedTCP(true),
portT(0),
portU(0),
sockTCP(-1),
- sockUDP(-1)
+ sockUDP(-1),
+ errorStr()
{
}
{
NF_DATA * data = reinterpret_cast<NF_DATA *>(buf + 24 + i * 48);
- ip.header.ipHeader.ip_v = 4;
- ip.header.ipHeader.ip_hl = 5;
- ip.header.ipHeader.ip_p = data->proto;
+ ip.rawPacket.header.ipHeader.ip_v = 4;
+ ip.rawPacket.header.ipHeader.ip_hl = 5;
+ ip.rawPacket.header.ipHeader.ip_p = data->proto;
ip.dataLen = ntohl(data->octets);
- ip.header.ipHeader.ip_src.s_addr = data->srcAddr;
- ip.header.ipHeader.ip_dst.s_addr = data->dstAddr;
- ip.header.sPort = data->srcPort;
- ip.header.dPort = data->dstPort;
+ ip.rawPacket.header.ipHeader.ip_src.s_addr = data->srcAddr;
+ ip.rawPacket.header.ipHeader.ip_dst.s_addr = data->dstAddr;
+ ip.rawPacket.header.sPort = data->srcPort;
+ ip.rawPacket.header.dPort = data->dstPort;
traffCnt->Process(ip);
}
uint16_t GetStopPosition() const { return STOP_POS; }
private:
+ NF_CAP(const NF_CAP & rvalue);
+ NF_CAP & operator=(const NF_CAP & rvalue);
+
TRAFFCOUNTER * traffCnt;
MODULE_SETTINGS settings;
pthread_t tidTCP;
}
//-----------------------------------------------------------------------------
DIVERT_CAP::DIVERT_CAP()
- : port(0),
+ : settings(),
+ port(0),
+ errorStr(),
+ thread(),
nonstop(false),
isRunning(false),
traffCnt(NULL)
uint16_t GetStopPosition() const { return 10; }
private:
+ DIVERT_CAP(const DIVERT_CAP & rvalue);
+ DIVERT_CAP & operator=(const DIVERT_CAP & rvalue);
+
static void * Run(void *);
int DivertCapOpen();
}
//-----------------------------------------------------------------------------
BPF_CAP::BPF_CAP()
- : nonstop(false),
+ : capSettings(),
+ errorStr(),
+ bpfData(),
+ polld(),
+ thread(),
+ nonstop(false),
isRunning(false),
capSock(-1),
+ settings(),
traffCnt(NULL)
{
}
uint16_t GetStopPosition() const { return 10; }
private:
+ BPF_CAP(const BPF_CAP & rvalue);
+ BPF_CAP & operator=(const BPF_CAP & rvalue);
+
static void * Run(void *);
int BPFCapOpen();
int BPFCapOpen(BPF_DATA * bd);
}
//-----------------------------------------------------------------------------
ETHER_CAP::ETHER_CAP()
- : nonstop(false),
+ : errorStr(),
+ thread(),
+ nonstop(false),
isRunning(false),
capSock(-1),
traffCnt(NULL)
uint16_t GetStopPosition() const { return 10; }
private:
+ ETHER_CAP(const ETHER_CAP & rvalue);
+ ETHER_CAP & operator=(const ETHER_CAP & rvalue);
+
static void * Run(void *);
int EthCapOpen();
int EthCapClose();
//-----------------------------------------------------------------------------
IPQ_CAP::IPQ_CAP()
: ipq_h(NULL),
+ errorStr(),
+ thread(),
nonstop(false),
isRunning(false),
capSock(-1),
- traffCnt(NULL)
+ traffCnt(NULL),
+ buf()
{
memset(buf, 0, BUFSIZE);
}
uint16_t GetStopPosition() const { return 10; }
private:
+ IPQ_CAP(const IPQ_CAP & rvalue);
+ IPQ_CAP & operator=(const IPQ_CAP & rvalue);
+
static void * Run(void *);
int IPQCapOpen();
int IPQCapClose();
#endif
-#include "stg/noncopyable.h"
//-----------------------------------------------------------------------------
-class STG_LOCKER : private NONCOPYABLE
+class STG_LOCKER
{
public:
#ifdef DEBUG_LOCKER
: mutex(m),
file(__file__),
line(__line__),
+ lockerMutex(),
lockID(0)
#else
STG_LOCKER(pthread_mutex_t * m, const char *, int)
#endif
};
private:
+ STG_LOCKER(const STG_LOCKER & rvalue);
+ STG_LOCKER & operator=(const STG_LOCKER & rvalue);
+
pthread_mutex_t * mutex;
#ifdef DEBUG_LOCKER
std::string file;
}
//-----------------------------------------------------------------------------
STG_LOGGER::STG_LOGGER()
- : fileName()
+ : fileName(),
+ mutex()
{
pthread_mutex_init(&mutex, NULL);
}
#include <string>
-#include "stg/noncopyable.h"
-
const char * LogDate(time_t t);
//-----------------------------------------------------------------------------
class STG_LOGGER;
STG_LOGGER & GetStgLogger();
//-----------------------------------------------------------------------------
-class STG_LOGGER_LOCKER : private NONCOPYABLE
+class STG_LOGGER_LOCKER
{
public:
STG_LOGGER_LOCKER(pthread_mutex_t * m) : mutex(m) { pthread_mutex_lock(mutex); };
~STG_LOGGER_LOCKER() { pthread_mutex_unlock(mutex); };
+
private:
+ STG_LOGGER_LOCKER(const STG_LOGGER_LOCKER & rvalue);
+ STG_LOGGER_LOCKER & operator=(const STG_LOGGER_LOCKER & rvalue);
+
pthread_mutex_t * mutex;
};
//-----------------------------------------------------------------------------
private:
STG_LOGGER();
+ STG_LOGGER(const STG_LOGGER & rvalue);
+ STG_LOGGER & operator=(const STG_LOGGER & rvalue);
+
const char * LogDate(time_t t);
std::string fileName;
isRunningSender(false),
sendSocket(-1),
recvSocket(-1),
- pid(0)
+ sendThread(),
+ recvThread(),
+ pmSend(),
+ pid(0),
+ errorStr(),
+ pingIP(),
+ ipToAdd(),
+ ipToDel(),
+ mutex()
{
pthread_mutex_init(&mutex, NULL);
memset(&pmSend, 0, sizeof(pmSend));