]> git.stg.codes - stg.git/blob - stglibs/srvconf.lib/include/stg/servconf_types.h
Moved AUTH_BY parser from global scope.
[stg.git] / stglibs / srvconf.lib / include / stg / servconf_types.h
1 /*
2  *    This program is free software; you can redistribute it and/or modify
3  *    it under the terms of the GNU General Public License as published by
4  *    the Free Software Foundation; either version 2 of the License, or
5  *    (at your option) any later version.
6  *
7  *    This program is distributed in the hope that it will be useful,
8  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
9  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  *    GNU General Public License for more details.
11  *
12  *    You should have received a copy of the GNU General Public License
13  *    along with this program; if not, write to the Free Software
14  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
15  */
16
17 /*
18  *    Author : Maxim Mamontov <faust@stargazer.dp.ua>
19  */
20
21 #ifndef __STG_STGLIBS_SRVCONF_TYPES_H__
22 #define __STG_STGLIBS_SRVCONF_TYPES_H__
23
24 #include <string>
25 #include <vector>
26
27 #define  STG_HEADER     "SG04"
28 #define  OK_HEADER      "OKHD"
29 #define  ERR_HEADER     "ERHD"
30 #define  OK_LOGIN       "OKLG"
31 #define  ERR_LOGIN      "ERLG"
32 #define  OK_LOGINS      "OKLS"
33 #define  ERR_LOGINS     "ERLS"
34
35 #define  ENC_MSG_LEN    (8)
36
37 namespace STG
38 {
39
40 enum status
41 {
42 st_ok = 0,
43 st_conn_fail,
44 st_send_fail,
45 st_recv_fail,
46 st_header_err,
47 st_login_err,
48 st_logins_err,
49 st_data_err,
50 st_unknown_err,
51 st_dns_err,
52 st_xml_parse_error,
53 st_data_error
54 };
55
56 enum CONF_STATE
57 {
58 confHdr = 0,
59 confLogin,
60 confLoginCipher,
61 confData
62 };
63
64 namespace AUTH_BY
65 {
66
67 typedef std::vector<std::string> INFO;
68 typedef void (* CALLBACK)(bool result, const std::string & reason, const INFO & info, void * data);
69
70 } // namespace AUTH_BY
71 } // namespace STG
72
73 #endif