]> git.stg.codes - stg.git/blobdiff - stglibs/srvconf.lib/include/stg/servconf_types.h
Moved SERVER_INFO parser from global scope.
[stg.git] / stglibs / srvconf.lib / include / stg / servconf_types.h
index d7fb847848ae0d1d44389430783006f630cd06d1..1743204481a054a4e6c4c6b4fe987078ebffcf77 100644 (file)
 #ifndef __STG_STGLIBS_SRVCONF_TYPES_H__
 #define __STG_STGLIBS_SRVCONF_TYPES_H__
 
+#include "stg/const.h" // DIR_NUM
+
+#include <string>
+#include <vector>
+
 #define  STG_HEADER     "SG04"
 #define  OK_HEADER      "OKHD"
 #define  ERR_HEADER     "ERHD"
@@ -31,6 +36,9 @@
 
 #define  ENC_MSG_LEN    (8)
 
+namespace STG
+{
+
 enum status
 {
 st_ok = 0,
@@ -55,4 +63,30 @@ confLoginCipher,
 confData
 };
 
+namespace AUTH_BY
+{
+
+typedef std::vector<std::string> INFO;
+typedef void (* CALLBACK)(bool result, const std::string & reason, const INFO & info, void * data);
+
+} // namespace AUTH_BY
+
+namespace SERVER_INFO
+{
+
+struct INFO
+{
+    std::string version;
+    int         tariffNum;
+    int         tariffType;
+    int         usersNum;
+    std::string uname;
+    int         dirNum;
+    std::string dirName[DIR_NUM];
+};
+typedef void (* CALLBACK)(bool result, const std::string & reason, const INFO & info, void * data);
+
+} // namespace SERVER_INFO
+} // namespace STG
+
 #endif