diff options
Diffstat (limited to 'server/server/config.h')
-rw-r--r-- | server/server/config.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/server/server/config.h b/server/server/config.h new file mode 100644 index 0000000..0c8450c --- /dev/null +++ b/server/server/config.h @@ -0,0 +1,45 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "headers.h" + +class config +{ +public: + config(const char *path); + const int ban_time(); + const int invalid_ml_count(); + const int conn_count(); + const int conn_time(); + const int check_interval(); + const int invalid_sub_count(); + const int ls_port(); + const int debug(); + const int dos_conn_count(); + const std::string& ls_host(); + const std::string& bind_ip(); + const std::string& log_path(); + const std::string& dos_log_path(); +private: + struct cfg_data + { + int ban_time, invalid_ml_count, conn_count, check_interval, invalid_sub_count, ls_port, debug, dos_conn_count, conn_time; + std::string ls_host, log_path, bind_ip, dos_log_path; + cfg_data() + { + ban_time = conn_time = 60; + invalid_ml_count = 10; + conn_count = 30; + check_interval = 30; + invalid_sub_count = 3; + ls_port = 80; + debug = 0; + dos_conn_count = 200; + } + }; + const int get_int(const std::string& data, const char* var, int default_); + const std::string get_string(const std::string& data, const char* var, const std::string& default_); + cfg_data vars; +}; + +#endif
\ No newline at end of file |