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