meanwhile  1.0.2
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/glist.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 
43  mwMessage_LOGIN = 0x0001,
56  mwMessage_ADMIN = 0x0019,
57  mwMessage_ANNOUNCE = 0x0022,
58 };
59 
60 
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 
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 
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 
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 
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;
143 };
144 
145 
146 /* 8.4.1.4 LoginAck */
147 
149  struct mwMessage head;
153 };
154 
155 
156 /* 8.4.1.5 LoginCont */
157 
159  struct mwMessage head;
160 };
161 
162 
163 /* 8.4.1.6 AuthPassed */
164 
166  struct mwMessage head;
167  char *host;
168  char *server_id;
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 
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;
196 };
197 
198 
199 /* 8.4.1.8 AcceptCnl */
200 
203  guint16 mode;
204  struct mwEncryptItem *item;
205  guint16 extra;
206  gboolean flag;
207 };
208 
209 
211  struct mwMessage head;
212  guint32 service;
213  guint32 proto_type;
214  guint32 proto_ver;
215  struct mwOpaque addtl;
216  gboolean acceptor_flag;
219 };
220 
221 
222 /* 8.4.1.9 SendOnCnl */
223 
225  struct mwMessage head;
226 
229  guint16 type;
230 
232  struct mwOpaque data;
233 };
234 
235 
236 /* 8.4.1.10 DestroyCnl */
237 
239  struct mwMessage head;
240  guint32 reason;
241  struct mwOpaque data;
242 };
243 
244 
245 /* 8.4.1.11 SetUserStatus */
246 
248  struct mwMessage head;
250 };
251 
252 
253 /* 8.4.1.12 SetPrivacyList */
254 
256  struct mwMessage head;
258 };
259 
260 
261 /* Sense Service */
262 
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 
285  struct mwMessage head;
286  gboolean sender_present;
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