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