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