Changes in protocols/oscar/service.c [d18db32f:6042a54]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/service.c
rd18db32f r6042a54 352 352 snacid = aim_cachesnac(sess, 0x0001, 0x0008, 0x0000, NULL, 0); 353 353 aim_putsnac(&fr->data, 0x0001, 0x0008, 0x0000, snacid); 354 355 for (rc = ins->rates; rc; rc = rc->next)356 aimbs_put16(&fr->data, rc->classid);357 358 aim_tx_enqueue(sess, fr);359 360 return 0;361 }362 363 /* Delete Rate Parameter (group 1, type 9) */364 int aim_rates_delparam(aim_session_t *sess, aim_conn_t *conn)365 {366 aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;367 aim_frame_t *fr;368 aim_snacid_t snacid;369 struct rateclass *rc;370 371 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 512)))372 return -ENOMEM;373 374 snacid = aim_cachesnac(sess, 0x0001, 0x0009, 0x0000, NULL, 0);375 aim_putsnac(&fr->data, 0x0001, 0x0009, 0x0000, snacid);376 354 377 355 for (rc = ins->rates; rc; rc = rc->next) … … 431 409 } 432 410 433 /*434 * Service Pause Acknowledgement (group 1, type 0x0c)435 *436 * It is rather important that aim_sendpauseack() gets called for the exact437 * same connection that the Server Pause callback was called for, since438 * libfaim extracts the data for the SNAC from the connection structure.439 *440 * Of course, if you don't do that, more bad things happen than just what441 * libfaim can cause.442 *443 */444 int aim_sendpauseack(aim_session_t *sess, aim_conn_t *conn)445 {446 aim_frame_t *fr;447 aim_snacid_t snacid;448 aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;449 struct snacgroup *sg;450 451 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 1024)))452 return -ENOMEM;453 454 snacid = aim_cachesnac(sess, 0x0001, 0x000c, 0x0000, NULL, 0);455 aim_putsnac(&fr->data, 0x0001, 0x000c, 0x0000, snacid);456 457 /*458 * This list should have all the groups that the original459 * Host Online / Server Ready said this host supports. And460 * we want them all back after the migration.461 */462 for (sg = ins->groups; sg; sg = sg->next)463 aimbs_put16(&fr->data, sg->group);464 465 aim_tx_enqueue(sess, fr);466 467 return 0;468 }469 470 411 /* Service Resume (group 1, type 0x0d) */ 471 412 static int serverresume(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) … … 517 458 518 459 return 0; 519 }520 521 /*522 * Idle Notification (group 1, type 0x11)523 *524 * Should set your current idle time in seconds. Note that this should525 * never be called consecutively with a non-zero idle time. That makes526 * OSCAR do funny things. Instead, just set it once you go idle, and then527 * call it again with zero when you're back.528 *529 */530 int aim_bos_setidle(aim_session_t *sess, aim_conn_t *conn, guint32 idletime)531 {532 return aim_genericreq_l(sess, conn, 0x0001, 0x0011, &idletime);533 460 } 534 461 … … 637 564 } 638 565 639 /*640 * No-op (group 1, type 0x16)641 *642 * WinAIM sends these every 4min or so to keep the connection alive. Its not643 * real necessary.644 *645 */646 int aim_nop(aim_session_t *sess, aim_conn_t *conn)647 {648 return aim_genericreq_n(sess, conn, 0x0001, 0x0016);649 }650 566 651 567 /* … … 702 618 703 619 /* This is frivolous. (Thank you SmarterChild.) */ 704 aim_bstream_empty(bs); 620 aim_bstream_empty(bs); /* == vercount * 4 */ 705 621 versions = aimbs_getraw(bs, aim_bstream_empty(bs)); 706 622 g_free(versions); … … 735 651 data |= AIM_ICQ_STATE_WEBAWARE; 736 652 737 aim_addtlvtochain32(&tl, 0x0006, data); 653 aim_addtlvtochain32(&tl, 0x0006, data); /* tlvlen */ 738 654 739 655 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 8))) … … 807 723 g_free(modname); 808 724 aim_freetlvchain(&list); 809 810 return 0;811 }812 813 /* Client verification reply (group 1, subtype 0x20) */814 int aim_sendmemblock(aim_session_t *sess, aim_conn_t *conn, guint32 offset, guint32 len, const guint8 *buf, guint8 flag)815 {816 aim_frame_t *fr;817 aim_snacid_t snacid;818 819 if (!sess || !conn)820 return -EINVAL;821 822 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+2+16)))823 return -ENOMEM;824 825 snacid = aim_cachesnac(sess, 0x0001, 0x0020, 0x0000, NULL, 0);826 827 aim_putsnac(&fr->data, 0x0001, 0x0020, 0x0000, snacid);828 aimbs_put16(&fr->data, 0x0010); /* md5 is always 16 bytes */829 830 if ((flag == AIM_SENDMEMBLOCK_FLAG_ISHASH) && buf && (len == 0x10)) { /* we're getting a hash */831 832 aimbs_putraw(&fr->data, buf, 0x10);833 834 } else if (buf && (len > 0)) { /* use input buffer */835 md5_state_t state;836 md5_byte_t digest[0x10];837 838 md5_init(&state);839 md5_append(&state, (const md5_byte_t *)buf, len);840 md5_finish(&state, digest);841 842 aimbs_putraw(&fr->data, (guint8 *)digest, 0x10);843 844 } else if (len == 0) { /* no length, just hash NULL (buf is optional) */845 md5_state_t state;846 guint8 nil = '\0';847 md5_byte_t digest[0x10];848 849 /*850 * These MD5 routines are stupid in that you have to have851 * at least one append. So thats why this doesn't look852 * real logical.853 */854 md5_init(&state);855 md5_append(&state, (const md5_byte_t *)&nil, 0);856 md5_finish(&state, digest);857 858 aimbs_putraw(&fr->data, (guint8 *)digest, 0x10);859 860 } else {861 862 /*863 * This data is correct for AIM 3.5.1670.864 *865 * Using these blocks is as close to "legal" as you can get866 * without using an AIM binary.867 *868 */869 if ((offset == 0x03ffffff) && (len == 0x03ffffff)) {870 871 #if 1 /* with "AnrbnrAqhfzcd" */872 aimbs_put32(&fr->data, 0x44a95d26);873 aimbs_put32(&fr->data, 0xd2490423);874 aimbs_put32(&fr->data, 0x93b8821f);875 aimbs_put32(&fr->data, 0x51c54b01);876 #else /* no filename */877 aimbs_put32(&fr->data, 0x1df8cbae);878 aimbs_put32(&fr->data, 0x5523b839);879 aimbs_put32(&fr->data, 0xa0e10db3);880 aimbs_put32(&fr->data, 0xa46d3b39);881 #endif882 883 /* len can't be 0 here anyway...884 } else if ((offset == 0x00001000) && (len == 0x00000000)) {885 886 aimbs_put32(&fr->data, 0xd41d8cd9);887 aimbs_put32(&fr->data, 0x8f00b204);888 aimbs_put32(&fr->data, 0xe9800998);889 aimbs_put32(&fr->data, 0xecf8427e);890 */891 } else892 imcb_error(sess->aux_data, "Warning: unknown hash request");893 894 }895 896 aim_tx_enqueue(sess, fr);897 725 898 726 return 0;
Note: See TracChangeset
for help on using the changeset viewer.