Changeset 7869e48 for libfaim/service.c
- Timestamp:
- Jan 12, 2013, 1:43:13 PM (11 years ago)
- Children:
- e3a0d71, 4485285
- Parents:
- 4626016
- git-author:
- Jason Gross <jgross@mit.edu> (01/12/13 13:13:18)
- git-committer:
- Jason Gross <jgross@mit.edu> (01/12/13 13:43:13)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfaim/service.c
rcf02dd6 r7869e48 29 29 /* 30 30 * Send only the tool versions that the server cares about (that it 31 * marked as supporting in the server ready SNAC). 31 * marked as supporting in the server ready SNAC). 32 32 */ 33 33 for (sg = ins->groups; sg; sg = sg->next) { … … 50 50 /* 51 51 * Subtype 0x0003 - Host Online 52 * 52 * 53 53 * See comments in conn.c about how the group associations are supposed 54 54 * to work, and how they really work. … … 58 58 * We don't actually call the client here. This starts off the connection 59 59 * initialization routine required by all AIM connections. The next time 60 * the client is called is the CONNINITDONE callback, which should be 60 * the client is called is the CONNINITDONE callback, which should be 61 61 * shortly after the rate information is acknowledged. 62 * 62 * 63 63 */ 64 64 static int hostonline(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) … … 89 89 aim_setversions(sess, rx->conn); 90 90 91 return 1; 91 return 1; 92 92 } 93 93 … … 161 161 * it. The rate classes, their limiting properties, and the definitions 162 162 * of which SNACs are belong to which class, are defined in the 163 * Rate Response packet at login to each host. 163 * Rate Response packet at login to each host. 164 164 * 165 165 * Logically, all rate offenses within one class count against further … … 194 194 * 195 195 * The only other thing of note is that class 5 (chat) has slightly looser 196 * limiting properties than class 3 (normal messages). But thats just a 196 * limiting properties than class 3 (normal messages). But thats just a 197 197 * small bit of trivia for you. 198 198 * … … 200 200 * system is how the actual numbers relate to the passing of time. This 201 201 * seems to be a big mystery. 202 * 202 * 203 203 */ 204 204 … … 289 289 * depending on the version we advertised in 1/17. If we 290 290 * didn't send 1/17 (evil!), then this will crash and you 291 * die, as it will default to the old version but we have 292 * the new version hardcoded here. 291 * die, as it will default to the old version but we have 292 * the new version hardcoded here. 293 293 */ 294 294 if (mod->version >= 3) … … 350 350 { 351 351 aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside; 352 aim_frame_t *fr; 352 aim_frame_t *fr; 353 353 aim_snacid_t snacid; 354 354 struct rateclass *rc; 355 355 356 356 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 512))) 357 return -ENOMEM; 357 return -ENOMEM; 358 358 359 359 snacid = aim_cachesnac(sess, 0x0001, 0x0008, 0x0000, NULL, 0); … … 372 372 { 373 373 aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside; 374 aim_frame_t *fr; 374 aim_frame_t *fr; 375 375 aim_snacid_t snacid; 376 376 struct rateclass *rc; 377 377 378 378 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 512))) 379 return -ENOMEM; 379 return -ENOMEM; 380 380 381 381 snacid = aim_cachesnac(sess, 0x0001, 0x0009, 0x0000, NULL, 0); … … 400 400 code = aimbs_get16(bs); 401 401 rateclass = aimbs_get16(bs); 402 402 403 403 windowsize = aimbs_get32(bs); 404 404 clear = aimbs_get32(bs); … … 418 418 * How Migrations work. 419 419 * 420 * The server sends a Server Pause message, which the client should respond to 421 * with a Server Pause Ack, which contains the families it needs on this 422 * connection. The server will send a Migration Notice with an IP address, and 423 * then disconnect. Next the client should open the connection and send the 420 * The server sends a Server Pause message, which the client should respond to 421 * with a Server Pause Ack, which contains the families it needs on this 422 * connection. The server will send a Migration Notice with an IP address, and 423 * then disconnect. Next the client should open the connection and send the 424 424 * cookie. Repeat the normal login process and pretend this never happened. 425 425 * … … 465 465 466 466 /* 467 * This list should have all the groups that the original 468 * Host Online / Server Ready said this host supports. And 467 * This list should have all the groups that the original 468 * Host Online / Server Ready said this host supports. And 469 469 * we want them all back after the migration. 470 470 */ … … 521 521 522 522 memset(&userinfo, 0, sizeof(aim_userinfo_t)); 523 523 524 524 newevil = aimbs_get16(bs); 525 525 … … 558 558 * 559 559 * This is the final SNAC sent on the original connection during a migration. 560 * It contains the IP and cookie used to connect to the new server, and 560 * It contains the IP and cookie used to connect to the new server, and 561 561 * optionally a list of the SNAC groups being migrated. 562 562 * … … 576 576 * moves to the new server. When not all the groups for a connection 577 577 * are migrated, or they are all migrated but some groups are moved 578 * to a different server than others, it is called a bifurcated 578 * to a different server than others, it is called a bifurcated 579 579 * migration. 580 580 * … … 624 624 * 3 System bulletin 625 625 * 4 Nothing's wrong ("top o the world" -- normal) 626 * 5 Lets-break-something. 626 * 5 Lets-break-something. 627 627 * 628 628 */ 629 629 id = aimbs_get16(bs); 630 630 631 /* 632 * TLVs follow 631 /* 632 * TLVs follow 633 633 */ 634 634 tlvlist = aim_tlvlist_read(bs); … … 646 646 } 647 647 648 /* 648 /* 649 649 * Subtype 0x0014 - Set privacy flags 650 650 * … … 663 663 * Subtype 0x0016 - No-op 664 664 * 665 * WinAIM sends these every 4min or so to keep the connection alive. Its not 665 * WinAIM sends these every 4min or so to keep the connection alive. Its not 666 666 * really necessary. 667 667 * 668 * Wha? No? Since when? I think WinAIM sends an empty channel 3 668 * Wha? No? Since when? I think WinAIM sends an empty channel 3 669 669 * SNAC as a no-op... 670 670 */ … … 674 674 } 675 675 676 /* 676 /* 677 677 * Subtype 0x0017 - Set client versions 678 678 * 679 * If you've seen the clientonline/clientready SNAC you're probably 679 * If you've seen the clientonline/clientready SNAC you're probably 680 680 * wondering what the point of this one is. And that point seems to be 681 681 * that the versions in the client online SNAC are sent too late for the 682 682 * server to be able to use them to change the protocol for the earlier 683 * login packets (client versions are sent right after Host Online is 683 * login packets (client versions are sent right after Host Online is 684 684 * received, but client online versions aren't sent until quite a bit later). 685 685 * We can see them already making use of this by changing the format of … … 705 705 /* 706 706 * Send only the versions that the server cares about (that it 707 * marked as supporting in the server ready SNAC). 707 * marked as supporting in the server ready SNAC). 708 708 */ 709 709 for (sg = ins->groups; sg; sg = sg->next) { … … 741 741 } 742 742 743 /* 743 /* 744 744 * Subtype 0x001e - Extended Status 745 745 * 746 746 * Sets your ICQ status (available, away, do not disturb, etc.) 747 747 * 748 * These are the same TLVs seen in user info. You can 748 * These are the same TLVs seen in user info. You can 749 749 * also set 0x0008 and 0x000c. 750 750 */ … … 767 767 snacid = aim_cachesnac(sess, 0x0001, 0x001e, 0x0000, NULL, 0); 768 768 aim_putsnac(&fr->data, 0x0001, 0x001e, 0x0000, snacid); 769 769 770 770 aim_tlvlist_add_32(&tl, 0x0006, data); 771 771 aim_tlvlist_write(&fr->data, &tl); 772 772 aim_tlvlist_free(&tl); 773 773 774 774 aim_tx_enqueue(sess, fr); 775 775 … … 777 777 } 778 778 779 /* 779 /* 780 780 * Subtype 0x001e - Extended Status. 781 781 * 782 * Sets your "available" message. This is currently only supported by iChat 782 * Sets your "available" message. This is currently only supported by iChat 783 783 * and Gaim. 784 784 * 785 * These are the same TLVs seen in user info. You can 785 * These are the same TLVs seen in user info. You can 786 786 * also set 0x0008 and 0x000c. 787 787 */ … … 851 851 * the data that the specific client should have, the client will get the 852 852 * following message from "AOL Instant Messenger": 853 * "You have been disconnected from the AOL Instant Message Service (SM) 853 * "You have been disconnected from the AOL Instant Message Service (SM) 854 854 * for accessing the AOL network using unauthorized software. You can 855 * download a FREE, fully featured, and authorized client, here 855 * download a FREE, fully featured, and authorized client, here 856 856 * http://www.aol.com/aim/download2.html" 857 857 * The connection is then closed, recieving disconnect code 1, URL 858 * http://www.aim.aol.com/errors/USER_LOGGED_OFF_NEW_LOGIN.html. 859 * 860 * Note, however, that numerous inconsistencies can cause the above error, 858 * http://www.aim.aol.com/errors/USER_LOGGED_OFF_NEW_LOGIN.html. 859 * 860 * Note, however, that numerous inconsistencies can cause the above error, 861 861 * not just sending back a bad hash. Do not immediatly suspect this code 862 862 * if you get disconnected. AOL and the open/free software community have … … 935 935 if ((flag == AIM_SENDMEMBLOCK_FLAG_ISHASH) && buf && (len == 0x10)) { /* we're getting a hash */ 936 936 937 aimbs_putraw(&fr->data, buf, 0x10); 937 aimbs_putraw(&fr->data, buf, 0x10); 938 938 939 939 } else if (buf && (len > 0)) { /* use input buffer */ … … 941 941 md5_byte_t digest[0x10]; 942 942 943 md5_init(&state); 943 md5_init(&state); 944 944 md5_append(&state, (const md5_byte_t *)buf, len); 945 945 md5_finish(&state, digest); … … 954 954 /* 955 955 * These MD5 routines are stupid in that you have to have 956 * at least one append. So thats why this doesn't look 956 * at least one append. So thats why this doesn't look 957 957 * real logical. 958 958 */ … … 965 965 } else { 966 966 967 /* 967 /* 968 968 * This data is correct for AIM 3.5.1670. 969 969 * … … 1006 1006 * Subtype 0x0021 - Receive our extended status 1007 1007 * 1008 * This is used for iChat's "available" messages, and maybe ICQ extended 1009 * status messages? It's also used to tell the client whether or not it 1008 * This is used for iChat's "available" messages, and maybe ICQ extended 1009 * status messages? It's also used to tell the client whether or not it 1010 1010 * needs to upload an SSI buddy icon... who engineers this stuff, anyway? 1011 1011 */ … … 1017 1017 fu8_t flags, length; 1018 1018 1019 type = aimbs_get16(bs); 1019 type = aimbs_get16(bs); 1020 1020 flags = aimbs_get8(bs); 1021 1021 length = aimbs_get8(bs);
Note: See TracChangeset
for help on using the changeset viewer.