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