comparison libfaim/aim_misc.c @ 1302:4c5c2fcb83cd

[gaim-migrate @ 1312] libfaim stuff committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 19 Dec 2000 03:08:06 +0000
parents 385c1a1d96aa
children
comparison
equal deleted inserted replaced
1301:e973ef7a8a87 1302:4c5c2fcb83cd
299 /* 299 /*
300 * aim_bos_clientready() 300 * aim_bos_clientready()
301 * 301 *
302 * Send Client Ready. 302 * Send Client Ready.
303 * 303 *
304 * TODO: Dynamisize.
305 *
306 */ 304 */
307 faim_export unsigned long aim_bos_clientready(struct aim_session_t *sess, 305 faim_export unsigned long aim_bos_clientready(struct aim_session_t *sess,
308 struct aim_conn_t *conn) 306 struct aim_conn_t *conn)
309 { 307 {
310 u_char command_2[] = { 308 #define AIM_TOOL_JAVA 0x0001
311 /* placeholders for dynamic data */ 309 #define AIM_TOOL_MAC 0x0002
312 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 310 #define AIM_TOOL_WIN16 0x0003
313 0xff, 0xff, 311 #define AIM_TOOL_WIN32 0x0004
314 /* real data */ 312 #define AIM_TOOL_MAC68K 0x0005
315 0x00, 0x01, 313 #define AIM_TOOL_MACPPC 0x0006
316 0x00, 0x03, 314 struct aim_tool_version {
317 0x00, 0x04, 315 unsigned short group;
318 0x06, 0x86, /* the good ones */ 316 unsigned short version;
319 #if 0 317 unsigned short tool;
320 0x07, 0xda, /* DUPLE OF DEATH! */ 318 unsigned short toolversion;
321 #endif 319 } tools[] = {
322 320 {0x0001, 0x0003, AIM_TOOL_WIN32, 0x0686},
323 0x00, 0x02, 321 {0x0002, 0x0001, AIM_TOOL_WIN32, 0x0001},
324 0x00, 0x01, 322 {0x0003, 0x0001, AIM_TOOL_WIN32, 0x0001},
325 0x00, 0x04, 323 {0x0004, 0x0001, AIM_TOOL_WIN32, 0x0001},
326 0x00, 0x01, 324 {0x0006, 0x0001, AIM_TOOL_WIN32, 0x0001},
327 325 {0x0008, 0x0001, AIM_TOOL_WIN32, 0x0001},
328 0x00, 0x03, 326 {0x0009, 0x0001, AIM_TOOL_WIN32, 0x0001},
329 0x00, 0x01, 327 {0x000a, 0x0001, AIM_TOOL_WIN32, 0x0001},
330 0x00, 0x04, 328 {0x000b, 0x0001, AIM_TOOL_WIN32, 0x0001}
331 0x00, 0x01,
332
333 0x00, 0x04,
334 0x00, 0x01,
335 0x00, 0x04,
336 0x00, 0x01,
337
338 0x00, 0x06,
339 0x00, 0x01,
340 0x00, 0x04,
341 0x00, 0x01,
342 0x00, 0x08,
343 0x00, 0x01,
344 0x00, 0x04,
345 0x00, 0x01,
346
347 0x00, 0x09,
348 0x00, 0x01,
349 0x00, 0x04,
350 0x00, 0x01,
351 0x00, 0x0a,
352 0x00, 0x01,
353 0x00, 0x04,
354 0x00, 0x01,
355
356 0x00, 0x0b,
357 0x00, 0x01,
358 0x00, 0x04,
359 0x00, 0x01
360 }; 329 };
361 int command_2_len = 0x52; 330 int i,j;
362 struct command_tx_struct *newpacket; 331 struct command_tx_struct *newpacket;
363 332 int toolcount = sizeof(tools)/sizeof(struct aim_tool_version);
364 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, command_2_len))) 333
365 return -1; 334 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 1152)))
366 335 return -1;
367 newpacket->lock = 1; 336
368 337 newpacket->lock = 1;
369 memcpy(newpacket->data, command_2, command_2_len); 338
370 339 i = aim_putsnac(newpacket->data, 0x0001, 0x0002, 0x0000, sess->snac_nextid);
371 /* This write over the dynamic parts of the byte block */ 340 aim_cachesnac(sess, 0x0001, 0x0002, 0x0000, NULL, 0);
372 aim_putsnac(newpacket->data, 0x0001, 0x0002, 0x0000, sess->snac_nextid); 341
373 342 for (j = 0; j < toolcount; j++) {
374 aim_tx_enqueue(sess, newpacket); 343 i += aimutil_put16(newpacket->data+i, tools[j].group);
375 344 i += aimutil_put16(newpacket->data+i, tools[j].version);
376 return (sess->snac_nextid++); 345 i += aimutil_put16(newpacket->data+i, tools[j].tool);
346 i += aimutil_put16(newpacket->data+i, tools[j].toolversion);
347 }
348
349 newpacket->commandlen = i;
350 newpacket->lock = 0;
351
352 aim_tx_enqueue(sess, newpacket);
353
354 return sess->snac_nextid;
377 } 355 }
378 356
379 /* 357 /*
380 * Request Rate Information. 358 * Request Rate Information.
381 * 359 *