meanwhile
1.0.2
Main Page
Related Pages
Data Structures
Files
File List
Globals
src
mw_message.h
Go to the documentation of this file.
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_MESSAGE_H
22
#define _MW_MESSAGE_H
23
24
25
#include <glib.h>
26
#include "
mw_common.h
"
27
28
29
#ifdef __cplusplus
30
extern
"C"
{
31
#endif
32
33
36
#define MW_MESSAGE(msg) (&msg->head)
37
38
40
enum
mwMessageType
{
41
mwMessage_HANDSHAKE
= 0x0000,
42
mwMessage_HANDSHAKE_ACK
= 0x8000,
43
mwMessage_LOGIN
= 0x0001,
44
mwMessage_LOGIN_ACK
= 0x8001,
45
mwMessage_LOGIN_REDIRECT
= 0x0018,
46
mwMessage_LOGIN_CONTINUE
= 0x0016,
48
mwMessage_CHANNEL_CREATE
= 0x0002,
49
mwMessage_CHANNEL_DESTROY
= 0x0003,
50
mwMessage_CHANNEL_SEND
= 0x0004,
51
mwMessage_CHANNEL_ACCEPT
= 0x0006,
53
mwMessage_SET_USER_STATUS
= 0x0009,
54
mwMessage_SET_PRIVACY_LIST
= 0x000b,
55
mwMessage_SENSE_SERVICE
= 0x0011,
56
mwMessage_ADMIN
= 0x0019,
57
mwMessage_ANNOUNCE
= 0x0022,
58
};
59
60
61
enum
mwMessageOption
{
62
mwMessageOption_ENCRYPT
= 0x4000,
63
mwMessageOption_HAS_ATTRIBS
= 0x8000,
64
};
65
66
68
#define MW_MESSAGE_HAS_OPTION(msg, opt) \
69
((msg)->options & (opt))
70
71
72
struct
mwMessage
{
73
guint16
type
;
74
guint16
options
;
75
guint32
channel
;
76
struct
mwOpaque
attribs
;
77
};
78
79
80
82
struct
mwMessage
*
mwMessage_new
(
enum
mwMessageType
type
);
83
84
86
struct
mwMessage
*
mwMessage_get
(
struct
mwGetBuffer
*b);
87
88
89
void
mwMessage_put
(
struct
mwPutBuffer
*b,
struct
mwMessage
*msg);
90
91
92
void
mwMessage_free
(
struct
mwMessage
*msg);
93
94
95
/* 8.4 Messages */
96
/* 8.4.1 Basic Community Messages */
97
/* 8.4.1.1 Handshake */
98
99
struct
mwMsgHandshake
{
100
struct
mwMessage
head
;
101
guint16
major
;
102
guint16
minor
;
103
guint32
srvrcalc_addr
;
104
guint16
login_type
;
105
guint32
loclcalc_addr
;
106
guint16
unknown_a
;
107
guint32
unknown_b
;
108
char
*
local_host
;
109
};
110
111
112
/* 8.4.1.2 HandshakeAck */
113
114
struct
mwMsgHandshakeAck
{
115
struct
mwMessage
head
;
116
guint16
major
;
117
guint16
minor
;
118
guint32
srvrcalc_addr
;
119
guint32
magic
;
120
struct
mwOpaque
data
;
121
};
122
123
124
/* 8.3.7 Authentication Types */
125
126
enum
mwAuthType
{
127
mwAuthType_PLAIN
= 0x0000,
128
mwAuthType_TOKEN
= 0x0001,
129
mwAuthType_ENCRYPT
= 0x0002,
130
mwAuthType_RC2_40
= 0x0002,
131
mwAuthType_RC2_128
= 0x0004,
132
};
133
134
135
/* 8.4.1.3 Login */
136
137
struct
mwMsgLogin
{
138
struct
mwMessage
head
;
139
guint16
login_type
;
140
char
*
name
;
141
guint16
auth_type
;
142
struct
mwOpaque
auth_data
;
143
};
144
145
146
/* 8.4.1.4 LoginAck */
147
148
struct
mwMsgLoginAck
{
149
struct
mwMessage
head
;
150
struct
mwLoginInfo
login
;
151
struct
mwPrivacyInfo
privacy
;
152
struct
mwUserStatus
status
;
153
};
154
155
156
/* 8.4.1.5 LoginCont */
157
158
struct
mwMsgLoginContinue
{
159
struct
mwMessage
head
;
160
};
161
162
163
/* 8.4.1.6 AuthPassed */
164
165
struct
mwMsgLoginRedirect
{
166
struct
mwMessage
head
;
167
char
*
host
;
168
char
*
server_id
;
169
};
170
171
172
/* 8.4.1.7 CreateCnl */
173
175
struct
mwEncryptOffer
{
176
guint16
mode
;
177
GList *
items
;
178
guint16
extra
;
179
gboolean
flag
;
180
};
181
182
183
struct
mwMsgChannelCreate
{
184
struct
mwMessage
head
;
185
guint32
reserved
;
186
guint32
channel
;
187
struct
mwIdBlock
target
;
188
guint32
service
;
189
guint32
proto_type
;
190
guint32
proto_ver
;
191
guint32
options
;
192
struct
mwOpaque
addtl
;
193
gboolean
creator_flag
;
194
struct
mwLoginInfo
creator
;
195
struct
mwEncryptOffer
encrypt
;
196
};
197
198
199
/* 8.4.1.8 AcceptCnl */
200
202
struct
mwEncryptAccept
{
203
guint16
mode
;
204
struct
mwEncryptItem
*
item
;
205
guint16
extra
;
206
gboolean
flag
;
207
};
208
209
210
struct
mwMsgChannelAccept
{
211
struct
mwMessage
head
;
212
guint32
service
;
213
guint32
proto_type
;
214
guint32
proto_ver
;
215
struct
mwOpaque
addtl
;
216
gboolean
acceptor_flag
;
217
struct
mwLoginInfo
acceptor
;
218
struct
mwEncryptAccept
encrypt
;
219
};
220
221
222
/* 8.4.1.9 SendOnCnl */
223
224
struct
mwMsgChannelSend
{
225
struct
mwMessage
head
;
226
229
guint16
type
;
230
232
struct
mwOpaque
data
;
233
};
234
235
236
/* 8.4.1.10 DestroyCnl */
237
238
struct
mwMsgChannelDestroy
{
239
struct
mwMessage
head
;
240
guint32
reason
;
241
struct
mwOpaque
data
;
242
};
243
244
245
/* 8.4.1.11 SetUserStatus */
246
247
struct
mwMsgSetUserStatus
{
248
struct
mwMessage
head
;
249
struct
mwUserStatus
status
;
250
};
251
252
253
/* 8.4.1.12 SetPrivacyList */
254
255
struct
mwMsgSetPrivacyList
{
256
struct
mwMessage
head
;
257
struct
mwPrivacyInfo
privacy
;
258
};
259
260
261
/* Sense Service */
262
266
struct
mwMsgSenseService
{
267
struct
mwMessage
head
;
268
guint32
service
;
269
};
270
271
272
/* Admin */
273
275
struct
mwMsgAdmin
{
276
struct
mwMessage
head
;
277
char
*
text
;
278
};
279
280
281
/* Announce */
282
284
struct
mwMsgAnnounce
{
285
struct
mwMessage
head
;
286
gboolean
sender_present
;
287
struct
mwLoginInfo
sender
;
288
guint16
unknown_a
;
289
gboolean
may_reply
;
290
char
*
text
;
295
GList *
recipients
;
296
};
297
298
299
#ifdef __cplusplus
300
}
301
#endif
302
303
304
#endif
/* _MW_MESSAGE_H */
305
Generated on Fri Oct 5 2012 11:40:14 for meanwhile by
1.8.1.2