1 
2 /*
3   Meanwhile - Unofficial Lotus Sametime Community Client Library
4   Copyright (C) 2004  Christopher (siege) O'Brien
5 
6   This library is free software; you can redistribute it and/or
7   modify it under the terms of the GNU Library General Public
8   License as published by the Free Software Foundation; either
9   version 2 of the License, or (at your option) any later version.
10 
11   This library is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   Library General Public License for more details.
15 
16   You should have received a copy of the GNU Library General Public
17   License along with this library; if not, write to the Free
18   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20 
21 #ifndef _MW_ERROR_H
22 #define _MW_ERROR_H
23 
24 
25 /** @file mw_error.h
26 
27     Common error code constants used by Meanwhile.
28 
29     Not all of these error codes (or even many, really) will ever
30     actually appear from Meanwhile. These are taken directly from the
31     houri draft, along with the minimal explanation for each.
32 */
33 
34 
35 #include <glib.h>
36 
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 
43 /** reference to a new string appropriate for the given error code.*/
44 char* mwError(guint32 code);
45 
46 
47 /* 8.3 Constants */
48 /* 8.3.1 Error Codes */
49 /* 8.3.1.1 General error/success codes */
50 
51 /** @enum ERR_GENERAL
52     general error codes */
53 enum ERR_GENERAL {
54   ERR_SUCCESS                = 0x00000000,
55   ERR_FAILURE                = 0x80000000,
56   ERR_REQUEST_DELAY          = 0x00000001,
57   ERR_REQUEST_INVALID        = 0x80000001,
58   ERR_NOT_LOGGED_IN          = 0x80000002,
59   ERR_NOT_AUTHORIZED         = 0x80000003,
60   ERR_ABORT                  = 0x80000004,
61   ERR_NO_ELEMENT             = 0x80000005,
62   ERR_NO_USER                = 0x80000006,
63   ERR_BAD_DATA               = 0x80000007,
64   ERR_NOT_IMPLEMENTED        = 0x80000008,
65   ERR_UNKNOWN_ERROR          = 0x80000009, /* what is this? */
66   ERR_STARVING               = 0x8000000a,
67   ERR_CHANNEL_NO_SUPPORT     = 0x8000000b,
68   ERR_CHANNEL_EXISTS         = 0x8000000c,
69   ERR_SERVICE_NO_SUPPORT     = 0x8000000d,
70   ERR_PROTOCOL_NO_SUPPORT    = 0x8000000e,
71   ERR_PROTOCOL_NO_SUPPORT2   = 0x8000000f, /* duplicate? */
72   ERR_VERSION_NO_SUPPORT     = 0x80000010,
73   ERR_USER_SKETCHY           = 0x80000011,
74   ERR_ALREADY_INITIALIZED    = 0x80000013,
75   ERR_NOT_OWNER              = 0x80000014,
76   ERR_TOKEN_INVALID          = 0x80000015,
77   ERR_TOKEN_EXPIRED          = 0x80000016,
78   ERR_TOKEN_IP_MISMATCH      = 0x80000017,
79   ERR_PORT_IN_USE            = 0x80000018,
80   ERR_NETWORK_DEAD           = 0x80000019,
81   ERR_NO_MASTER_CHANNEL      = 0x8000001a,
82   ERR_ALREADY_SUBSCRIBED     = 0x8000001b,
83   ERR_NOT_SUBSCRIBED         = 0x8000001c,
84   ERR_ENCRYPT_NO_SUPPORT     = 0x8000001d,
85   ERR_ENCRYPT_UNINITIALIZED  = 0x8000001e,
86   ERR_ENCRYPT_UNACCEPTABLE   = 0x8000001f,
87   ERR_ENCRYPT_INVALID        = 0x80000020,
88   ERR_NO_COMMON_ENCRYPT      = 0x80000021,
89   ERR_CHANNEL_DESTROYED      = 0x80000022,
90   ERR_CHANNEL_REDIRECTED     = 0x80000023
91 };
92 
93 
94 /* 8.3.1.2 Connection/disconnection errors */
95 
96 #define VERSION_MISMATCH     0x80000200
97 #define INSUF_BUFFER         0x80000201
98 #define NOT_IN_USE           0x80000202
99 #define INSUF_SOCKET         0x80000203
100 #define HARDWARE_ERROR       0x80000204
101 #define NETWORK_DOWN         0x80000205
102 #define HOST_DOWN            0x80000206
103 #define HOST_UNREACHABLE     0x80000207
104 #define TCPIP_ERROR          0x80000208
105 #define FAT_MESSAGE          0x80000209
106 #define PROXY_ERROR          0x8000020A
107 #define SERVER_FULL          0x8000020B
108 #define SERVER_NORESPOND     0x8000020C
109 #define CANT_CONNECT         0x8000020D
110 #define USER_REMOVED         0x8000020E
111 #define PROTOCOL_ERROR       0x8000020F
112 #define USER_RESTRICTED      0x80000210
113 #define INCORRECT_LOGIN      0x80000211
114 #define ENCRYPT_MISMATCH     0x80000212
115 #define USER_UNREGISTERED    0x80000213
116 #define VERIFICATION_DOWN    0x80000214
117 #define USER_TOO_IDLE        0x80000216
118 #define GUEST_IN_USE         0x80000217
119 #define USER_EXISTS          0x80000218
120 #define USER_RE_LOGIN        0x80000219
121 #define BAD_NAME             0x8000021A
122 #define REG_MODE_NS          0x8000021B
123 #define WRONG_USER_PRIV      0x8000021C
124 #define NEED_EMAIL           0x8000021D
125 #define DNS_ERROR            0x8000021E
126 #define DNS_FATAL_ERROR      0x8000021F
127 #define DNS_NOT_FOUND        0x80000220
128 #define CONNECTION_BROKEN    0x80000221
129 #define CONNECTION_ABORTED   0x80000222
130 #define CONNECTION_REFUSED   0x80000223
131 #define CONNECTION_RESET     0x80000224
132 #define CONNECTION_TIMED     0x80000225
133 #define CONNECTION_CLOSED    0x80000226
134 #define MULTI_SERVER_LOGIN   0x80000227
135 #define MULTI_SERVER_LOGIN2  0x80000228
136 #define MULTI_LOGIN_COMP     0x80000229
137 #define MUTLI_LOGIN_ALREADY  0x8000022A
138 #define SERVER_BROKEN        0x8000022B
139 #define SERVER_PATH_OLD      0x8000022C
140 #define APPLET_LOGOUT        0x8000022D
141 
142 
143 /* 8.3.1.3 Client error codes */
144 
145 /** @enum ERR_CLIENT
146     Client error codes */
147 enum ERR_CLIENT {
148   ERR_CLIENT_USER_GONE       = 0x80002000, /* user isn't here */
149   ERR_CLIENT_USER_DND        = 0x80002001, /* user is DND */
150   ERR_CLIENT_USER_ELSEWHERE  = 0x80002002, /* already logged in elsewhere */
151 };
152 
153 
154 /* 8.3.1.4 IM error codes */
155 
156 /** @enum ERR_IM
157     IM error codes */
158 enum ERR_IM {
159   ERR_IM_COULDNT_REGISTER    = 0x80002003,
160   ERR_IM_ALREADY_REGISTERED  = 0x80002004,
161 
162   /** apparently, this is used to mean that the requested feature (per
163       the channel create addtl data) is not supported by the client on
164       the other end of the IM channel */
165   ERR_IM_NOT_REGISTERED      = 0x80002005,
166 };
167 
168 
169 #ifdef __cplusplus
170 }
171 #endif
172 
173 
174 #endif /* _MW_ERROR_H */
175