summaryrefslogtreecommitdiff
path: root/src/login/loginlog.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-02-10 01:20:26 +0100
committerGitHub <noreply@github.com>2018-02-10 01:20:26 +0100
commit6f85e399942facc69555d078c82588f95b198711 (patch)
tree24b5585fc327335853e7162b74996fa7c384a94d /src/login/loginlog.h
parenteb0d54e10cf59a72c78dae6101c12a8de0c9d381 (diff)
parent8174c0c1e315533e903d229feb519a71286d4b54 (diff)
downloadhercules-6f85e399942facc69555d078c82588f95b198711.tar.gz
hercules-6f85e399942facc69555d078c82588f95b198711.tar.bz2
hercules-6f85e399942facc69555d078c82588f95b198711.tar.xz
hercules-6f85e399942facc69555d078c82588f95b198711.zip
Merge pull request #1963 from 4144/fix1908
Add missing interfaces in login server. fix issue 1908
Diffstat (limited to 'src/login/loginlog.h')
-rw-r--r--src/login/loginlog.h38
1 files changed, 32 insertions, 6 deletions
diff --git a/src/login/loginlog.h b/src/login/loginlog.h
index 589bc4fa1..fecb9b364 100644
--- a/src/login/loginlog.h
+++ b/src/login/loginlog.h
@@ -21,15 +21,41 @@
#ifndef LOGIN_LOGINLOG_H
#define LOGIN_LOGINLOG_H
+#include "common/hercules.h"
#include "common/cbasetypes.h"
+struct config_t;
+
+struct s_loginlog_dbs {
+ char log_db_hostname[32];
+ uint16 log_db_port;
+ char log_db_username[32];
+ char log_db_password[100];
+ char log_db_database[32];
+ char log_codepage[32];
+ char log_login_db[256];
+};
+
+/**
+ * Loginlog.c Interface
+ **/
+struct loginlog_interface {
+ struct Sql *sql_handle;
+ bool enabled;
+ struct s_loginlog_dbs *dbs;
+ unsigned long (*failedattempts) (uint32 ip, unsigned int minutes);
+ void (*log) (uint32 ip, const char* username, int rcode, const char* message);
+ bool (*init) (void);
+ bool (*final) (void);
+ bool (*config_read_names) (const char *filename, struct config_t *config, bool imported);
+ bool (*config_read_log) (const char *filename, struct config_t *config, bool imported);
+ bool (*config_read) (const char *filename, bool imported);
+};
+
#ifdef HERCULES_CORE
-// TODO: Interface
-unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes);
-void login_log(uint32 ip, const char* username, int rcode, const char* message);
-bool loginlog_init(void);
-bool loginlog_final(void);
-bool loginlog_config_read(const char *filename, bool imported);
+void loginlog_defaults(void);
#endif // HERCULES_CORE
+HPShared struct loginlog_interface *loginlog;
+
#endif /* LOGIN_LOGINLOG_H */