meanwhile 1.1.1
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
30extern "C" {
31#endif
32
33
36#define MW_MESSAGE(msg) (&msg->head)
37
38
43 mwMessage_LOGIN = 0x0001,
56 mwMessage_ADMIN = 0x0019,
58};
59
60
64};
65
66
68#define MW_MESSAGE_HAS_OPTION(msg, opt) \
69 ((msg)->options & (opt))
70
71
72struct mwMessage {
73 guint16 type;
74 guint16 options;
75 guint32 channel;
77};
78
79
80
83
84
87
88
89void mwMessage_put(struct mwPutBuffer *b, struct mwMessage *msg);
90
91
92void 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
101 guint16 major;
102 guint16 minor;
104 guint16 login_type;
106 guint16 unknown_a;
107 guint32 unknown_b;
109};
110
111
112/* 8.4.1.2 HandshakeAck */
113
116 guint16 major;
117 guint16 minor;
119 guint32 magic;
120 struct mwOpaque data;
121};
122
123
124/* 8.3.7 Authentication Types */
125
132};
133
134
135/* 8.4.1.3 Login */
136
139 guint16 login_type;
140 char *name;
141 guint16 auth_type;
143};
144
145
146/* 8.4.1.4 LoginAck */
147
153};
154
155
156/* 8.4.1.5 LoginCont */
157
160};
161
162
163/* 8.4.1.6 AuthPassed */
164
167 char *host;
169};
170
171
172/* 8.4.1.7 CreateCnl */
173
176 guint16 mode;
177 GList *items;
178 guint16 extra;
179 gboolean flag;
180};
181
182
185 guint32 reserved;
186 guint32 channel;
188 guint32 service;
189 guint32 proto_type;
190 guint32 proto_ver;
191 guint32 options;
193 gboolean creator_flag;
196};
197
198
199/* 8.4.1.8 AcceptCnl */
200
203 guint16 mode;
205 guint16 extra;
206 gboolean flag;
207};
208
209
212 guint32 service;
213 guint32 proto_type;
214 guint32 proto_ver;
216 gboolean acceptor_flag;
219};
220
221
222/* 8.4.1.9 SendOnCnl */
223
226
229 guint16 type;
230
233};
234
235
236/* 8.4.1.10 DestroyCnl */
237
240 guint32 reason;
241 struct mwOpaque data;
242};
243
244
245/* 8.4.1.11 SetUserStatus */
246
250};
251
252
253/* 8.4.1.12 SetPrivacyList */
254
258};
259
260
261/* Sense Service */
262
268 guint32 service;
269};
270
271
272/* Admin */
273
277 char *text;
278};
279
280
281/* Announce */
282
286 gboolean sender_present;
288 guint16 unknown_a;
289 gboolean may_reply;
290 char *text;
296};
297
298
299#ifdef __cplusplus
300}
301#endif
302
303
304#endif /* _MW_MESSAGE_H */
305
Common data types and functions for handling those types.
void mwMessage_put(struct mwPutBuffer *b, struct mwMessage *msg)
struct mwMessage * mwMessage_get(struct mwGetBuffer *b)
build a message from its representation
mwMessageOption
Definition mw_message.h:61
@ mwMessageOption_HAS_ATTRIBS
message has attributes
Definition mw_message.h:63
@ mwMessageOption_ENCRYPT
message data is encrypted
Definition mw_message.h:62
mwMessageType
Indicates the type of a message.
Definition mw_message.h:40
@ mwMessage_CHANNEL_ACCEPT
mwMsgChannelAccept
Definition mw_message.h:51
@ mwMessage_HANDSHAKE
mwMsgHandshake
Definition mw_message.h:41
@ mwMessage_CHANNEL_CREATE
mwMsgChannelCreate
Definition mw_message.h:48
@ mwMessage_ADMIN
mwMsgAdmin
Definition mw_message.h:56
@ mwMessage_SENSE_SERVICE
mwMsgSenseService
Definition mw_message.h:55
@ mwMessage_CHANNEL_DESTROY
mwMsgChannelDestroy
Definition mw_message.h:49
@ mwMessage_LOGIN_ACK
mwMsgLoginAck
Definition mw_message.h:44
@ mwMessage_LOGIN_REDIRECT
mwMsgLoginRedirect
Definition mw_message.h:45
@ mwMessage_SET_USER_STATUS
mwMsgSetUserStatus
Definition mw_message.h:53
@ mwMessage_HANDSHAKE_ACK
mwMsgHandshakeAck
Definition mw_message.h:42
@ mwMessage_ANNOUNCE
mwMsgAnnounce
Definition mw_message.h:57
@ mwMessage_LOGIN
mwMsgLogin
Definition mw_message.h:43
@ mwMessage_LOGIN_CONTINUE
mwMsgLoginContinue
Definition mw_message.h:46
@ mwMessage_SET_PRIVACY_LIST
mwMsgSetPrivacyList
Definition mw_message.h:54
@ mwMessage_CHANNEL_SEND
mwMsgChannelSend
Definition mw_message.h:50
void mwMessage_free(struct mwMessage *msg)
mwAuthType
Definition mw_message.h:126
@ mwAuthType_ENCRYPT
Definition mw_message.h:129
@ mwAuthType_RC2_40
Definition mw_message.h:130
@ mwAuthType_RC2_128
Definition mw_message.h:131
@ mwAuthType_PLAIN
Definition mw_message.h:127
@ mwAuthType_TOKEN
Definition mw_message.h:128
struct mwMessage * mwMessage_new(enum mwMessageType type)
Allocate and initialize a new message of the specified type.
a selected encryption item from those offered
Definition mw_message.h:202
guint16 extra
encryption mode again?
Definition mw_message.h:205
gboolean flag
unknown flag
Definition mw_message.h:206
guint16 mode
encryption mode
Definition mw_message.h:203
struct mwEncryptItem * item
chosen mwEncryptItem (optional)
Definition mw_message.h:204
encryption blocks
Definition mw_common.h:220
an offer of encryption items
Definition mw_message.h:175
guint16 mode
encryption mode
Definition mw_message.h:176
guint16 extra
encryption mode again?
Definition mw_message.h:178
gboolean flag
unknown flag
Definition mw_message.h:179
GList * items
list of mwEncryptItem offered
Definition mw_message.h:177
buffer to be read from
Definition mw_common.h:178
Definition mw_common.h:123
Definition mw_message.h:72
struct mwOpaque attribs
optional message attributes
Definition mw_message.h:76
guint16 type
Definition mw_message.h:73
guint16 options
Definition mw_message.h:74
guint32 channel
ID of channel message is intended for.
Definition mw_message.h:75
An administrative broadcast message.
Definition mw_message.h:275
char * text
Definition mw_message.h:277
struct mwMessage head
Definition mw_message.h:276
An announcement between users.
Definition mw_message.h:284
struct mwMessage head
Definition mw_message.h:285
gboolean sender_present
indicates presence of sender data
Definition mw_message.h:286
guint16 unknown_a
unknown A.
Definition mw_message.h:288
struct mwLoginInfo sender
who sent the announcement
Definition mw_message.h:287
gboolean may_reply
replies allowed
Definition mw_message.h:289
GList * recipients
list of (char *) indicating recipients.
Definition mw_message.h:295
char * text
text of message
Definition mw_message.h:290
Definition mw_message.h:210
guint32 proto_ver
protocol version for the service
Definition mw_message.h:214
struct mwEncryptAccept encrypt
Definition mw_message.h:218
gboolean acceptor_flag
indicate presence of acceptor information
Definition mw_message.h:216
struct mwOpaque addtl
service-specific additional data
Definition mw_message.h:215
struct mwMessage head
Definition mw_message.h:211
guint32 service
ID for the channel's service.
Definition mw_message.h:212
struct mwLoginInfo acceptor
Definition mw_message.h:217
guint32 proto_type
protocol type for the service
Definition mw_message.h:213
Definition mw_message.h:183
struct mwIdBlock target
User ID.
Definition mw_message.h:187
guint32 reserved
unknown reserved data
Definition mw_message.h:185
guint32 service
ID for the target service.
Definition mw_message.h:188
guint32 channel
intended ID for new channel
Definition mw_message.h:186
guint32 proto_type
protocol type for the service
Definition mw_message.h:189
guint32 options
options
Definition mw_message.h:191
struct mwEncryptOffer encrypt
Definition mw_message.h:195
guint32 proto_ver
protocol version for the service
Definition mw_message.h:190
struct mwMessage head
Definition mw_message.h:184
struct mwLoginInfo creator
Definition mw_message.h:194
gboolean creator_flag
indicate presence of creator information
Definition mw_message.h:193
struct mwOpaque addtl
service-specific additional data
Definition mw_message.h:192
Definition mw_message.h:238
struct mwMessage head
Definition mw_message.h:239
struct mwOpaque data
additional information
Definition mw_message.h:241
guint32 reason
reason for closing the channel.
Definition mw_message.h:240
Definition mw_message.h:224
guint16 type
message type.
Definition mw_message.h:229
struct mwMessage head
Definition mw_message.h:225
struct mwOpaque data
protocol data to be interpreted by the handling service
Definition mw_message.h:232
Definition mw_message.h:114
struct mwOpaque data
server's DH public key for auth
Definition mw_message.h:120
guint16 major
server's major version number
Definition mw_message.h:116
guint32 srvrcalc_addr
server-calculated address
Definition mw_message.h:118
struct mwMessage head
Definition mw_message.h:115
guint16 minor
server's minor version number
Definition mw_message.h:117
guint32 magic
four bytes of something
Definition mw_message.h:119
Definition mw_message.h:99
guint16 minor
client's minor version number
Definition mw_message.h:102
guint32 loclcalc_addr
local public IP
Definition mw_message.h:105
guint32 srvrcalc_addr
0.0.0.0
Definition mw_message.h:103
guint16 major
client's major version number
Definition mw_message.h:101
guint32 unknown_b
normally 0x00000000
Definition mw_message.h:107
guint16 login_type
Definition mw_message.h:104
char * local_host
name of client host
Definition mw_message.h:108
struct mwMessage head
Definition mw_message.h:100
guint16 unknown_a
normally 0x0100
Definition mw_message.h:106
Definition mw_message.h:148
struct mwUserStatus status
Definition mw_message.h:152
struct mwLoginInfo login
Definition mw_message.h:150
struct mwMessage head
Definition mw_message.h:149
struct mwPrivacyInfo privacy
Definition mw_message.h:151
Definition mw_message.h:158
struct mwMessage head
Definition mw_message.h:159
Definition mw_message.h:165
char * host
Definition mw_message.h:167
struct mwMessage head
Definition mw_message.h:166
char * server_id
Definition mw_message.h:168
Definition mw_message.h:137
guint16 auth_type
Definition mw_message.h:141
struct mwMessage head
Definition mw_message.h:138
guint16 login_type
Definition mw_message.h:139
char * name
user identification
Definition mw_message.h:140
struct mwOpaque auth_data
authentication data
Definition mw_message.h:142
Sent to the server to request the presense of a service by its ID.
Definition mw_message.h:266
guint32 service
Definition mw_message.h:268
struct mwMessage head
Definition mw_message.h:267
Definition mw_message.h:255
struct mwPrivacyInfo privacy
Definition mw_message.h:257
struct mwMessage head
Definition mw_message.h:256
Definition mw_message.h:247
struct mwMessage head
Definition mw_message.h:248
struct mwUserStatus status
Definition mw_message.h:249
A length of binary data, not null-terminated.
Definition mw_common.h:79
Definition mw_common.h:146
buffer to be written to
Definition mw_common.h:169