Mercurial > pidgin
annotate src/protocols/oscar/aim.h @ 11369:ab0fa7cd61cc
[gaim-migrate @ 13593]
Bring all the changes to OSCAR file transfers from oldstatus to HEAD.
Add documentation resulting from my Summer of Code project to CVS including
the original editable files (in OpenOffice.org 2.0 format).
committer: Tailor Script <tailor@pidgin.im>
author | Jonathan Clark <ardentlygnarly> |
---|---|
date | Tue, 30 Aug 2005 05:21:58 +0000 |
parents | 17142948653e |
children | 48244c196228 |
rev | line source |
---|---|
8978 | 1 /* |
2086 | 2 * Main libfaim header. Must be included in client for prototypes/macros. |
3 * | |
4 * "come on, i turned a chick lesbian; i think this is the hackish equivalent" | |
4194 | 5 * -- Josh Myer |
2086 | 6 * |
7 */ | |
8 | |
9 #ifndef __AIM_H__ | |
10 #define __AIM_H__ | |
11 | |
11159 | 12 #include "aim_cbtypes.h" |
2086 | 13 |
11253 | 14 #include "debug.h" |
11159 | 15 #include "internal.h" |
2086 | 16 |
17 #include <stdio.h> | |
18 #include <string.h> | |
19 #include <fcntl.h> | |
20 #include <sys/types.h> | |
21 #include <stdlib.h> | |
22 #include <stdarg.h> | |
23 #include <errno.h> | |
24 #include <time.h> | |
25 | |
3630 | 26 #ifndef _WIN32 |
2086 | 27 #include <sys/time.h> |
28 #include <unistd.h> | |
4617 | 29 #include <netdb.h> |
2086 | 30 #include <netinet/in.h> |
31 #include <sys/socket.h> | |
3630 | 32 #else |
8244
5e7ffea3f76a
[gaim-migrate @ 8967]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
8240
diff
changeset
|
33 #include "libc_interface.h" |
2086 | 34 #endif |
35 | |
6322 | 36 #ifdef __cplusplus |
37 extern "C" { | |
38 #endif | |
39 | |
11185 | 40 /* TODO: Remove these three typedefs and use guints everywhere. */ |
41 typedef guint8 fu8_t; | |
42 typedef guint16 fu16_t; | |
43 typedef guint32 fu32_t; | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
44 |
11185 | 45 typedef guint32 aim_snacid_t; |
46 typedef guint16 flap_seqnum_t; | |
2086 | 47 |
11338 | 48 #define WIN32_STATIC |
2086 | 49 #if defined(_WIN32) && !defined(WIN32_STATIC) |
50 /* | |
51 * For a win32 DLL, we define WIN32_INDLL if this file | |
11338 | 52 * is included while compiling the DLL. If it's not |
53 * defined (it's included in a client app), the symbols | |
2086 | 54 * will be imported instead of exported. |
55 */ | |
56 #ifdef WIN32_INDLL | |
57 #define faim_export __declspec(dllexport) | |
11369 | 58 #else |
2086 | 59 #define faim_export __declspec(dllimport) |
60 #endif /* WIN32_INDLL */ | |
61 #define faim_internal | |
62 #else | |
63 /* | |
64 * Nothing normally needed for unix... | |
65 */ | |
66 #define faim_export | |
67 #define faim_internal | |
68 #endif | |
69 | |
6322 | 70 #ifndef FALSE |
71 #define FALSE (0) | |
72 #endif | |
73 | |
4901 | 74 #ifndef TRUE |
6322 | 75 #define TRUE (!FALSE) |
4901 | 76 #endif |
77 | |
11338 | 78 #define FAIM_SNAC_HASH_SIZE 16 |
79 | |
80 /* | |
81 * Current Maximum Length for Screen Names (not including NULL) | |
2086 | 82 * |
83 * Currently only names up to 16 characters can be registered | |
8735
92cbf9713795
[gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents:
8708
diff
changeset
|
84 * however it is apparently legal for them to be larger. |
2086 | 85 */ |
4908 | 86 #define MAXSNLEN 97 |
2086 | 87 |
88 /* | |
89 * Current Maximum Length for Instant Messages | |
90 * | |
91 * This was found basically by experiment, but not wholly | |
92 * accurate experiment. It should not be regarded | |
93 * as completely correct. But its a decent approximation. | |
94 * | |
95 * Note that although we can send this much, its impossible | |
96 * for WinAIM clients (up through the latest (4.0.1957)) to | |
97 * send any more than 1kb. Amaze all your windows friends | |
98 * with utterly oversized instant messages! | |
99 * | |
100 * XXX: the real limit is the total SNAC size at 8192. Fix this. | |
101 * | |
102 */ | |
103 #define MAXMSGLEN 7987 | |
104 | |
105 /* | |
106 * Maximum size of a Buddy Icon. | |
107 */ | |
108 #define MAXICONLEN 7168 | |
109 #define AIM_ICONIDENT "AVT1picture.id" | |
110 | |
111 /* | |
112 * Current Maximum Length for Chat Room Messages | |
113 * | |
114 * This is actually defined by the protocol to be | |
115 * dynamic, but I have yet to see due cause to | |
116 * define it dynamically here. Maybe later. | |
117 * | |
118 */ | |
119 #define MAXCHATMSGLEN 512 | |
120 | |
5345 | 121 /** |
122 * Maximum length for the password of an ICQ account | |
123 */ | |
124 #define MAXICQPASSLEN 8 | |
125 | |
2086 | 126 #define AIM_MD5_STRING "AOL Instant Messenger (SM)" |
127 | |
128 /* | |
2821
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
129 * Client info. Filled in by the client and passed in to |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
130 * aim_send_login(). The information ends up getting passed to OSCAR |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
131 * through the initial login command. |
2086 | 132 * |
133 */ | |
134 struct client_info_s { | |
2821
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
135 const char *clientstring; |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
136 fu16_t clientid; |
4070 | 137 fu16_t major; |
138 fu16_t minor; | |
139 fu16_t point; | |
140 fu16_t build; | |
141 fu32_t distrib; | |
2821
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
142 const char *country; /* two-letter abbrev */ |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
143 const char *lang; /* two-letter abbrev */ |
2086 | 144 }; |
145 | |
4070 | 146 /* Needs to be checked */ |
3458 | 147 #define CLIENTINFO_AIM_3_5_1670 { \ |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
148 "AOL Instant Messenger (SM), version 3.5.1670/WIN32", \ |
2821
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
149 0x0004, \ |
4070 | 150 0x0003, 0x0005, \ |
151 0x0000, 0x0686, \ | |
152 0x0000002a, \ | |
153 "us", "en", \ | |
154 } | |
155 | |
156 /* Needs to be checked */ | |
157 /* Latest winaim without ssi */ | |
158 #define CLIENTINFO_AIM_4_1_2010 { \ | |
159 "AOL Instant Messenger (SM), version 4.1.2010/WIN32", \ | |
160 0x0004, \ | |
161 0x0004, 0x0001, \ | |
162 0x0000, 0x07da, \ | |
163 0x0000004b, \ | |
164 "us", "en", \ | |
165 } | |
166 | |
167 /* Needs to be checked */ | |
168 #define CLIENTINFO_AIM_4_3_2188 { \ | |
169 "AOL Instant Messenger (SM), version 4.3.2188/WIN32", \ | |
170 0x0109, \ | |
171 0x0400, 0x0003, \ | |
172 0x0000, 0x088c, \ | |
173 0x00000086, \ | |
174 "us", "en", \ | |
2086 | 175 } |
176 | |
4070 | 177 /* Needs to be checked */ |
178 #define CLIENTINFO_AIM_4_8_2540 { \ | |
179 "AOL Instant Messenger (SM), version 4.8.2540/WIN32", \ | |
180 0x0109, \ | |
181 0x0004, 0x0008, \ | |
182 0x0000, 0x09ec, \ | |
183 0x000000af, \ | |
184 "us", "en", \ | |
2086 | 185 } |
186 | |
4070 | 187 /* Needs to be checked */ |
3595 | 188 #define CLIENTINFO_AIM_5_0_2938 { \ |
4070 | 189 "AOL Instant Messenger, version 5.0.2938/WIN32", \ |
190 0x0109, \ | |
191 0x0005, 0x0000, \ | |
192 0x0000, 0x0b7a, \ | |
193 0x00000000, \ | |
194 "us", "en", \ | |
3595 | 195 } |
196 | |
4070 | 197 #define CLIENTINFO_AIM_5_1_3036 { \ |
198 "AOL Instant Messenger, version 5.1.3036/WIN32", \ | |
199 0x0109, \ | |
200 0x0005, 0x0001, \ | |
201 0x0000, 0x0bdc, \ | |
202 0x000000d2, \ | |
203 "us", "en", \ | |
204 } | |
205 | |
7253 | 206 #define CLIENTINFO_AIM_5_5_3415 { \ |
207 "AOL Instant Messenger, version 5.5.3415/WIN32", \ | |
208 0x0109, \ | |
209 0x0005, 0x0005, \ | |
210 0x0000, 0x0057, \ | |
211 0x000000ef, \ | |
212 "us", "en", \ | |
213 } | |
214 | |
10464 | 215 #define CLIENTINFO_AIM_5_9_3702 { \ |
216 "AOL Instant Messenger, version 5.9.3702/WIN32", \ | |
217 0x0109, \ | |
218 0x0005, 0x0009, \ | |
219 0x0000, 0x0e76, \ | |
220 0x00000111, \ | |
221 "us", "en", \ | |
222 } | |
223 | |
5917 | 224 #define CLIENTINFO_ICHAT_1_0 { \ |
225 "Apple iChat", \ | |
226 0x311a, \ | |
227 0x0001, 0x0000, \ | |
228 0x0000, 0x003c, \ | |
229 0x000000c6, \ | |
230 "us", "en", \ | |
231 } | |
232 | |
4070 | 233 /* Needs to be checked */ |
3458 | 234 #define CLIENTINFO_ICQ_4_65_3281 { \ |
235 "ICQ Inc. - Product of ICQ (TM) 2000b.4.65.1.3281.85", \ | |
236 0x010a, \ | |
4070 | 237 0x0004, 0x0041, \ |
238 0x0001, 0x0cd1, \ | |
239 0x00000055, \ | |
240 "us", "en", \ | |
3458 | 241 } |
242 | |
4070 | 243 /* Needs to be checked */ |
3458 | 244 #define CLIENTINFO_ICQ_5_34_3728 { \ |
245 "ICQ Inc. - Product of ICQ (TM).2002a.5.34.1.3728.85", \ | |
246 0x010a, \ | |
4070 | 247 0x0005, 0x0022, \ |
248 0x0001, 0x0e8f, \ | |
249 0x00000055, \ | |
250 "us", "en", \ | |
3458 | 251 } |
252 | |
4071 | 253 #define CLIENTINFO_ICQ_5_45_3777 { \ |
4070 | 254 "ICQ Inc. - Product of ICQ (TM).2003a.5.45.1.3777.85", \ |
255 0x010a, \ | |
256 0x0005, 0x002d, \ | |
257 0x0001, 0x0ec1, \ | |
258 0x00000055, \ | |
259 "us", "en", \ | |
260 } | |
261 | |
7313 | 262 #define CLIENTINFO_ICQBASIC_14_3_1068 { \ |
4070 | 263 "ICQBasic", \ |
264 0x010a, \ | |
265 0x0014, 0x0003, \ | |
266 0x0000, 0x042c, \ | |
267 0x0000043d, \ | |
268 "us", "en", \ | |
269 } | |
270 | |
7313 | 271 #define CLIENTINFO_NETSCAPE_7_0_1 { \ |
4317 | 272 "Netscape 2000 an approved user of AOL Instant Messenger (SM)", \ |
273 0x1d0d, \ | |
274 0x0007, 0x0000, \ | |
275 0x0001, 0x0000, \ | |
276 0x00000058, \ | |
277 "us", "en", \ | |
278 } | |
279 | |
4071 | 280 #define CLIENTINFO_AIM_KNOWNGOOD CLIENTINFO_AIM_5_1_3036 |
281 #define CLIENTINFO_ICQ_KNOWNGOOD CLIENTINFO_ICQ_5_45_3777 | |
2086 | 282 |
283 /* | |
284 * These could be arbitrary, but its easier to use the actual AIM values | |
285 */ | |
4617 | 286 #define AIM_CONN_TYPE_BOS 0x0002 |
287 #define AIM_CONN_TYPE_ADS 0x0005 | |
288 #define AIM_CONN_TYPE_AUTH 0x0007 | |
7806 | 289 #define AIM_CONN_TYPE_CHATNAV 0x000d |
4617 | 290 #define AIM_CONN_TYPE_CHAT 0x000e |
7806 | 291 #define AIM_CONN_TYPE_SEARCH 0x000f |
4804 | 292 #define AIM_CONN_TYPE_ICON 0x0010 |
4617 | 293 #define AIM_CONN_TYPE_EMAIL 0x0018 |
2086 | 294 |
4617 | 295 /* they start getting arbitrary for rendezvous stuff =) */ |
11369 | 296 #define AIM_CONN_TYPE_RENDEZVOUS_PROXY 0xfffd /* these speak a strange language */ |
4617 | 297 #define AIM_CONN_TYPE_RENDEZVOUS 0xfffe /* these do not speak FLAP! */ |
298 #define AIM_CONN_TYPE_LISTENER 0xffff /* socket waiting for accept() */ | |
2086 | 299 |
11369 | 300 /* Command types for doing a rendezvous proxy login |
301 * Thanks to Keith Lea and the Joust project for documenting these commands well */ | |
302 #define AIM_RV_PROXY_PACKETVER_DFLT 0x044a | |
303 #define AIM_RV_PROXY_ERROR 0x0001 | |
304 #define AIM_RV_PROXY_INIT_SEND 0x0002 /* First command sent when creating a connection */ | |
305 #define AIM_RV_PROXY_INIT_RECV 0x0004 /* First command sent when receiving existing connection */ | |
306 #define AIM_RV_PROXY_ACK 0x0003 | |
307 #define AIM_RV_PROXY_READY 0x0005 | |
308 | |
309 /* Number of bytes expected in each of the above packets, including the 2 bytes specifying length */ | |
310 #define AIM_RV_PROXY_ERROR_LEN 14 | |
311 #define AIM_RV_PROXY_INIT_SEND_LEN 55 | |
312 #define AIM_RV_PROXY_INIT_RECV_LEN 57 | |
313 #define AIM_RV_PROXY_ACK_LEN 18 | |
314 #define AIM_RV_PROXY_READY_LEN 12 | |
315 #define AIM_RV_PROXY_HDR_LEN 12 /* Bytes in just the header alone */ | |
316 | |
317 /* Default values for unknown/unused values in rendezvous proxy negotiation packets */ | |
318 #define AIM_RV_PROXY_SERVER_FLAGS 0x0220 /* Default flags sent by proxy server */ | |
319 #define AIM_RV_PROXY_CLIENT_FLAGS 0x0000 /* Default flags sent by client */ | |
320 #define AIM_RV_PROXY_UNKNOWNA_DFLT 0x00000000 /* Default value for an unknown block */ | |
321 #define AIM_RV_PROXY_SERVER_URL "ars.oscar.aol.com" | |
322 #define AIM_RV_PROXY_CONNECT_PORT 5190 /* The port we should always connect to */ | |
323 | |
324 /* What is the purpose of this transfer? (Who will end up with a new file?) | |
325 * These values are used in oft_info->send_or_recv */ | |
326 #define AIM_XFER_SEND 0x0001 | |
327 #define AIM_XFER_RECV 0x0002 | |
328 | |
329 /* Via what method is the data getting routed? | |
330 * These values are used in oft_info->method */ | |
331 #define AIM_XFER_DIRECT 0x0001 /* Direct connection; receiver connects to sender */ | |
332 #define AIM_XFER_REDIR 0x0002 /* Redirected connection; sender connects to receiver */ | |
333 #define AIM_XFER_PROXY 0x0003 /* Proxied connection */ | |
334 | |
335 /* Who requested the proxy? | |
336 * The difference between a stage 2 and stage 3 proxied transfer is that the receiver does the | |
337 * initial login for a stage 2, but the sender must do it for a stage 3. | |
338 * These values are used in oft_info->stage */ | |
339 #define AIM_XFER_PROXY_NONE 0x0001 | |
340 #define AIM_XFER_PROXY_STG1 0x0002 /* Sender requested a proxy be used (stage1) */ | |
341 #define AIM_XFER_PROXY_STG2 0x0003 /* Receiver requested a proxy be used (stage2) */ | |
342 #define AIM_XFER_PROXY_STG3 0x0004 /* Receiver requested a proxy be used (stage3) */ | |
343 | |
2086 | 344 /* |
345 * Subtypes, we need these for OFT stuff. | |
346 */ | |
4901 | 347 #define AIM_CONN_SUBTYPE_OFT_DIRECTIM 0x0001 |
348 #define AIM_CONN_SUBTYPE_OFT_GETFILE 0x0002 | |
349 #define AIM_CONN_SUBTYPE_OFT_SENDFILE 0x0003 | |
350 #define AIM_CONN_SUBTYPE_OFT_BUDDYICON 0x0004 | |
11369 | 351 #define AIM_CONN_SUBTYPE_OFT_VOICE 0x0005 |
2086 | 352 |
353 /* | |
354 * Status values returned from aim_conn_new(). ORed together. | |
355 */ | |
4901 | 356 #define AIM_CONN_STATUS_READY 0x0001 |
357 #define AIM_CONN_STATUS_INTERNALERR 0x0002 | |
358 #define AIM_CONN_STATUS_RESOLVERR 0x0040 | |
359 #define AIM_CONN_STATUS_CONNERR 0x0080 | |
360 #define AIM_CONN_STATUS_INPROGRESS 0x0100 | |
2086 | 361 |
4901 | 362 #define AIM_FRAMETYPE_FLAP 0x0000 |
363 #define AIM_FRAMETYPE_OFT 0x0001 | |
2086 | 364 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
365 typedef struct aim_conn_s { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
366 int fd; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
367 fu16_t type; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
368 fu16_t subtype; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
369 flap_seqnum_t seqnum; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
370 fu32_t status; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
371 void *priv; /* misc data the client may want to store */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
372 void *internal; /* internal conn-specific libfaim data */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
373 time_t lastactivity; /* time of last transmit */ |
11369 | 374 int forcedlatency; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
375 void *handlerlist; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
376 void *sessv; /* pointer to parent session */ |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
377 void *inside; /* only accessible from inside libfaim */ |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
378 struct aim_conn_s *next; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
379 } aim_conn_t; |
2086 | 380 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
381 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
382 * Byte Stream type. Sort of. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
383 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
384 * Use of this type serves a couple purposes: |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
385 * - Buffer/buflen pairs are passed all around everywhere. This turns |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
386 * that into one value, as well as abstracting it slightly. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
387 * - Through the abstraction, it is possible to enable bounds checking |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
388 * for robustness at the cost of performance. But a clean failure on |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
389 * weird packets is much better than a segfault. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
390 * - I like having variables named "bs". |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
391 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
392 * Don't touch the insides of this struct. Or I'll have to kill you. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
393 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
394 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
395 typedef struct aim_bstream_s { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
396 fu8_t *data; |
3033 | 397 fu32_t len; |
398 fu32_t offset; | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
399 } aim_bstream_t; |
2086 | 400 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
401 typedef struct aim_frame_s { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
402 fu8_t hdrtype; /* defines which piece of the union to use */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
403 union { |
11369 | 404 struct { |
7806 | 405 fu8_t channel; |
10021 | 406 flap_seqnum_t seqnum; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
407 } flap; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
408 struct { |
7806 | 409 fu8_t magic[4]; /* ODC2 or OFT2 */ |
3952 | 410 fu16_t hdrlen; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
411 fu16_t type; |
3952 | 412 } rend; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
413 } hdr; |
7806 | 414 aim_bstream_t data; /* payload stream */ |
415 aim_conn_t *conn; /* the connection it came in on/is going out on */ | |
416 fu8_t handled; /* 0 = new, !0 = been handled */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
417 struct aim_frame_s *next; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
418 } aim_frame_t; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
419 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
420 typedef struct aim_msgcookie_s { |
5556 | 421 fu8_t cookie[8]; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
422 int type; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
423 void *data; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
424 time_t addtime; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
425 struct aim_msgcookie_s *next; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
426 } aim_msgcookie_t; |
2086 | 427 |
428 /* | |
429 * AIM Session: The main client-data interface. | |
430 * | |
431 */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
432 typedef struct aim_session_s { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
433 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
434 /* ---- Client Accessible ------------------------ */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
435 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
436 /* Our screen name. */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
437 char sn[MAXSNLEN+1]; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
438 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
439 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
440 * Pointer to anything the client wants to |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
441 * explicitly associate with this session. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
442 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
443 * This is for use in the callbacks mainly. In any |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
444 * callback, you can access this with sess->aux_data. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
445 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
446 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
447 void *aux_data; |
2086 | 448 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
449 /* ---- Internal Use Only ------------------------ */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
450 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
451 /* Connection information */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
452 aim_conn_t *connlist; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
453 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
454 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
455 * Transmit/receive queues. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
456 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
457 * These are only used when you don't use your own lowlevel |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
458 * I/O. I don't suggest that you use libfaim's internal I/O. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
459 * Its really bad and the API/event model is quirky at best. |
11369 | 460 * |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
461 */ |
8982 | 462 aim_frame_t *queue_outgoing; |
10021 | 463 aim_frame_t *queue_incoming; |
2086 | 464 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
465 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
466 * Tx Enqueuing function. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
467 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
468 * This is how you override the transmit direction of libfaim's |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
469 * internal I/O. This function will be called whenever it needs |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
470 * to send something. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
471 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
472 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
473 int (*tx_enqueue)(struct aim_session_s *, aim_frame_t *); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
474 |
4901 | 475 void *modlistv; |
2086 | 476 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
477 struct { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
478 char server[128]; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
479 char username[128]; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
480 char password[128]; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
481 } socksproxy; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
482 |
10035 | 483 fu8_t nonblocking; |
2086 | 484 |
4901 | 485 /* |
11154 | 486 * Outstanding snac handling |
4901 | 487 * |
488 * XXX: Should these be per-connection? -mid | |
489 */ | |
490 void *snac_hash[FAIM_SNAC_HASH_SIZE]; | |
491 aim_snacid_t snacid_next; | |
492 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
493 aim_msgcookie_t *msgcookies; |
4624 | 494 struct aim_icq_info *icq_info; |
4826 | 495 struct aim_oft_info *oft_info; |
4901 | 496 struct aim_authresp_info *authinfo; |
7045 | 497 struct aim_emailinfo *emailinfo; |
498 | |
499 struct { | |
500 struct aim_userinfo_s *userinfo; | |
7466 | 501 struct userinfo_node *torequest; |
502 struct userinfo_node *requested; | |
7045 | 503 int waiting_for_response; |
504 } locate; | |
2086 | 505 |
4901 | 506 /* Server-stored information (ssi) */ |
507 struct { | |
508 int received_data; | |
509 fu16_t numitems; | |
510 struct aim_ssi_item *official; | |
511 struct aim_ssi_item *local; | |
512 struct aim_ssi_tmp *pending; | |
513 time_t timestamp; | |
514 int waiting_for_ack; | |
515 } ssi; | |
516 } aim_session_t; | |
2086 | 517 |
2507
1069b0940237
[gaim-migrate @ 2520]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2421
diff
changeset
|
518 /* Valid for calling aim_icq_setstatus() and for aim_userinfo_t->icqinfo.status */ |
11369 | 519 #define AIM_ICQ_STATE_NORMAL 0x00000000 |
520 #define AIM_ICQ_STATE_AWAY 0x00000001 | |
521 #define AIM_ICQ_STATE_DND 0x00000002 | |
522 #define AIM_ICQ_STATE_OUT 0x00000004 | |
523 #define AIM_ICQ_STATE_BUSY 0x00000010 | |
524 #define AIM_ICQ_STATE_CHAT 0x00000020 | |
525 #define AIM_ICQ_STATE_INVISIBLE 0x00000100 | |
526 #define AIM_ICQ_STATE_WEBAWARE 0x00010000 | |
527 #define AIM_ICQ_STATE_HIDEIP 0x00020000 | |
528 #define AIM_ICQ_STATE_BIRTHDAY 0x00080000 | |
4342 | 529 #define AIM_ICQ_STATE_DIRECTDISABLED 0x00100000 |
11369 | 530 #define AIM_ICQ_STATE_ICQHOMEPAGE 0x00200000 |
4342 | 531 #define AIM_ICQ_STATE_DIRECTREQUIREAUTH 0x10000000 |
532 #define AIM_ICQ_STATE_DIRECTCONTACTLIST 0x20000000 | |
2507
1069b0940237
[gaim-migrate @ 2520]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2421
diff
changeset
|
533 |
2086 | 534 /* |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
535 * Get command from connections |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
536 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
537 * aim_get_commmand() is the libfaim lowlevel I/O in the receive direction. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
538 * XXX Make this easily overridable. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
539 * |
2086 | 540 */ |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
541 faim_export int aim_get_command(aim_session_t *, aim_conn_t *); |
2086 | 542 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
543 /* |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
544 * Dispatch commands that are in the rx queue. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
545 */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
546 faim_export void aim_rxdispatch(aim_session_t *); |
2086 | 547 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
548 faim_export int aim_debugconn_sendconnect(aim_session_t *sess, aim_conn_t *conn); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
549 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
550 faim_export int aim_logoff(aim_session_t *); |
2086 | 551 |
10344 | 552 #if !defined(FAIM_INTERNAL) |
2086 | 553 /* the library should never call aim_conn_kill */ |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
554 faim_export void aim_conn_kill(aim_session_t *sess, aim_conn_t **deadconn); |
2086 | 555 #endif |
556 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
557 typedef int (*aim_rxcallback_t)(aim_session_t *, aim_frame_t *, ...); |
2086 | 558 |
4901 | 559 |
560 /* auth.c */ | |
2704 | 561 struct aim_clientrelease { |
562 char *name; | |
563 fu32_t build; | |
564 char *url; | |
565 char *info; | |
566 }; | |
567 | |
568 struct aim_authresp_info { | |
569 char *sn; | |
570 fu16_t errorcode; | |
571 char *errorurl; | |
572 fu16_t regstatus; | |
573 char *email; | |
574 char *bosip; | |
4293 | 575 fu16_t cookielen; |
2704 | 576 fu8_t *cookie; |
3912 | 577 char *chpassurl; |
2704 | 578 struct aim_clientrelease latestrelease; |
579 struct aim_clientrelease latestbeta; | |
580 }; | |
581 | |
2821
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
582 /* Callback data for redirect. */ |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
583 struct aim_redirect_data { |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
584 fu16_t group; |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
585 const char *ip; |
4293 | 586 fu16_t cookielen; |
2821
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
587 const fu8_t *cookie; |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
588 struct { /* group == AIM_CONN_TYPE_CHAT */ |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
589 fu16_t exchange; |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
590 const char *room; |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
591 fu16_t instance; |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
592 } chat; |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
593 }; |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
594 |
2672 | 595 faim_export int aim_clientready(aim_session_t *sess, aim_conn_t *conn); |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
596 faim_export int aim_sendflapver(aim_session_t *sess, aim_conn_t *conn); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
597 faim_export int aim_request_login(aim_session_t *sess, aim_conn_t *conn, const char *sn); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
598 faim_export int aim_send_login(aim_session_t *, aim_conn_t *, const char *, const char *, struct client_info_s *, const char *key); |
10464 | 599 /* 0x000b */ faim_export int aim_auth_securid_send(aim_session_t *sess, const char *securid); |
600 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
601 faim_export void aim_purge_rxqueue(aim_session_t *); |
4333 | 602 faim_export void aim_cleansnacs(aim_session_t *, int maxage); |
2086 | 603 |
604 #define AIM_TX_QUEUED 0 /* default */ | |
605 #define AIM_TX_IMMEDIATE 1 | |
606 #define AIM_TX_USER 2 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
607 faim_export int aim_tx_setenqueue(aim_session_t *sess, int what, int (*func)(aim_session_t *, aim_frame_t *)); |
2086 | 608 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
609 faim_export int aim_tx_flushqueue(aim_session_t *); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
610 faim_export void aim_tx_purgequeue(aim_session_t *); |
2086 | 611 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
612 faim_export int aim_conn_setlatency(aim_conn_t *conn, int newval); |
2086 | 613 |
5927 | 614 faim_export int aim_conn_addhandler(aim_session_t *, aim_conn_t *conn, fu16_t family, fu16_t type, aim_rxcallback_t newhandler, fu16_t flags); |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
615 faim_export int aim_clearhandlers(aim_conn_t *conn); |
2086 | 616 |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
617 faim_export aim_conn_t *aim_conn_findbygroup(aim_session_t *sess, fu16_t group); |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
618 faim_export aim_session_t *aim_conn_getsess(aim_conn_t *conn); |
10271 | 619 faim_export void aim_conn_close(aim_conn_t *deadconn); |
11162 | 620 faim_export aim_conn_t *aim_newconn(aim_session_t *, int type); |
5927 | 621 faim_export int aim_conn_in_sess(aim_session_t *sess, aim_conn_t *conn); |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
622 faim_export int aim_conn_isready(aim_conn_t *); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
623 faim_export int aim_conn_setstatus(aim_conn_t *, int); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
624 faim_export int aim_conn_completeconnect(aim_session_t *sess, aim_conn_t *conn); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
625 faim_export int aim_conn_isconnecting(aim_conn_t *conn); |
2086 | 626 |
11253 | 627 faim_export void aim_session_init(aim_session_t *, fu8_t nonblocking); |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
628 faim_export void aim_session_kill(aim_session_t *); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
629 faim_export aim_conn_t *aim_getconn_type(aim_session_t *, int type); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
630 faim_export aim_conn_t *aim_getconn_type_all(aim_session_t *, int type); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
631 faim_export aim_conn_t *aim_getconn_fd(aim_session_t *, int fd); |
2086 | 632 |
7285 | 633 /* 0x0001 - service.c */ |
10199 | 634 faim_export int aim_srv_setavailmsg(aim_session_t *sess, const char *msg); |
7474 | 635 faim_export int aim_srv_setidle(aim_session_t *sess, fu32_t idletime); |
5917 | 636 |
3912 | 637 /* misc.c */ |
2086 | 638 |
639 #define AIM_VISIBILITYCHANGE_PERMITADD 0x05 | |
640 #define AIM_VISIBILITYCHANGE_PERMITREMOVE 0x06 | |
641 #define AIM_VISIBILITYCHANGE_DENYADD 0x07 | |
642 #define AIM_VISIBILITYCHANGE_DENYREMOVE 0x08 | |
643 | |
644 #define AIM_PRIVFLAGS_ALLOWIDLE 0x01 | |
645 #define AIM_PRIVFLAGS_ALLOWMEMBERSINCE 0x02 | |
646 | |
647 #define AIM_WARN_ANON 0x01 | |
648 | |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
649 faim_export int aim_sendpauseack(aim_session_t *sess, aim_conn_t *conn); |
2703
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
650 faim_export int aim_nop(aim_session_t *, aim_conn_t *); |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
651 faim_export int aim_flap_nop(aim_session_t *sess, aim_conn_t *conn); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
652 faim_export int aim_bos_changevisibility(aim_session_t *, aim_conn_t *, int, const char *); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
653 faim_export int aim_bos_setgroupperm(aim_session_t *, aim_conn_t *, fu32_t mask); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
654 faim_export int aim_bos_setprivacyflags(aim_session_t *, aim_conn_t *, fu32_t); |
2703
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
655 faim_export int aim_reqpersonalinfo(aim_session_t *, aim_conn_t *); |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
656 faim_export int aim_reqservice(aim_session_t *, aim_conn_t *, fu16_t); |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
657 faim_export int aim_bos_reqrights(aim_session_t *, aim_conn_t *); |
4901 | 658 faim_export int aim_setextstatus(aim_session_t *sess, fu32_t status); |
2086 | 659 |
660 #define AIM_CLIENTTYPE_UNKNOWN 0x0000 | |
661 #define AIM_CLIENTTYPE_MC 0x0001 | |
662 #define AIM_CLIENTTYPE_WINAIM 0x0002 | |
663 #define AIM_CLIENTTYPE_WINAIM41 0x0003 | |
664 #define AIM_CLIENTTYPE_AOL_TOC 0x0004 | |
5800 | 665 faim_export fu16_t aim_im_fingerprint(const fu8_t *msghdr, int len); |
2086 | 666 |
667 #define AIM_RATE_CODE_CHANGE 0x0001 | |
668 #define AIM_RATE_CODE_WARNING 0x0002 | |
669 #define AIM_RATE_CODE_LIMIT 0x0003 | |
670 #define AIM_RATE_CODE_CLEARLIMIT 0x0004 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
671 faim_export int aim_ads_requestads(aim_session_t *sess, aim_conn_t *conn); |
2086 | 672 |
4617 | 673 |
674 | |
3912 | 675 /* im.c */ |
4901 | 676 #define AIM_OFT_SUBTYPE_SEND_FILE 0x0001 |
677 #define AIM_OFT_SUBTYPE_SEND_DIR 0x0002 | |
678 #define AIM_OFT_SUBTYPE_GET_FILE 0x0011 | |
679 #define AIM_OPT_SUBTYPE_GET_LIST 0x0012 | |
680 | |
681 #define AIM_TRANSFER_DENY_NOTSUPPORTED 0x0000 | |
682 #define AIM_TRANSFER_DENY_DECLINE 0x0001 | |
683 #define AIM_TRANSFER_DENY_NOTACCEPTING 0x0002 | |
684 | |
4617 | 685 #define AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED 0x00000001 |
686 #define AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED 0x00000002 | |
687 | |
688 /* This is what the server will give you if you don't set them yourself. */ | |
689 #define AIM_IMPARAM_DEFAULTS { \ | |
690 0, \ | |
691 AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \ | |
692 512, /* !! Note how small this is. */ \ | |
693 (99.9)*10, (99.9)*10, \ | |
694 1000 /* !! And how large this is. */ \ | |
695 } | |
2086 | 696 |
4617 | 697 /* This is what most AIM versions use. */ |
698 #define AIM_IMPARAM_REASONABLE { \ | |
699 0, \ | |
700 AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \ | |
701 8000, \ | |
702 (99.9)*10, (99.9)*10, \ | |
703 0 \ | |
704 } | |
705 | |
706 struct aim_icbmparameters { | |
707 fu16_t maxchan; | |
708 fu32_t flags; /* AIM_IMPARAM_FLAG_ */ | |
709 fu16_t maxmsglen; /* message size that you will accept */ | |
710 fu16_t maxsenderwarn; /* this and below are *10 (999=99.9%) */ | |
711 fu16_t maxrecverwarn; | |
712 fu32_t minmsginterval; /* in milliseconds? */ | |
2086 | 713 }; |
714 | |
715 struct aim_chat_roominfo { | |
5556 | 716 fu16_t exchange; |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
717 char *name; |
5556 | 718 fu16_t instance; |
2086 | 719 }; |
720 | |
9806 | 721 #define AIM_IMFLAGS_AWAY 0x0001 /* mark as an autoreply */ |
722 #define AIM_IMFLAGS_ACK 0x0002 /* request a receipt notice */ | |
723 #define AIM_IMFLAGS_BUDDYREQ 0x0010 /* buddy icon requested */ | |
724 #define AIM_IMFLAGS_HASICON 0x0020 /* already has icon */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
725 #define AIM_IMFLAGS_SUBENC_MACINTOSH 0x0040 /* damn that Steve Jobs! */ |
11369 | 726 #define AIM_IMFLAGS_CUSTOMFEATURES 0x0080 /* features field present */ |
9806 | 727 #define AIM_IMFLAGS_EXTDATA 0x0100 |
728 #define AIM_IMFLAGS_X 0x0200 | |
729 #define AIM_IMFLAGS_MULTIPART 0x0400 /* ->mpmsg section valid */ | |
730 #define AIM_IMFLAGS_OFFLINE 0x0800 /* send to offline user */ | |
731 #define AIM_IMFLAGS_TYPINGNOT 0x1000 /* typing notification */ | |
732 | |
9826 | 733 #define AIM_CHARSET_ASCII 0x0000 |
734 #define AIM_CHARSET_UNICODE 0x0002 /* UCS-2BE */ | |
735 #define AIM_CHARSET_CUSTOM 0x0003 | |
2086 | 736 |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
737 /* |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
738 * Multipart message structures. |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
739 */ |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
740 typedef struct aim_mpmsg_section_s { |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
741 fu16_t charset; |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
742 fu16_t charsubset; |
11159 | 743 gchar *data; |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
744 fu16_t datalen; |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
745 struct aim_mpmsg_section_s *next; |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
746 } aim_mpmsg_section_t; |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
747 |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
748 typedef struct aim_mpmsg_s { |
10595 | 749 unsigned int numparts; |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
750 aim_mpmsg_section_t *parts; |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
751 } aim_mpmsg_t; |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
752 |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
753 faim_export int aim_mpmsg_init(aim_session_t *sess, aim_mpmsg_t *mpm); |
11159 | 754 faim_export int aim_mpmsg_addraw(aim_session_t *sess, aim_mpmsg_t *mpm, fu16_t charset, fu16_t charsubset, const gchar *data, fu16_t datalen); |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
755 faim_export int aim_mpmsg_addascii(aim_session_t *sess, aim_mpmsg_t *mpm, const char *ascii); |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
756 faim_export int aim_mpmsg_addunicode(aim_session_t *sess, aim_mpmsg_t *mpm, const fu16_t *unicode, fu16_t unicodelen); |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
757 faim_export void aim_mpmsg_free(aim_session_t *sess, aim_mpmsg_t *mpm); |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
758 |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
759 /* |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
760 * Arguments to aim_send_im_ext(). |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
761 * |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
762 * This is really complicated. But immensely versatile. |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
763 * |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
764 */ |
2086 | 765 struct aim_sendimext_args { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
766 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
767 /* These are _required_ */ |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
768 const char *destsn; |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
769 fu32_t flags; /* often 0 */ |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
770 |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
771 /* Only required if not using multipart messages */ |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
772 const char *msg; |
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
773 int msglen; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
774 |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
775 /* Required if ->msg is not provided */ |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
776 aim_mpmsg_t *mpmsg; |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
777 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
778 /* Only used if AIM_IMFLAGS_HASICON is set */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
779 fu32_t iconlen; |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
780 time_t iconstamp; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
781 fu32_t iconsum; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
782 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
783 /* Only used if AIM_IMFLAGS_CUSTOMFEATURES is set */ |
10595 | 784 fu16_t featureslen; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
785 fu8_t *features; |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
786 |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
787 /* Only used if AIM_IMFLAGS_CUSTOMCHARSET is set and mpmsg not used */ |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
788 fu16_t charset; |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
789 fu16_t charsubset; |
2086 | 790 }; |
791 | |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
792 /* |
2866
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
793 * Arguments to aim_send_rtfmsg(). |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
794 */ |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
795 struct aim_sendrtfmsg_args { |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
796 const char *destsn; |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
797 fu32_t fgcolor; |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
798 fu32_t bgcolor; |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
799 const char *rtfmsg; /* must be in RTF */ |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
800 }; |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
801 |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
802 /* |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
803 * This information is provided in the Incoming ICBM callback for |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
804 * Channel 1 ICBM's. |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
805 * |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
806 * Note that although CUSTOMFEATURES and CUSTOMCHARSET say they |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
807 * are optional, both are always set by the current libfaim code. |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
808 * That may or may not change in the future. It is mainly for |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
809 * consistency with aim_sendimext_args. |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
810 * |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
811 * Multipart messages require some explanation. If you want to use them, |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
812 * I suggest you read all the comments in im.c. |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
813 * |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
814 */ |
2086 | 815 struct aim_incomingim_ch1_args { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
816 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
817 /* Always provided */ |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
818 aim_mpmsg_t mpmsg; |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
819 fu32_t icbmflags; /* some flags apply only to ->msg, not all mpmsg */ |
11369 | 820 |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
821 /* Only provided if message has a human-readable section */ |
11159 | 822 gchar *msg; |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
823 int msglen; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
824 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
825 /* Only provided if AIM_IMFLAGS_HASICON is set */ |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
826 time_t iconstamp; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
827 fu32_t iconlen; |
2626
93f9bbd62630
[gaim-migrate @ 2639]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2507
diff
changeset
|
828 fu16_t iconsum; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
829 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
830 /* Only provided if AIM_IMFLAGS_CUSTOMFEATURES is set */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
831 fu8_t *features; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
832 fu8_t featureslen; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
833 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
834 /* Only provided if AIM_IMFLAGS_EXTDATA is set */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
835 fu8_t extdatalen; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
836 fu8_t *extdata; |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
837 |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
838 /* Only used if AIM_IMFLAGS_CUSTOMCHARSET is set */ |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
839 fu16_t charset; |
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
840 fu16_t charsubset; |
2086 | 841 }; |
842 | |
2869 | 843 /* Valid values for channel 2 args->status */ |
4901 | 844 #define AIM_RENDEZVOUS_PROPOSE 0x0000 |
845 #define AIM_RENDEZVOUS_CANCEL 0x0001 | |
846 #define AIM_RENDEZVOUS_ACCEPT 0x0002 | |
2869 | 847 |
2086 | 848 struct aim_incomingim_ch2_args { |
4617 | 849 fu16_t status; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
850 fu8_t cookie[8]; |
6197 | 851 int reqclass; |
4898 | 852 const char *proxyip; |
2869 | 853 const char *clientip; |
854 const char *verifiedip; | |
855 fu16_t port; | |
4617 | 856 fu16_t errorcode; |
2869 | 857 const char *msg; /* invite message or file description */ |
9933 | 858 fu16_t msglen; |
2869 | 859 const char *encoding; |
860 const char *language; | |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
861 union { |
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
862 struct { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
863 fu32_t checksum; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
864 fu32_t length; |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
865 time_t timestamp; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
866 fu8_t *icon; |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
867 } icon; |
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
868 struct { |
2869 | 869 struct aim_chat_roominfo roominfo; |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
870 } chat; |
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
871 struct { |
8708 | 872 fu16_t msgtype; |
2866
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
873 fu32_t fgcolor; |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
874 fu32_t bgcolor; |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
875 const char *rtfmsg; |
6d62d4520460
[gaim-migrate @ 2879]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2821
diff
changeset
|
876 } rtfmsg; |
3630 | 877 struct { |
3771 | 878 fu16_t subtype; |
3630 | 879 fu16_t totfiles; |
880 fu32_t totsize; | |
881 char *filename; | |
11369 | 882 /* reqnum: 0x0001 usually; 0x0002 = reply request for stage 2 proxy transfer */ |
883 fu16_t reqnum; | |
884 fu8_t use_proxy; /* Did the user request that we use a rv proxy? */ | |
3630 | 885 } sendfile; |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
886 } info; |
2869 | 887 void *destructor; /* used internally only */ |
2086 | 888 }; |
889 | |
3141 | 890 /* Valid values for channel 4 args->type */ |
4901 | 891 #define AIM_ICQMSG_AUTHREQUEST 0x0006 |
892 #define AIM_ICQMSG_AUTHDENIED 0x0007 | |
893 #define AIM_ICQMSG_AUTHGRANTED 0x0008 | |
3141 | 894 |
895 struct aim_incomingim_ch4_args { | |
896 fu32_t uin; /* Of the sender of the ICBM */ | |
4173 | 897 fu8_t type; |
898 fu8_t flags; | |
11159 | 899 gchar *msg; /* Reason for auth request, deny, or accept */ |
4076 | 900 int msglen; |
3141 | 901 }; |
902 | |
4617 | 903 /* SNAC sending functions */ |
904 /* 0x0002 */ faim_export int aim_im_setparams(aim_session_t *sess, struct aim_icbmparameters *params); | |
905 /* 0x0004 */ faim_export int aim_im_reqparams(aim_session_t *sess); | |
906 /* 0x0006 */ faim_export int aim_im_sendch1_ext(aim_session_t *sess, struct aim_sendimext_args *args); | |
5556 | 907 /* 0x0006 */ faim_export int aim_im_sendch1(aim_session_t *, const char *destsn, fu16_t flags, const char *msg); |
8225 | 908 /* 0x0006 */ faim_export int aim_im_sendch2_chatinvite(aim_session_t *sess, const char *sn, const char *msg, fu16_t exchange, const char *roomname, fu16_t instance); |
4617 | 909 /* 0x0006 */ faim_export int aim_im_sendch2_icon(aim_session_t *sess, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu16_t iconsum); |
910 /* 0x0006 */ faim_export int aim_im_sendch2_rtfmsg(aim_session_t *sess, struct aim_sendrtfmsg_args *args); | |
10035 | 911 /* 0x0006 */ faim_export int aim_im_sendch2_odcrequest(aim_session_t *sess, fu8_t *cookie, fu8_t usecookie, const char *sn, const fu8_t *ip, fu16_t port); |
5146 | 912 /* 0x0006 */ faim_export int aim_im_sendch2_sendfile_ask(aim_session_t *sess, struct aim_oft_info *oft_info); |
913 /* 0x0006 */ faim_export int aim_im_sendch2_sendfile_accept(aim_session_t *sess, struct aim_oft_info *info); | |
914 /* 0x0006 */ faim_export int aim_im_sendch2_sendfile_cancel(aim_session_t *sess, struct aim_oft_info *oft_info); | |
4617 | 915 /* 0x0006 */ faim_export int aim_im_sendch2_geticqaway(aim_session_t *sess, const char *sn, int type); |
11000 | 916 /* 0x0006 */ faim_export int aim_im_sendch4(aim_session_t *sess, const char *sn, fu16_t type, const char *message); |
4617 | 917 /* 0x0008 */ faim_export int aim_im_warn(aim_session_t *sess, aim_conn_t *conn, const char *destsn, fu32_t flags); |
11000 | 918 /* 0x000b */ faim_export int aim_im_denytransfer(aim_session_t *sess, const char *sender, const fu8_t *cookie, fu16_t code); |
6059 | 919 /* 0x0014 */ faim_export int aim_im_sendmtn(aim_session_t *sess, fu16_t type1, const char *sn, fu16_t type2); |
11369 | 920 faim_export void aim_im_makecookie(char* cookie); |
4617 | 921 |
922 | |
923 /* ft.c */ | |
924 struct aim_fileheader_t { | |
925 #if 0 | |
11369 | 926 char magic[4]; /* 0 */ |
927 fu16_t hdrlen; /* 4 */ | |
928 fu16_t hdrtype; /* 6 */ | |
4617 | 929 #endif |
11369 | 930 char bcookie[8]; /* 8 */ |
931 fu16_t encrypt; /* 16 */ | |
932 fu16_t compress; /* 18 */ | |
933 fu16_t totfiles; /* 20 */ | |
934 fu16_t filesleft; /* 22 */ | |
935 fu16_t totparts; /* 24 */ | |
936 fu16_t partsleft; /* 26 */ | |
937 fu32_t totsize; /* 28 */ | |
938 fu32_t size; /* 32 */ | |
939 fu32_t modtime; /* 36 */ | |
940 fu32_t checksum; /* 40 */ | |
941 fu32_t rfrcsum; /* 44 */ | |
942 fu32_t rfsize; /* 48 */ | |
943 fu32_t cretime; /* 52 */ | |
944 fu32_t rfcsum; /* 56 */ | |
945 fu32_t nrecvd; /* 60 */ | |
946 fu32_t recvcsum; /* 64 */ | |
947 fu8_t idstring[32]; /* 68 */ | |
948 fu8_t flags; /* 100 */ | |
949 fu8_t lnameoffset; /* 101 */ | |
950 fu8_t lsizeoffset; /* 102 */ | |
951 char dummy[69]; /* 103 */ | |
952 char macfileinfo[16]; /* 172 */ | |
953 fu16_t nencode; /* 188 */ | |
954 fu16_t nlanguage; /* 190 */ | |
955 char name[64]; /* 192 */ | |
956 /* 256 */ | |
957 }; | |
958 | |
959 struct aim_rv_proxy_info { | |
960 fu16_t packet_ver; | |
961 fu16_t cmd_type; | |
962 fu16_t flags; | |
963 char* ip; /* IP address sent along with this packet */ | |
964 fu16_t port; /* This is NOT the port we should use to connect. Always connect to 5190 */ | |
965 fu8_t cookie[8]; | |
966 fu32_t unknownA; | |
967 fu16_t err_code; /* Valid only for cmd_type of AIM_RV_PROXY_ERROR */ | |
968 aim_conn_t *conn; | |
969 aim_session_t *sess; | |
4617 | 970 }; |
3595 | 971 |
4826 | 972 struct aim_oft_info { |
11000 | 973 fu8_t cookie[8]; |
5146 | 974 char *sn; |
975 char *proxyip; | |
976 char *clientip; | |
977 char *verifiedip; | |
978 fu16_t port; | |
11369 | 979 |
980 int send_or_recv; /* Send or receive */ | |
981 int method; /* What method is being used to transfer this file? DIRECT, REDIR, or PROXY */ | |
982 int stage; /* At what stage was a proxy requested? NONE, STG1, STG2*/ | |
983 int xfer_reffed; /* There are many timers, but we should only ref the xfer once */ | |
984 fu32_t res_bytes; /* The bytes already received for resuming a transfer */ | |
985 | |
5146 | 986 aim_conn_t *conn; |
987 aim_session_t *sess; | |
11214 | 988 int success; /* Was the connection successful? Used for timing out the transfer. */ |
4832 | 989 struct aim_fileheader_t fh; |
4826 | 990 struct aim_oft_info *next; |
11369 | 991 struct aim_rv_proxy_info *proxy_info; |
4617 | 992 }; |
993 | |
4763 | 994 faim_export fu32_t aim_oft_checksum_chunk(const fu8_t *buffer, int bufferlen, fu32_t prevcheck); |
4650 | 995 faim_export fu32_t aim_oft_checksum_file(char *filename); |
4617 | 996 faim_export int aim_handlerendconnect(aim_session_t *sess, aim_conn_t *cur); |
997 faim_export int aim_odc_send_typing(aim_session_t *sess, aim_conn_t *conn, int typing); | |
4870 | 998 faim_export int aim_odc_send_im(aim_session_t *sess, aim_conn_t *conn, const char *msg, int len, int encoding, int isawaymsg); |
4617 | 999 faim_export const char *aim_odc_getsn(aim_conn_t *conn); |
11159 | 1000 faim_export const guchar *aim_odc_getcookie(aim_conn_t *conn); |
4617 | 1001 faim_export aim_conn_t *aim_odc_getconn(aim_session_t *sess, const char *sn); |
8982 | 1002 faim_export aim_conn_t *aim_odc_initiate(aim_session_t *sess, const char *sn, int listenfd, |
1003 const fu8_t *localip, fu16_t port, const fu8_t *mycookie); | |
4617 | 1004 faim_export aim_conn_t *aim_odc_connect(aim_session_t *sess, const char *sn, const char *addr, const fu8_t *cookie); |
5146 | 1005 |
11369 | 1006 faim_export struct aim_oft_info *aim_oft_createinfo(aim_session_t *sess, const fu8_t *cookie, const char *sn, |
1007 const char *ip, fu16_t port, fu32_t size, fu32_t modtime, char *filename, int send_or_recv, | |
1008 int method, int stage); | |
5146 | 1009 faim_export int aim_oft_destroyinfo(struct aim_oft_info *oft_info); |
11369 | 1010 faim_export struct aim_rv_proxy_info *aim_rv_proxy_createinfo(aim_session_t *sess, const fu8_t *cookie, fu16_t port); |
8240 | 1011 faim_export int aim_sendfile_listen(aim_session_t *sess, struct aim_oft_info *oft_info, int listenfd); |
5146 | 1012 faim_export int aim_oft_sendheader(aim_session_t *sess, fu16_t type, struct aim_oft_info *oft_info); |
4617 | 1013 |
11369 | 1014 faim_export int aim_rv_proxy_init_recv(struct aim_rv_proxy_info *proxy_info); |
1015 faim_export int aim_rv_proxy_init_send(struct aim_rv_proxy_info *proxy_info); | |
4617 | 1016 |
11369 | 1017 faim_export int aim_sendfile_listen(aim_session_t *sess, struct aim_oft_info *oft_info, int listenfd); |
1018 faim_export int aim_oft_sendheader(aim_session_t *sess, fu16_t type, struct aim_oft_info *oft_info); | |
1019 int aim_bstream_send(aim_bstream_t *bs, aim_conn_t *conn, size_t count); | |
1020 faim_internal struct aim_rv_proxy_info *aim_rv_proxy_read(aim_session_t *sess, aim_conn_t *conn); | |
2086 | 1021 |
7011 | 1022 /* 0x0002 - locate.c */ |
4901 | 1023 /* |
1024 * AIM User Info, Standard Form. | |
1025 */ | |
7011 | 1026 #define AIM_FLAG_UNCONFIRMED 0x0001 /* "damned transients" */ |
4901 | 1027 #define AIM_FLAG_ADMINISTRATOR 0x0002 |
7011 | 1028 #define AIM_FLAG_AOL 0x0004 |
1029 #define AIM_FLAG_OSCAR_PAY 0x0008 | |
1030 #define AIM_FLAG_FREE 0x0010 | |
1031 #define AIM_FLAG_AWAY 0x0020 | |
1032 #define AIM_FLAG_ICQ 0x0040 | |
1033 #define AIM_FLAG_WIRELESS 0x0080 | |
1034 #define AIM_FLAG_UNKNOWN100 0x0100 | |
1035 #define AIM_FLAG_UNKNOWN200 0x0200 | |
1036 #define AIM_FLAG_ACTIVEBUDDY 0x0400 | |
1037 #define AIM_FLAG_UNKNOWN800 0x0800 | |
1038 #define AIM_FLAG_ABINTERNAL 0x1000 | |
1039 #define AIM_FLAG_ALLUSERS 0x001f | |
4901 | 1040 |
5836 | 1041 #define AIM_USERINFO_PRESENT_FLAGS 0x00000001 |
1042 #define AIM_USERINFO_PRESENT_MEMBERSINCE 0x00000002 | |
1043 #define AIM_USERINFO_PRESENT_ONLINESINCE 0x00000004 | |
1044 #define AIM_USERINFO_PRESENT_IDLE 0x00000008 | |
1045 #define AIM_USERINFO_PRESENT_ICQEXTSTATUS 0x00000010 | |
1046 #define AIM_USERINFO_PRESENT_ICQIPADDR 0x00000020 | |
1047 #define AIM_USERINFO_PRESENT_ICQDATA 0x00000040 | |
1048 #define AIM_USERINFO_PRESENT_CAPABILITIES 0x00000080 | |
1049 #define AIM_USERINFO_PRESENT_SESSIONLEN 0x00000100 | |
1050 #define AIM_USERINFO_PRESENT_CREATETIME 0x00000200 | |
4901 | 1051 |
7045 | 1052 struct userinfo_node { |
1053 char *sn; | |
1054 struct userinfo_node *next; | |
1055 }; | |
1056 | |
7011 | 1057 typedef struct aim_userinfo_s { |
1058 char *sn; | |
4901 | 1059 fu16_t warnlevel; /* evil percent * 10 (999 = 99.9%) */ |
1060 fu16_t idletime; /* in seconds */ | |
1061 fu16_t flags; | |
1062 fu32_t createtime; /* time_t */ | |
1063 fu32_t membersince; /* time_t */ | |
1064 fu32_t onlinesince; /* time_t */ | |
1065 fu32_t sessionlen; /* in seconds */ | |
1066 fu32_t capabilities; | |
1067 struct { | |
1068 fu32_t status; | |
1069 fu32_t ipaddr; | |
1070 fu8_t crap[0x25]; /* until we figure it out... */ | |
1071 } icqinfo; | |
1072 fu32_t present; | |
7011 | 1073 |
11024 | 1074 fu8_t iconcsumtype; |
4901 | 1075 fu16_t iconcsumlen; |
5836 | 1076 fu8_t *iconcsum; |
7011 | 1077 |
1078 char *info; | |
1079 char *info_encoding; | |
1080 fu16_t info_len; | |
4901 | 1081 |
7011 | 1082 char *avail; |
1083 char *avail_encoding; | |
1084 fu16_t avail_len; | |
1085 | |
1086 char *away; | |
1087 char *away_encoding; | |
1088 fu16_t away_len; | |
1089 | |
1090 struct aim_userinfo_s *next; | |
1091 } aim_userinfo_t; | |
4901 | 1092 |
7025 | 1093 #define AIM_CAPS_BUDDYICON 0x00000001 |
8092 | 1094 #define AIM_CAPS_TALK 0x00000002 |
7025 | 1095 #define AIM_CAPS_DIRECTIM 0x00000004 |
1096 #define AIM_CAPS_CHAT 0x00000008 | |
1097 #define AIM_CAPS_GETFILE 0x00000010 | |
1098 #define AIM_CAPS_SENDFILE 0x00000020 | |
1099 #define AIM_CAPS_GAMES 0x00000040 | |
8092 | 1100 #define AIM_CAPS_ADDINS 0x00000080 |
4650 | 1101 #define AIM_CAPS_SENDBUDDYLIST 0x00000100 |
7025 | 1102 #define AIM_CAPS_GAMES2 0x00000200 |
7141 | 1103 #define AIM_CAPS_ICQ_DIRECT 0x00000400 |
7025 | 1104 #define AIM_CAPS_APINFO 0x00000800 |
1105 #define AIM_CAPS_ICQRTF 0x00001000 | |
1106 #define AIM_CAPS_EMPTY 0x00002000 | |
4650 | 1107 #define AIM_CAPS_ICQSERVERRELAY 0x00004000 |
7025 | 1108 #define AIM_CAPS_ICQUTF8OLD 0x00008000 |
4650 | 1109 #define AIM_CAPS_TRILLIANCRYPT 0x00010000 |
7025 | 1110 #define AIM_CAPS_ICQUTF8 0x00020000 |
4811 | 1111 #define AIM_CAPS_INTEROPERATE 0x00040000 |
7025 | 1112 #define AIM_CAPS_ICHAT 0x00080000 |
1113 #define AIM_CAPS_HIPTOP 0x00100000 | |
1114 #define AIM_CAPS_SECUREIM 0x00200000 | |
1115 #define AIM_CAPS_SMS 0x00400000 | |
7091 | 1116 #define AIM_CAPS_GENERICUNKNOWN 0x00800000 |
7582 | 1117 #define AIM_CAPS_VIDEO 0x01000000 |
7945 | 1118 #define AIM_CAPS_ICHATAV 0x02000000 |
8092 | 1119 #define AIM_CAPS_LIVEVIDEO 0x04000000 |
1120 #define AIM_CAPS_CAMERA 0x08000000 | |
1121 #define AIM_CAPS_LAST 0x10000000 | |
2086 | 1122 |
1123 #define AIM_SENDMEMBLOCK_FLAG_ISREQUEST 0 | |
1124 #define AIM_SENDMEMBLOCK_FLAG_ISHASH 1 | |
1125 | |
5556 | 1126 faim_export int aim_sendmemblock(aim_session_t *sess, aim_conn_t *conn, fu32_t offset, fu32_t len, const fu8_t *buf, fu8_t flag); |
2086 | 1127 |
1128 struct aim_invite_priv { | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1129 char *sn; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1130 char *roomname; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1131 fu16_t exchange; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1132 fu16_t instance; |
2086 | 1133 }; |
1134 | |
1135 #define AIM_COOKIETYPE_UNKNOWN 0x00 | |
1136 #define AIM_COOKIETYPE_ICBM 0x01 | |
1137 #define AIM_COOKIETYPE_ADS 0x02 | |
1138 #define AIM_COOKIETYPE_BOS 0x03 | |
1139 #define AIM_COOKIETYPE_IM 0x04 | |
1140 #define AIM_COOKIETYPE_CHAT 0x05 | |
1141 #define AIM_COOKIETYPE_CHATNAV 0x06 | |
1142 #define AIM_COOKIETYPE_INVITE 0x07 | |
1143 /* we'll move OFT up a bit to give breathing room. not like it really | |
1144 * matters. */ | |
1145 #define AIM_COOKIETYPE_OFTIM 0x10 | |
1146 #define AIM_COOKIETYPE_OFTGET 0x11 | |
1147 #define AIM_COOKIETYPE_OFTSEND 0x12 | |
1148 #define AIM_COOKIETYPE_OFTVOICE 0x13 | |
1149 #define AIM_COOKIETYPE_OFTIMAGE 0x14 | |
1150 #define AIM_COOKIETYPE_OFTICON 0x15 | |
1151 | |
7045 | 1152 faim_export aim_userinfo_t *aim_locate_finduserinfo(aim_session_t *sess, const char *sn); |
8341 | 1153 faim_export void aim_locate_dorequest(aim_session_t *sess); |
7011 | 1154 |
1155 /* 0x0002 */ faim_export int aim_locate_reqrights(aim_session_t *sess); | |
11369 | 1156 /* 0x0004 */ faim_export int aim_locate_setcaps(aim_session_t *sess, fu32_t caps); |
11159 | 1157 /* 0x0004 */ faim_export int aim_locate_setprofile(aim_session_t *sess, const char *profile_encoding, const gchar *profile, const int profile_len, const char *awaymsg_encoding, const gchar *awaymsg, const int awaymsg_len); |
7011 | 1158 /* 0x0005 */ faim_export int aim_locate_getinfo(aim_session_t *sess, const char *, fu16_t); |
1159 /* 0x0009 */ faim_export int aim_locate_setdirinfo(aim_session_t *sess, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, fu16_t privacy); | |
1160 /* 0x000b */ faim_export int aim_locate_000b(aim_session_t *sess, const char *sn); | |
1161 /* 0x000f */ faim_export int aim_locate_setinterests(aim_session_t *sess, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, fu16_t privacy); | |
1162 /* 0x0015 */ faim_export int aim_locate_getinfoshort(aim_session_t *sess, const char *sn, fu32_t flags); | |
2086 | 1163 |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2122
diff
changeset
|
1164 |
2086 | 1165 |
4901 | 1166 /* 0x0003 - buddylist.c */ |
7285 | 1167 /* 0x0002 */ faim_export int aim_buddylist_reqrights(aim_session_t *, aim_conn_t *); |
1168 /* 0x0004 */ faim_export int aim_buddylist_set(aim_session_t *, aim_conn_t *, const char *); | |
1169 /* 0x0004 */ faim_export int aim_buddylist_addbuddy(aim_session_t *, aim_conn_t *, const char *); | |
1170 /* 0x0005 */ faim_export int aim_buddylist_removebuddy(aim_session_t *, aim_conn_t *, const char *); | |
1171 /* 0x000b */ faim_export int aim_buddylist_oncoming(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *info); | |
1172 /* 0x000c */ faim_export int aim_buddylist_offgoing(aim_session_t *sess, aim_conn_t *conn, const char *sn); | |
2086 | 1173 |
4617 | 1174 |
1175 | |
4901 | 1176 /* 0x000a - search.c */ |
6879 | 1177 faim_export int aim_search_address(aim_session_t *, aim_conn_t *, const char *); |
2086 | 1178 |
4617 | 1179 |
1180 | |
4901 | 1181 /* 0x000d - chatnav.c */ |
1182 /* 0x000e - chat.c */ | |
2821
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
1183 /* These apply to exchanges as well. */ |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
1184 #define AIM_CHATROOM_FLAG_EVILABLE 0x0001 |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
1185 #define AIM_CHATROOM_FLAG_NAV_ONLY 0x0002 |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
1186 #define AIM_CHATROOM_FLAG_INSTANCING_ALLOWED 0x0004 |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
1187 #define AIM_CHATROOM_FLAG_OCCUPANT_PEEK_ALLOWED 0x0008 |
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
1188 |
2086 | 1189 struct aim_chat_exchangeinfo { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1190 fu16_t number; |
2821
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
1191 fu16_t flags; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1192 char *name; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1193 char *charset1; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1194 char *lang1; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1195 char *charset2; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1196 char *lang2; |
2086 | 1197 }; |
1198 | |
1199 #define AIM_CHATFLAGS_NOREFLECT 0x0001 | |
1200 #define AIM_CHATFLAGS_AWAY 0x0002 | |
11159 | 1201 faim_export int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, fu16_t flags, const gchar *msg, int msglen, const char *encoding, const char *language); |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1202 faim_export int aim_chat_join(aim_session_t *sess, aim_conn_t *conn, fu16_t exchange, const char *roomname, fu16_t instance); |
2821
9467e4ee81be
[gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2764
diff
changeset
|
1203 faim_export int aim_chat_attachname(aim_conn_t *conn, fu16_t exchange, const char *roomname, fu16_t instance); |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1204 faim_export char *aim_chat_getname(aim_conn_t *conn); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1205 faim_export aim_conn_t *aim_chat_getconn(aim_session_t *, const char *name); |
2086 | 1206 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1207 faim_export int aim_chatnav_reqrights(aim_session_t *sess, aim_conn_t *conn); |
2086 | 1208 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1209 faim_export int aim_chatnav_createroom(aim_session_t *sess, aim_conn_t *conn, const char *name, fu16_t exchange); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1210 faim_export int aim_chat_leaveroom(aim_session_t *sess, const char *name); |
2086 | 1211 |
2672 | 1212 |
4230 | 1213 |
6879 | 1214 /* 0x000f - odir.c */ |
1215 struct aim_odir { | |
4901 | 1216 char *first; |
1217 char *last; | |
1218 char *middle; | |
1219 char *maiden; | |
1220 char *email; | |
1221 char *country; | |
1222 char *state; | |
1223 char *city; | |
1224 char *sn; | |
1225 char *interest; | |
1226 char *nick; | |
1227 char *zip; | |
1228 char *region; | |
1229 char *address; | |
6879 | 1230 struct aim_odir *next; |
4901 | 1231 }; |
1232 | |
6879 | 1233 faim_export int aim_odir_email(aim_session_t *, const char *, const char *); |
1234 faim_export int aim_odir_name(aim_session_t *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *); | |
1235 faim_export int aim_odir_interest(aim_session_t *, const char *, const char *); | |
4901 | 1236 |
1237 | |
1238 | |
1239 /* 0x0010 - icon.c */ | |
6879 | 1240 faim_export int aim_bart_upload(aim_session_t *sess, const fu8_t *icon, fu16_t iconlen); |
11024 | 1241 faim_export int aim_bart_request(aim_session_t *sess, const char *sn, fu8_t iconcsumtype, const fu8_t *iconstr, fu16_t iconstrlen); |
4901 | 1242 |
1243 | |
1244 | |
1245 /* 0x0013 - ssi.c */ | |
4889 | 1246 #define AIM_SSI_TYPE_BUDDY 0x0000 |
1247 #define AIM_SSI_TYPE_GROUP 0x0001 | |
1248 #define AIM_SSI_TYPE_PERMIT 0x0002 | |
1249 #define AIM_SSI_TYPE_DENY 0x0003 | |
1250 #define AIM_SSI_TYPE_PDINFO 0x0004 | |
1251 #define AIM_SSI_TYPE_PRESENCEPREFS 0x0005 | |
1252 #define AIM_SSI_TYPE_ICONINFO 0x0014 | |
2672 | 1253 |
4889 | 1254 #define AIM_SSI_ACK_SUCCESS 0x0000 |
1255 #define AIM_SSI_ACK_ITEMNOTFOUND 0x0002 | |
1256 #define AIM_SSI_ACK_IDNUMINUSE 0x000a | |
1257 #define AIM_SSI_ACK_ATMAX 0x000c | |
1258 #define AIM_SSI_ACK_INVALIDNAME 0x000d | |
1259 #define AIM_SSI_ACK_AUTHREQUIRED 0x000e | |
4230 | 1260 |
2672 | 1261 struct aim_ssi_item { |
1262 char *name; | |
1263 fu16_t gid; | |
1264 fu16_t bid; | |
1265 fu16_t type; | |
4230 | 1266 struct aim_tlvlist_s *data; |
2672 | 1267 struct aim_ssi_item *next; |
1268 }; | |
1269 | |
4230 | 1270 struct aim_ssi_tmp { |
1271 fu16_t action; | |
1272 fu16_t ack; | |
1273 char *name; | |
1274 struct aim_ssi_item *item; | |
1275 struct aim_ssi_tmp *next; | |
1276 }; | |
1277 | |
3109 | 1278 /* These build the actual SNACs and queue them to be sent */ |
4889 | 1279 /* 0x0002 */ faim_export int aim_ssi_reqrights(aim_session_t *sess); |
6350 | 1280 /* 0x0004 */ faim_export int aim_ssi_reqdata(aim_session_t *sess); |
1281 /* 0x0005 */ faim_export int aim_ssi_reqifchanged(aim_session_t *sess, time_t localstamp, fu16_t localrev); | |
4642 | 1282 /* 0x0007 */ faim_export int aim_ssi_enable(aim_session_t *sess); |
4889 | 1283 /* 0x0008 */ faim_export int aim_ssi_addmoddel(aim_session_t *sess); |
1284 /* 0x0011 */ faim_export int aim_ssi_modbegin(aim_session_t *sess); | |
1285 /* 0x0012 */ faim_export int aim_ssi_modend(aim_session_t *sess); | |
1286 /* 0x0014 */ faim_export int aim_ssi_sendauth(aim_session_t *sess, char *sn, char *msg); | |
1287 /* 0x0018 */ faim_export int aim_ssi_sendauthrequest(aim_session_t *sess, char *sn, char *msg); | |
1288 /* 0x001a */ faim_export int aim_ssi_sendauthreply(aim_session_t *sess, char *sn, fu8_t reply, char *msg); | |
2672 | 1289 |
4230 | 1290 /* Client functions for retrieving SSI data */ |
3210 | 1291 faim_export struct aim_ssi_item *aim_ssi_itemlist_find(struct aim_ssi_item *list, fu16_t gid, fu16_t bid); |
3466 | 1292 faim_export struct aim_ssi_item *aim_ssi_itemlist_finditem(struct aim_ssi_item *list, const char *gn, const char *sn, fu16_t type); |
4230 | 1293 faim_export struct aim_ssi_item *aim_ssi_itemlist_exists(struct aim_ssi_item *list, const char *sn); |
1294 faim_export char *aim_ssi_itemlist_findparentname(struct aim_ssi_item *list, const char *sn); | |
3210 | 1295 faim_export int aim_ssi_getpermdeny(struct aim_ssi_item *list); |
1296 faim_export fu32_t aim_ssi_getpresence(struct aim_ssi_item *list); | |
4238 | 1297 faim_export char *aim_ssi_getalias(struct aim_ssi_item *list, const char *gn, const char *sn); |
7172 | 1298 faim_export char *aim_ssi_getcomment(struct aim_ssi_item *list, const char *gn, const char *sn); |
4243 | 1299 faim_export int aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn); |
4230 | 1300 |
1301 /* Client functions for changing SSI data */ | |
4889 | 1302 faim_export int aim_ssi_addbuddy(aim_session_t *sess, const char *name, const char *group, const char *alias, const char *comment, const char *smsnum, int needauth); |
1303 faim_export int aim_ssi_addpermit(aim_session_t *sess, const char *name); | |
1304 faim_export int aim_ssi_adddeny(aim_session_t *sess, const char *name); | |
1305 faim_export int aim_ssi_delbuddy(aim_session_t *sess, const char *name, const char *group); | |
1306 faim_export int aim_ssi_delpermit(aim_session_t *sess, const char *name); | |
1307 faim_export int aim_ssi_deldeny(aim_session_t *sess, const char *name); | |
1308 faim_export int aim_ssi_movebuddy(aim_session_t *sess, const char *oldgn, const char *newgn, const char *sn); | |
1309 faim_export int aim_ssi_aliasbuddy(aim_session_t *sess, const char *gn, const char *sn, const char *alias); | |
7172 | 1310 faim_export int aim_ssi_editcomment(aim_session_t *sess, const char *gn, const char *sn, const char *alias); |
4889 | 1311 faim_export int aim_ssi_rename_group(aim_session_t *sess, const char *oldgn, const char *newgn); |
1312 faim_export int aim_ssi_cleanlist(aim_session_t *sess); | |
1313 faim_export int aim_ssi_deletelist(aim_session_t *sess); | |
1314 faim_export int aim_ssi_setpermdeny(aim_session_t *sess, fu8_t permdeny, fu32_t vismask); | |
1315 faim_export int aim_ssi_setpresence(aim_session_t *sess, fu32_t presence); | |
1316 faim_export int aim_ssi_seticon(aim_session_t *sess, fu8_t *iconsum, fu16_t iconsumlen); | |
7313 | 1317 faim_export int aim_ssi_delicon(aim_session_t *sess); |
2991 | 1318 |
4230 | 1319 |
1320 | |
4901 | 1321 /* 0x0015 - icq.c */ |
4624 | 1322 #define AIM_ICQ_INFO_SIMPLE 0x001 |
1323 #define AIM_ICQ_INFO_SUMMARY 0x002 | |
1324 #define AIM_ICQ_INFO_EMAIL 0x004 | |
1325 #define AIM_ICQ_INFO_PERSONAL 0x008 | |
1326 #define AIM_ICQ_INFO_ADDITIONAL 0x010 | |
1327 #define AIM_ICQ_INFO_WORK 0x020 | |
1328 #define AIM_ICQ_INFO_INTERESTS 0x040 | |
1329 #define AIM_ICQ_INFO_ORGS 0x080 | |
1330 #define AIM_ICQ_INFO_UNKNOWN 0x100 | |
1331 #define AIM_ICQ_INFO_HAVEALL 0x1ff | |
1332 | |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1333 struct aim_icq_offlinemsg { |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1334 fu32_t sender; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1335 fu16_t year; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1336 fu8_t month, day, hour, minute; |
4173 | 1337 fu8_t type; |
1338 fu8_t flags; | |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1339 char *msg; |
4076 | 1340 int msglen; |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1341 }; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1342 |
4151 | 1343 struct aim_icq_info { |
4624 | 1344 fu16_t reqid; |
1345 | |
1346 /* simple */ | |
2742
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
1347 fu32_t uin; |
4624 | 1348 |
1349 /* general and "home" information (0x00c8) */ | |
2742
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
1350 char *nick; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
1351 char *first; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
1352 char *last; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
1353 char *email; |
4151 | 1354 char *homecity; |
1355 char *homestate; | |
4624 | 1356 char *homephone; |
1357 char *homefax; | |
4151 | 1358 char *homeaddr; |
4624 | 1359 char *mobile; |
4151 | 1360 char *homezip; |
1361 fu16_t homecountry; | |
4624 | 1362 /* fu8_t timezone; |
1363 fu8_t hideemail; */ | |
1364 | |
1365 /* personal (0x00dc) */ | |
1366 fu8_t age; | |
1367 fu8_t unknown; | |
1368 fu8_t gender; | |
1369 char *personalwebpage; | |
1370 fu16_t birthyear; | |
1371 fu8_t birthmonth; | |
1372 fu8_t birthday; | |
1373 fu8_t language1; | |
1374 fu8_t language2; | |
1375 fu8_t language3; | |
1376 | |
1377 /* work (0x00d2) */ | |
4151 | 1378 char *workcity; |
1379 char *workstate; | |
4624 | 1380 char *workphone; |
1381 char *workfax; | |
4151 | 1382 char *workaddr; |
1383 char *workzip; | |
1384 fu16_t workcountry; | |
1385 char *workcompany; | |
1386 char *workdivision; | |
1387 char *workposition; | |
1388 char *workwebpage; | |
4624 | 1389 |
1390 /* additional personal information (0x00e6) */ | |
1391 char *info; | |
1392 | |
1393 /* email (0x00eb) */ | |
1394 fu16_t numaddresses; | |
4625 | 1395 char **email2; |
4624 | 1396 |
1397 /* we keep track of these in a linked list because we're 1337 */ | |
1398 struct aim_icq_info *next; | |
2742
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
1399 }; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
1400 |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1401 faim_export int aim_icq_reqofflinemsgs(aim_session_t *sess); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1402 faim_export int aim_icq_ackofflinemsgs(aim_session_t *sess); |
10570 | 1403 faim_export int aim_icq_setsecurity(aim_session_t *sess, const int auth, const int web, const int hide); |
1404 faim_export int aim_icq_setauthsetting(aim_session_t *sess, int auth_required); | |
4617 | 1405 faim_export int aim_icq_changepasswd(aim_session_t *sess, const char *passwd); |
2742
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2734
diff
changeset
|
1406 faim_export int aim_icq_getsimpleinfo(aim_session_t *sess, const char *uin); |
4759 | 1407 faim_export int aim_icq_getalias(aim_session_t *sess, const char *uin); |
4151 | 1408 faim_export int aim_icq_getallinfo(aim_session_t *sess, const char *uin); |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1409 |
4617 | 1410 |
1411 | |
4901 | 1412 /* 0x0017 - auth.c */ |
1413 faim_export int aim_sendcookie(aim_session_t *, aim_conn_t *, const fu16_t length, const fu8_t *); | |
1414 faim_export int aim_admin_changepasswd(aim_session_t *, aim_conn_t *, const char *newpw, const char *curpw); | |
1415 faim_export int aim_admin_reqconfirm(aim_session_t *sess, aim_conn_t *conn); | |
1416 faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info); | |
1417 faim_export int aim_admin_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail); | |
1418 faim_export int aim_admin_setnick(aim_session_t *sess, aim_conn_t *conn, const char *newnick); | |
1419 | |
1420 | |
1421 | |
1422 /* 0x0018 - email.c */ | |
3694 | 1423 struct aim_emailinfo { |
1424 fu8_t *cookie16; | |
1425 fu8_t *cookie8; | |
1426 char *url; | |
1427 fu16_t nummsgs; | |
1428 fu8_t unread; | |
1429 char *domain; | |
1430 fu16_t flag; | |
1431 struct aim_emailinfo *next; | |
1432 }; | |
1433 | |
7282 | 1434 faim_export int aim_email_sendcookies(aim_session_t *sess); |
1435 faim_export int aim_email_activate(aim_session_t *sess); | |
3694 | 1436 |
4617 | 1437 |
1438 | |
7167 | 1439 #if defined(FAIM_INTERNAL) || defined(FAIM_NEED_TLV) |
4901 | 1440 /* tlv.c - TLV handling */ |
7167 | 1441 |
1442 /* TLV structure */ | |
4901 | 1443 typedef struct aim_tlv_s { |
1444 fu16_t type; | |
1445 fu16_t length; | |
1446 fu8_t *value; | |
1447 } aim_tlv_t; | |
1448 | |
7167 | 1449 /* TLV List structure */ |
4901 | 1450 typedef struct aim_tlvlist_s { |
1451 aim_tlv_t *tlv; | |
1452 struct aim_tlvlist_s *next; | |
1453 } aim_tlvlist_t; | |
1454 | |
7167 | 1455 /* TLV handling functions */ |
1456 faim_internal aim_tlv_t *aim_tlv_gettlv(aim_tlvlist_t *list, fu16_t type, const int nth); | |
9933 | 1457 faim_internal int aim_tlv_getlength(aim_tlvlist_t *list, fu16_t type, const int nth); |
7167 | 1458 faim_internal char *aim_tlv_getstr(aim_tlvlist_t *list, const fu16_t type, const int nth); |
1459 faim_internal fu8_t aim_tlv_get8(aim_tlvlist_t *list, const fu16_t type, const int nth); | |
1460 faim_internal fu16_t aim_tlv_get16(aim_tlvlist_t *list, const fu16_t type, const int nth); | |
1461 faim_internal fu32_t aim_tlv_get32(aim_tlvlist_t *list, const fu16_t type, const int nth); | |
4901 | 1462 |
7167 | 1463 /* TLV list handling functions */ |
1464 faim_internal aim_tlvlist_t *aim_tlvlist_read(aim_bstream_t *bs); | |
1465 faim_internal aim_tlvlist_t *aim_tlvlist_readnum(aim_bstream_t *bs, fu16_t num); | |
1466 faim_internal aim_tlvlist_t *aim_tlvlist_readlen(aim_bstream_t *bs, fu16_t len); | |
1467 faim_internal aim_tlvlist_t *aim_tlvlist_copy(aim_tlvlist_t *orig); | |
4901 | 1468 |
7167 | 1469 faim_internal int aim_tlvlist_count(aim_tlvlist_t **list); |
1470 faim_internal int aim_tlvlist_size(aim_tlvlist_t **list); | |
6101 | 1471 faim_internal int aim_tlvlist_cmp(aim_tlvlist_t *one, aim_tlvlist_t *two); |
7167 | 1472 faim_internal int aim_tlvlist_write(aim_bstream_t *bs, aim_tlvlist_t **list); |
1473 faim_internal void aim_tlvlist_free(aim_tlvlist_t **list); | |
7166 | 1474 |
7167 | 1475 faim_internal int aim_tlvlist_add_raw(aim_tlvlist_t **list, const fu16_t type, const fu16_t length, const fu8_t *value); |
1476 faim_internal int aim_tlvlist_add_noval(aim_tlvlist_t **list, const fu16_t type); | |
1477 faim_internal int aim_tlvlist_add_8(aim_tlvlist_t **list, const fu16_t type, const fu8_t value); | |
1478 faim_internal int aim_tlvlist_add_16(aim_tlvlist_t **list, const fu16_t type, const fu16_t value); | |
1479 faim_internal int aim_tlvlist_add_32(aim_tlvlist_t **list, const fu16_t type, const fu32_t value); | |
10991 | 1480 faim_internal int aim_tlvlist_add_str(aim_tlvlist_t **list, const fu16_t type, const char *value); |
7167 | 1481 faim_internal int aim_tlvlist_add_caps(aim_tlvlist_t **list, const fu16_t type, const fu32_t caps); |
1482 faim_internal int aim_tlvlist_add_userinfo(aim_tlvlist_t **list, fu16_t type, aim_userinfo_t *userinfo); | |
8225 | 1483 faim_internal int aim_tlvlist_add_chatroom(aim_tlvlist_t **list, fu16_t type, fu16_t exchange, const char *roomname, fu16_t instance); |
7167 | 1484 faim_internal int aim_tlvlist_add_frozentlvlist(aim_tlvlist_t **list, fu16_t type, aim_tlvlist_t **tl); |
7166 | 1485 |
1486 faim_internal int aim_tlvlist_replace_raw(aim_tlvlist_t **list, const fu16_t type, const fu16_t lenth, const fu8_t *value); | |
10993 | 1487 faim_internal int aim_tlvlist_replace_str(aim_tlvlist_t **list, const fu16_t type, const char *str); |
7166 | 1488 faim_internal int aim_tlvlist_replace_noval(aim_tlvlist_t **list, const fu16_t type); |
1489 faim_internal int aim_tlvlist_replace_8(aim_tlvlist_t **list, const fu16_t type, const fu8_t value); | |
1490 faim_internal int aim_tlvlist_replace_16(aim_tlvlist_t **list, const fu16_t type, const fu16_t value); | |
1491 faim_internal int aim_tlvlist_replace_32(aim_tlvlist_t **list, const fu16_t type, const fu32_t value); | |
1492 | |
1493 faim_internal void aim_tlvlist_remove(aim_tlvlist_t **list, const fu16_t type); | |
4901 | 1494 #endif /* FAIM_INTERNAL */ |
1495 | |
1496 | |
1497 | |
3912 | 1498 /* util.c */ |
2086 | 1499 /* |
1500 * These are really ugly. You'd think this was LISP. I wish it was. | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1501 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1502 * XXX With the advent of bstream's, these should be removed to enforce |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1503 * their use. |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1504 * |
2086 | 1505 */ |
5927 | 1506 #define aimutil_put8(buf, data) ((*(buf) = (fu8_t)(data)&0xff),1) |
2086 | 1507 #define aimutil_get8(buf) ((*(buf))&0xff) |
1508 #define aimutil_put16(buf, data) ( \ | |
5927 | 1509 (*(buf) = (fu8_t)((data)>>8)&0xff), \ |
1510 (*((buf)+1) = (fu8_t)(data)&0xff), \ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1511 2) |
2086 | 1512 #define aimutil_get16(buf) ((((*(buf))<<8)&0xff00) + ((*((buf)+1)) & 0xff)) |
1513 #define aimutil_put32(buf, data) ( \ | |
5927 | 1514 (*((buf)) = (fu8_t)((data)>>24)&0xff), \ |
1515 (*((buf)+1) = (fu8_t)((data)>>16)&0xff), \ | |
1516 (*((buf)+2) = (fu8_t)((data)>>8)&0xff), \ | |
1517 (*((buf)+3) = (fu8_t)(data)&0xff), \ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1518 4) |
2086 | 1519 #define aimutil_get32(buf) ((((*(buf))<<24)&0xff000000) + \ |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1520 (((*((buf)+1))<<16)&0x00ff0000) + \ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1521 (((*((buf)+2))<< 8)&0x0000ff00) + \ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2196
diff
changeset
|
1522 (((*((buf)+3) )&0x000000ff))) |
2086 | 1523 |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1524 /* Little-endian versions (damn ICQ) */ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1525 #define aimutil_putle8(buf, data) ( \ |
5556 | 1526 (*(buf) = (fu8_t)(data) & 0xff), \ |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1527 1) |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1528 #define aimutil_getle8(buf) ( \ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1529 (*(buf)) & 0xff \ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1530 ) |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1531 #define aimutil_putle16(buf, data) ( \ |
5556 | 1532 (*((buf)+0) = (fu8_t)((data) >> 0) & 0xff), \ |
1533 (*((buf)+1) = (fu8_t)((data) >> 8) & 0xff), \ | |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1534 2) |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1535 #define aimutil_getle16(buf) ( \ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1536 (((*((buf)+0)) << 0) & 0x00ff) + \ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1537 (((*((buf)+1)) << 8) & 0xff00) \ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1538 ) |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1539 #define aimutil_putle32(buf, data) ( \ |
5556 | 1540 (*((buf)+0) = (fu8_t)((data) >> 0) & 0xff), \ |
1541 (*((buf)+1) = (fu8_t)((data) >> 8) & 0xff), \ | |
1542 (*((buf)+2) = (fu8_t)((data) >> 16) & 0xff), \ | |
1543 (*((buf)+3) = (fu8_t)((data) >> 24) & 0xff), \ | |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1544 4) |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1545 #define aimutil_getle32(buf) ( \ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1546 (((*((buf)+0)) << 0) & 0x000000ff) + \ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1547 (((*((buf)+1)) << 8) & 0x0000ff00) + \ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1548 (((*((buf)+2)) << 16) & 0x00ff0000) + \ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1549 (((*((buf)+3)) << 24) & 0xff000000)) |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1550 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2704
diff
changeset
|
1551 |
5927 | 1552 faim_export int aimutil_putstr(char *, const char *, int); |
4617 | 1553 faim_export fu16_t aimutil_iconsum(const fu8_t *buf, int buflen); |
6323 | 1554 faim_export int aimutil_tokslen(char *toSearch, int theindex, char dl); |
2086 | 1555 faim_export int aimutil_itemcnt(char *toSearch, char dl); |
6323 | 1556 faim_export char *aimutil_itemindex(char *toSearch, int theindex, char dl); |
2086 | 1557 |
8092 | 1558 faim_export int aim_snvalid(const char *sn); |
9975 | 1559 faim_export int aim_sn_is_icq(const char *sn); |
2086 | 1560 faim_export int aim_snlen(const char *sn); |
1561 faim_export int aim_sncmp(const char *sn1, const char *sn2); | |
1562 | |
1563 #include <aim_internal.h> | |
1564 | |
6322 | 1565 #ifdef __cplusplus |
1566 } | |
1567 #endif | |
1568 | |
2086 | 1569 #endif /* __AIM_H__ */ |