2 |
#define __COMMON_H__ |
#define __COMMON_H__ |
3 |
|
|
4 |
#include <string> |
#include <string> |
5 |
|
#include <set> |
6 |
|
|
7 |
//time_t is defines as long int ! //No need to include time.h |
//time_t is defines as long int ! //No need to include time.h |
8 |
|
|
28 |
int uid; |
int uid; |
29 |
int gid; |
int gid; |
30 |
volatile bool mainContinue; |
volatile bool mainContinue; |
31 |
|
volatile bool reloadConfig; |
32 |
|
|
33 |
std::string configFilePath; |
std::string configFilePath; |
34 |
|
|
37 |
|
|
38 |
long int daemonStart; |
long int daemonStart; |
39 |
|
|
40 |
|
|
41 |
SmsCounter smsCounter; |
SmsCounter smsCounter; |
42 |
|
|
43 |
class PluginManager* GetPluginManager(); |
class PluginManager* GetPluginManager(); |
48 |
|
|
49 |
void loadConfig(int argc, char* argv[]); |
void loadConfig(int argc, char* argv[]); |
50 |
|
|
51 |
std::string getStatusMessage(); |
void LoadLists(); //load blacklist & privileged |
52 |
|
bool IsBlacklisted(const std::string& phone); |
53 |
|
bool IsPrivileged(const std::string& phone); |
54 |
|
|
55 |
|
std::string getStatusMessage(); |
56 |
private: |
private: |
57 |
Common(); |
Common(); |
58 |
Common(const Common&) {} |
Common(const Common&) {} |
59 |
Common& operator=(const Common) {return *this;} |
Common& operator=(const Common) |
60 |
|
{ |
61 |
|
return *this; |
62 |
|
} |
63 |
~Common(); |
~Common(); |
64 |
|
|
65 |
|
|
69 |
class ConfigFile* _configFile; |
class ConfigFile* _configFile; |
70 |
|
|
71 |
void printUsage(); |
void printUsage(); |
72 |
|
void LoadWorker(std::set<std::string>& set, std::string config); |
73 |
|
|
74 |
|
|
75 |
|
std::set<std::string> _blacklist; |
76 |
|
std::set<std::string> _privileged; |
77 |
}; |
}; |
78 |
|
|
79 |
|
|