members via initialization lists
18 files changed:
}
//-----------------------------------------------------------------------------
AUTH_AO::AUTH_AO()
}
//-----------------------------------------------------------------------------
AUTH_AO::AUTH_AO()
+ : errorStr(),
+ users(NULL),
+ usersList(),
+ settings(),
+ BeforeChgAONotifierList(),
+ AfterChgAONotifierList(),
+ BeforeChgIPNotifierList(),
+ AfterChgIPNotifierList(),
onAddUserNotifier(*this),
onDelUserNotifier(*this)
{
onAddUserNotifier(*this),
onDelUserNotifier(*this)
{
class AUTH_AO;
class USERS;
//-----------------------------------------------------------------------------
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) {}
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:
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;
};
//-----------------------------------------------------------------------------
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) {}
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:
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;
};
USER_PTR user;
const AUTH_AO & auth;
};
int SendMessage(const STG_MSG & msg, uint32_t ip) const;
private:
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);
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() {}
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); }
+ ADD_USER_NONIFIER(const ADD_USER_NONIFIER & rvalue);
+ ADD_USER_NONIFIER & operator=(const ADD_USER_NONIFIER & rvalue);
+
AUTH_AO & auth;
} onAddUserNotifier;
AUTH_AO & auth;
} onAddUserNotifier;
public:
DEL_USER_NONIFIER(AUTH_AO & a) : auth(a) {}
virtual ~DEL_USER_NONIFIER() {}
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); }
+ DEL_USER_NONIFIER(const DEL_USER_NONIFIER & rvalue);
+ DEL_USER_NONIFIER & operator=(const DEL_USER_NONIFIER & rvalue);
+
AUTH_AO & auth;
} onDelUserNotifier;
AUTH_AO & auth;
} onDelUserNotifier;
: userDelay(0),
userTimeout(0),
port(0),
: userDelay(0),
userTimeout(0),
port(0),
freeMbShowType(freeMbCash)
{
}
freeMbShowType(freeMbCash)
{
}
#ifdef IA_PHASE_DEBUG
IA_PHASE::IA_PHASE()
: phase(1),
#ifdef IA_PHASE_DEBUG
IA_PHASE::IA_PHASE()
: phase(1),
flog(NULL)
{
gettimeofday(&phaseTime, NULL);
}
#else
IA_PHASE::IA_PHASE()
flog(NULL)
{
gettimeofday(&phaseTime, NULL);
}
#else
IA_PHASE::IA_PHASE()
+ : phase(1),
+ phaseTime()
{
gettimeofday(&phaseTime, NULL);
}
{
gettimeofday(&phaseTime, NULL);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
AUTH_IA::AUTH_IA()
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
AUTH_IA::AUTH_IA()
+ : ctxS(),
+ errorStr(),
+ iaSettings(),
+ settings(),
+ nonstop(false),
isRunningRun(false),
isRunningRunTimeouter(false),
users(NULL),
stgSettings(NULL),
isRunningRun(false),
isRunningRunTimeouter(false),
users(NULL),
stgSettings(NULL),
+ ip2user(),
+ recvThread(),
+ timeouterThread(),
+ mutex(),
+ connSynAck6(),
+ connSynAck8(),
+ disconnSynAck6(),
+ disconnSynAck8(),
+ aliveSyn6(),
+ aliveSyn8(),
+ fin6(),
+ fin8(),
+ packetTypes(),
WriteServLog(GetStgLogger()),
enabledDirs(0xFFffFFff),
onDelUserNotifier(*this)
WriteServLog(GetStgLogger()),
enabledDirs(0xFFffFFff),
onDelUserNotifier(*this)
IA_USER()
: login(),
user(NULL),
IA_USER()
: login(),
user(NULL),
lastSendAlive(0),
rnd(random()),
port(0),
lastSendAlive(0),
rnd(random()),
port(0),
+ ctx(),
+ messagesToSend(),
protoVer(0),
password("NO PASSWORD")
{
protoVer(0),
password("NO PASSWORD")
{
lastSendAlive(u.lastSendAlive),
rnd(u.rnd),
port(u.port),
lastSendAlive(u.lastSendAlive),
rnd(u.rnd),
port(u.port),
messagesToSend(u.messagesToSend),
protoVer(u.protoVer),
password(u.password)
messagesToSend(u.messagesToSend),
protoVer(u.protoVer),
password(u.password)
#ifdef IA_DEBUG
bool aliveSent;
#endif
#ifdef IA_DEBUG
bool aliveSent;
#endif
+
+private:
+ IA_USER & operator=(const IA_USER & rvalue);
};
//-----------------------------------------------------------------------------
class AUTH_IA_SETTINGS {
};
//-----------------------------------------------------------------------------
class AUTH_IA_SETTINGS {
void Notify(const USER_PTR & user);
private:
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;
};
//-----------------------------------------------------------------------------
AUTH_IA & auth;
};
//-----------------------------------------------------------------------------
int SendMessage(const STG_MSG & msg, uint32_t ip) const;
private:
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();
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) {}
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:
void operator()(const std::pair<uint32_t, IA_USER> & p)
{
auth->users->Unauthorize(p.second.user->GetLogin(), auth);
}
private:
+ UnauthorizeUser & operator=(const UnauthorizeUser & rvalue);
+
NF_CAP::NF_CAP()
: traffCnt(NULL),
NF_CAP::NF_CAP()
: traffCnt(NULL),
- tidTCP(0),
- tidUDP(0),
+ settings(),
+ tidTCP(),
+ tidUDP(),
runningTCP(false),
runningUDP(false),
stoppedTCP(true),
runningTCP(false),
runningUDP(false),
stoppedTCP(true),
portT(0),
portU(0),
sockTCP(-1),
portT(0),
portU(0),
sockTCP(-1),
+ sockUDP(-1),
+ errorStr()
{
NF_DATA * data = reinterpret_cast<NF_DATA *>(buf + 24 + i * 48);
{
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.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;
uint16_t GetStopPosition() const { return STOP_POS; }
private:
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;
TRAFFCOUNTER * traffCnt;
MODULE_SETTINGS settings;
pthread_t tidTCP;
}
//-----------------------------------------------------------------------------
DIVERT_CAP::DIVERT_CAP()
}
//-----------------------------------------------------------------------------
DIVERT_CAP::DIVERT_CAP()
+ : settings(),
+ port(0),
+ errorStr(),
+ thread(),
nonstop(false),
isRunning(false),
traffCnt(NULL)
nonstop(false),
isRunning(false),
traffCnt(NULL)
uint16_t GetStopPosition() const { return 10; }
private:
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();
static void * Run(void *);
int DivertCapOpen();
}
//-----------------------------------------------------------------------------
BPF_CAP::BPF_CAP()
}
//-----------------------------------------------------------------------------
BPF_CAP::BPF_CAP()
+ : capSettings(),
+ errorStr(),
+ bpfData(),
+ polld(),
+ thread(),
+ nonstop(false),
isRunning(false),
capSock(-1),
isRunning(false),
capSock(-1),
uint16_t GetStopPosition() const { return 10; }
private:
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);
static void * Run(void *);
int BPFCapOpen();
int BPFCapOpen(BPF_DATA * bd);
}
//-----------------------------------------------------------------------------
ETHER_CAP::ETHER_CAP()
}
//-----------------------------------------------------------------------------
ETHER_CAP::ETHER_CAP()
+ : errorStr(),
+ thread(),
+ nonstop(false),
isRunning(false),
capSock(-1),
traffCnt(NULL)
isRunning(false),
capSock(-1),
traffCnt(NULL)
uint16_t GetStopPosition() const { return 10; }
private:
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();
static void * Run(void *);
int EthCapOpen();
int EthCapClose();
//-----------------------------------------------------------------------------
IPQ_CAP::IPQ_CAP()
: ipq_h(NULL),
//-----------------------------------------------------------------------------
IPQ_CAP::IPQ_CAP()
: ipq_h(NULL),
+ errorStr(),
+ thread(),
nonstop(false),
isRunning(false),
capSock(-1),
nonstop(false),
isRunning(false),
capSock(-1),
+ traffCnt(NULL),
+ buf()
{
memset(buf, 0, BUFSIZE);
}
{
memset(buf, 0, BUFSIZE);
}
uint16_t GetStopPosition() const { return 10; }
private:
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();
static void * Run(void *);
int IPQCapOpen();
int IPQCapClose();
-#include "stg/noncopyable.h"
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-class STG_LOCKER : private NONCOPYABLE
{
public:
#ifdef DEBUG_LOCKER
{
public:
#ifdef DEBUG_LOCKER
: mutex(m),
file(__file__),
line(__line__),
: mutex(m),
file(__file__),
line(__line__),
lockID(0)
#else
STG_LOCKER(pthread_mutex_t * m, const char *, int)
lockID(0)
#else
STG_LOCKER(pthread_mutex_t * m, const char *, int)
+ STG_LOCKER(const STG_LOCKER & rvalue);
+ STG_LOCKER & operator=(const STG_LOCKER & rvalue);
+
pthread_mutex_t * mutex;
#ifdef DEBUG_LOCKER
std::string file;
pthread_mutex_t * mutex;
#ifdef DEBUG_LOCKER
std::string file;
}
//-----------------------------------------------------------------------------
STG_LOGGER::STG_LOGGER()
}
//-----------------------------------------------------------------------------
STG_LOGGER::STG_LOGGER()
+ : fileName(),
+ mutex()
{
pthread_mutex_init(&mutex, NULL);
}
{
pthread_mutex_init(&mutex, NULL);
}
-#include "stg/noncopyable.h"
-
const char * LogDate(time_t t);
//-----------------------------------------------------------------------------
class STG_LOGGER;
STG_LOGGER & GetStgLogger();
//-----------------------------------------------------------------------------
const char * LogDate(time_t t);
//-----------------------------------------------------------------------------
class STG_LOGGER;
STG_LOGGER & GetStgLogger();
//-----------------------------------------------------------------------------
-class STG_LOGGER_LOCKER : private NONCOPYABLE
{
public:
STG_LOGGER_LOCKER(pthread_mutex_t * m) : mutex(m) { pthread_mutex_lock(mutex); };
~STG_LOGGER_LOCKER() { pthread_mutex_unlock(mutex); };
{
public:
STG_LOGGER_LOCKER(pthread_mutex_t * m) : mutex(m) { pthread_mutex_lock(mutex); };
~STG_LOGGER_LOCKER() { pthread_mutex_unlock(mutex); };
+ STG_LOGGER_LOCKER(const STG_LOGGER_LOCKER & rvalue);
+ STG_LOGGER_LOCKER & operator=(const STG_LOGGER_LOCKER & rvalue);
+
pthread_mutex_t * mutex;
};
//-----------------------------------------------------------------------------
pthread_mutex_t * mutex;
};
//-----------------------------------------------------------------------------
+ STG_LOGGER(const STG_LOGGER & rvalue);
+ STG_LOGGER & operator=(const STG_LOGGER & rvalue);
+
const char * LogDate(time_t t);
std::string fileName;
const char * LogDate(time_t t);
std::string fileName;
isRunningSender(false),
sendSocket(-1),
recvSocket(-1),
isRunningSender(false),
sendSocket(-1),
recvSocket(-1),
+ sendThread(),
+ recvThread(),
+ pmSend(),
+ pid(0),
+ errorStr(),
+ pingIP(),
+ ipToAdd(),
+ ipToDel(),
+ mutex()
{
pthread_mutex_init(&mutex, NULL);
memset(&pmSend, 0, sizeof(pmSend));
{
pthread_mutex_init(&mutex, NULL);
memset(&pmSend, 0, sizeof(pmSend));