Changeset 5ebff60 for protocols/oscar/aim.h
- Timestamp:
- 2015-02-20T22:50:54Z (10 years ago)
- Branches:
- master
- Children:
- 0b9daac, 3d45471, 7733b8c
- Parents:
- af359b4
- git-author:
- Indent <please@…> (19-02-15 05:47:20)
- git-committer:
- dequis <dx@…> (20-02-15 22:50:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/aim.h
raf359b4 r5ebff60 1 /* 1 /* 2 2 * Main libfaim header. Must be included in client for prototypes/macros. 3 3 * … … 29 29 30 30 #if defined(mach) && defined(__APPLE__) 31 #define gethostbyname(x) gethostbyname2(x, AF_INET) 31 #define gethostbyname(x) gethostbyname2(x, AF_INET) 32 32 #endif 33 33 34 /* 35 * Current Maximum Length for Screen Names (not including NULL) 34 /* 35 * Current Maximum Length for Screen Names (not including NULL) 36 36 * 37 37 * Currently only names up to 16 characters can be registered … … 53 53 * 54 54 * XXX: the real limit is the total SNAC size at 8192. Fix this. 55 * 55 * 56 56 */ 57 57 #define MAXMSGLEN 7987 … … 67 67 * 68 68 * This is actually defined by the protocol to be 69 * dynamic, but I have yet to see due cause to 69 * dynamic, but I have yet to see due cause to 70 70 * define it dynamically here. Maybe later. 71 71 * … … 81 81 82 82 /* 83 * Default Authorizer server name and TCP port for the OSCAR farm. 83 * Default Authorizer server name and TCP port for the OSCAR farm. 84 84 * 85 85 * You shouldn't need to change this unless you're writing 86 * your own server. 86 * your own server. 87 87 * 88 88 * Note that only one server is needed to start the whole … … 107 107 108 108 /* 109 * Client info. Filled in by the client and passed in to 109 * Client info. Filled in by the client and passed in to 110 110 * aim_send_login(). The information ends up getting passed to OSCAR 111 111 * through the initial login command. … … 124 124 125 125 #define AIM_CLIENTINFO_KNOWNGOOD_3_5_1670 { \ 126 "AOL Instant Messenger (SM), version 3.5.1670/WIN32", \127 0x0004, \128 0x0003, \129 0x0005, \130 0x0000, \131 0x0686, \132 "us", \133 "en", \126 "AOL Instant Messenger (SM), version 3.5.1670/WIN32", \ 127 0x0004, \ 128 0x0003, \ 129 0x0005, \ 130 0x0000, \ 131 0x0686, \ 132 "us", \ 133 "en", \ 134 134 } 135 135 136 136 #define AIM_CLIENTINFO_KNOWNGOOD_4_1_2010 { \ 137 138 139 140 141 142 143 144 137 "AOL Instant Messenger (SM), version 4.1.2010/WIN32", \ 138 0x0004, \ 139 0x0004, \ 140 0x0001, \ 141 0x0000, \ 142 0x07da, \ 143 "us", \ 144 "en", \ 145 145 } 146 146 147 147 #define AIM_CLIENTINFO_KNOWNGOOD_5_1_3036 { \ 148 "AOL Instant Messenger, version 5.1.3036/WIN32", \149 0x0109, \150 0x0005, \151 0x0001, \152 0x0000, \153 0x0bdc, \154 "us", \155 "en", \148 "AOL Instant Messenger, version 5.1.3036/WIN32", \ 149 0x0109, \ 150 0x0005, \ 151 0x0001, \ 152 0x0000, \ 153 0x0bdc, \ 154 "us", \ 155 "en", \ 156 156 } 157 157 158 158 /* 159 159 * I would make 4.1.2010 the default, but they seem to have found 160 * an alternate way of breaking that one. 160 * an alternate way of breaking that one. 161 161 * 162 162 * 3.5.1670 should work fine, however, you will be subjected to the 163 * memory test, which may require you to have a WinAIM binary laying 163 * memory test, which may require you to have a WinAIM binary laying 164 164 * around. (see login.c::memrequest()) 165 165 */ … … 171 171 #endif 172 172 173 /* 174 * These could be arbitrary, but its easier to use the actual AIM values 173 /* 174 * These could be arbitrary, but its easier to use the actual AIM values 175 175 */ 176 176 #define AIM_CONN_TYPE_AUTH 0x0007 … … 207 207 #define AIM_MTYPE_CONTACTS 0x13 208 208 #define AIM_MTYPE_PLUGIN 0x1A 209 #define AIM_MTYPE_AUTOAWAY 210 #define AIM_MTYPE_AUTOBUSY 211 #define AIM_MTYPE_AUTONA 212 #define AIM_MTYPE_AUTODND 213 #define AIM_MTYPE_AUTOFFC 209 #define AIM_MTYPE_AUTOAWAY 0xE8 210 #define AIM_MTYPE_AUTOBUSY 0xE9 211 #define AIM_MTYPE_AUTONA 0xEA 212 #define AIM_MTYPE_AUTODND 0xEB 213 #define AIM_MTYPE_AUTOFFC 0xEC 214 214 215 215 typedef struct aim_conn_s { … … 222 222 void *internal; /* internal conn-specific libfaim data */ 223 223 time_t lastactivity; /* time of last transmit */ 224 int forcedlatency; 224 int forcedlatency; 225 225 void *handlerlist; 226 226 void *sessv; /* pointer to parent session */ … … 252 252 guint8 hdrtype; /* defines which piece of the union to use */ 253 253 union { 254 struct { 254 struct { 255 255 guint8 type; 256 flap_seqnum_t seqnum; 256 flap_seqnum_t seqnum; 257 257 } flap; 258 258 } hdr; 259 aim_bstream_t data; 260 guint8 handled; 261 guint8 nofree; 259 aim_bstream_t data; /* payload stream */ 260 guint8 handled; /* 0 = new, !0 = been handled */ 261 guint8 nofree; /* 0 = free data on purge, 1 = only unlink */ 262 262 aim_conn_t *conn; /* the connection it came in on... */ 263 263 struct aim_frame_s *next; … … 273 273 274 274 /* 275 * AIM Session: The main client-data interface. 275 * AIM Session: The main client-data interface. 276 276 * 277 277 */ … … 281 281 282 282 /* Our screen name. */ 283 char sn[MAXSNLEN +1];283 char sn[MAXSNLEN + 1]; 284 284 285 285 /* 286 * Pointer to anything the client wants to 286 * Pointer to anything the client wants to 287 287 * explicitly associate with this session. 288 288 * … … 314 314 * I/O. I don't suggest that you use libfaim's internal I/O. 315 315 * Its really bad and the API/event model is quirky at best. 316 * 316 * 317 317 */ 318 aim_frame_t *queue_outgoing; 319 aim_frame_t *queue_incoming; 318 aim_frame_t *queue_outgoing; 319 aim_frame_t *queue_incoming; 320 320 321 321 /* … … 330 330 331 331 /* 332 * Outstanding snac handling 332 * Outstanding snac handling 333 333 * 334 334 * XXX: Should these be per-connection? -mid … … 384 384 */ 385 385 typedef struct { 386 char sn[MAXSNLEN +1];386 char sn[MAXSNLEN + 1]; 387 387 guint16 warnlevel; 388 388 guint16 idletime; … … 390 390 guint32 membersince; 391 391 guint32 onlinesince; 392 guint32 sessionlen; 392 guint32 sessionlen; 393 393 guint32 capabilities; 394 394 struct { … … 410 410 #define AIM_USERINFO_PRESENT_SESSIONLEN 0x00000100 411 411 412 #define AIM_FLAG_UNCONFIRMED 413 #define AIM_FLAG_ADMINISTRATOR 414 #define AIM_FLAG_AOL 415 #define AIM_FLAG_OSCAR_PAY 416 #define AIM_FLAG_FREE 417 #define AIM_FLAG_AWAY 418 #define AIM_FLAG_ICQ 419 #define AIM_FLAG_WIRELESS 420 #define AIM_FLAG_UNKNOWN100 421 #define AIM_FLAG_UNKNOWN200 412 #define AIM_FLAG_UNCONFIRMED 0x0001 /* "damned transients" */ 413 #define AIM_FLAG_ADMINISTRATOR 0x0002 414 #define AIM_FLAG_AOL 0x0004 415 #define AIM_FLAG_OSCAR_PAY 0x0008 416 #define AIM_FLAG_FREE 0x0010 417 #define AIM_FLAG_AWAY 0x0020 418 #define AIM_FLAG_ICQ 0x0040 419 #define AIM_FLAG_WIRELESS 0x0080 420 #define AIM_FLAG_UNKNOWN100 0x0100 421 #define AIM_FLAG_UNKNOWN200 0x0200 422 422 #define AIM_FLAG_ACTIVEBUDDY 0x0400 423 #define AIM_FLAG_UNKNOWN800 423 #define AIM_FLAG_UNKNOWN800 0x0800 424 424 #define AIM_FLAG_ABINTERNAL 0x1000 425 425 426 #define AIM_FLAG_ALLUSERS 426 #define AIM_FLAG_ALLUSERS 0x001f 427 427 428 428 /* … … 468 468 int aim_addtlvtochain_caps(aim_tlvlist_t **list, const guint16 t, const guint32 caps); 469 469 int aim_addtlvtochain_noval(aim_tlvlist_t **list, const guint16 type); 470 int aim_addtlvtochain_chatroom(aim_tlvlist_t **list, guint16 type, guint16 exchange, const char *roomname, guint16 instance); 470 int aim_addtlvtochain_chatroom(aim_tlvlist_t **list, guint16 type, guint16 exchange, const char *roomname, 471 guint16 instance); 471 472 int aim_addtlvtochain_userinfo(aim_tlvlist_t **list, guint16 type, aim_userinfo_t *ui); 472 473 int aim_addtlvtochain_frozentlvlist(aim_tlvlist_t **list, guint16 type, aim_tlvlist_t **tl); … … 543 544 void aim_conn_kill(aim_session_t *sess, aim_conn_t **deadconn); 544 545 545 int aim_conn_addhandler(aim_session_t *, aim_conn_t *conn, u_short family, u_short type, aim_rxcallback_t newhandler, u_short flags); 546 int aim_conn_addhandler(aim_session_t *, aim_conn_t *conn, u_short family, u_short type, aim_rxcallback_t newhandler, 547 u_short flags); 546 548 int aim_clearhandlers(aim_conn_t *conn); 547 549 … … 558 560 559 561 typedef void (*faim_debugging_callback_t)(aim_session_t *sess, int level, const char *format, va_list va); 560 int aim_setdebuggingcb(aim_session_t * sess, faim_debugging_callback_t);562 int aim_setdebuggingcb(aim_session_t * sess, faim_debugging_callback_t); 561 563 void aim_session_init(aim_session_t *, guint32 flags, int debuglevel); 562 564 void aim_session_kill(aim_session_t *); … … 618 620 /* aim_im.c */ 619 621 620 aim_conn_t *aim_sendfile_initiate(aim_session_t *, const char *destsn, const char *filename, guint16 numfiles, guint32 totsize); 622 aim_conn_t *aim_sendfile_initiate(aim_session_t *, const char *destsn, const char *filename, guint16 numfiles, 623 guint32 totsize); 621 624 622 625 aim_conn_t *aim_getfile_initiate(aim_session_t *sess, aim_conn_t *conn, const char *destsn); … … 653 656 #define AIM_TRANSFER_DENY_DECLINE 0x0001 654 657 #define AIM_TRANSFER_DENY_NOTACCEPTING 0x0002 655 aim_conn_t *aim_accepttransfer(aim_session_t *sess, aim_conn_t *conn, const char *sn, const guint8 *cookie, const guint8 *ip, guint16 listingfiles, guint16 listingtotsize, guint16 listingsize, guint32 listingchecksum, guint16 rendid); 658 aim_conn_t *aim_accepttransfer(aim_session_t *sess, aim_conn_t *conn, const char *sn, const guint8 *cookie, 659 const guint8 *ip, guint16 listingfiles, guint16 listingtotsize, guint16 listingsize, 660 guint32 listingchecksum, guint16 rendid); 656 661 657 662 int aim_getinfo(aim_session_t *, aim_conn_t *, const char *, unsigned short); 658 663 659 #define AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED 660 #define AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED 664 #define AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED 0x00000001 665 #define AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED 0x00000002 661 666 662 667 /* This is what the server will give you if you don't set them yourself. */ 663 668 #define AIM_IMPARAM_DEFAULTS { \ 664 0, \665 AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \666 512, /* !! Note how small this is. */ \667 (99.9)*10, (99.9)*10, \668 1000 /* !! And how large this is. */ \669 0, \ 670 AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \ 671 512, /* !! Note how small this is. */ \ 672 (99.9) * 10, (99.9) * 10, \ 673 1000 /* !! And how large this is. */ \ 669 674 } 670 675 671 676 /* This is what most AIM versions use. */ 672 677 #define AIM_IMPARAM_REASONABLE { \ 673 0, \674 AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \675 8000, \676 (99.9)*10, (99.9)*10, \677 0 \678 0, \ 679 AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \ 680 8000, \ 681 (99.9) * 10, (99.9) * 10, \ 682 0 \ 678 683 } 679 684 … … 716 721 }; 717 722 718 #define AIM_CHATFLAGS_NOREFLECT 719 #define AIM_CHATFLAGS_AWAY 720 #define AIM_CHATFLAGS_UNICODE 721 #define AIM_CHATFLAGS_ISO_8859_1 723 #define AIM_CHATFLAGS_NOREFLECT 0x0001 724 #define AIM_CHATFLAGS_AWAY 0x0002 725 #define AIM_CHATFLAGS_UNICODE 0x0004 726 #define AIM_CHATFLAGS_ISO_8859_1 0x0008 722 727 723 728 int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, guint16 flags, const char *msg, int msglen); … … 726 731 int aim_chatnav_reqrights(aim_session_t *sess, aim_conn_t *conn); 727 732 728 int aim_chat_invite(aim_session_t *sess, aim_conn_t *conn, const char *sn, const char *msg, guint16 exchange, const char *roomname, guint16 instance); 733 int aim_chat_invite(aim_session_t *sess, aim_conn_t *conn, const char *sn, const char *msg, guint16 exchange, 734 const char *roomname, guint16 instance); 729 735 730 736 int aim_chatnav_createroom(aim_session_t *sess, aim_conn_t *conn, const char *name, guint16 exchange); … … 738 744 * 739 745 */ 740 #define aimutil_put8(buf, data) ((*(buf) = (u_char) (data)&0xff),1)741 #define aimutil_get8(buf) ((*(buf)) &0xff)746 #define aimutil_put8(buf, data) ((*(buf) = (u_char) (data) & 0xff), 1) 747 #define aimutil_get8(buf) ((*(buf)) & 0xff) 742 748 #define aimutil_put16(buf, data) ( \ 743 (*(buf) = (u_char)((data)>>8)&0xff), \744 (*((buf)+1) = (u_char)(data)&0xff), \745 746 #define aimutil_get16(buf) ((((*(buf)) <<8)&0xff00) + ((*((buf)+1)) & 0xff))749 (*(buf) = (u_char) ((data) >> 8) & 0xff), \ 750 (*((buf) + 1) = (u_char) (data) & 0xff), \ 751 2) 752 #define aimutil_get16(buf) ((((*(buf)) << 8) & 0xff00) + ((*((buf) + 1)) & 0xff)) 747 753 #define aimutil_put32(buf, data) ( \ 748 (*((buf)) = (u_char)((data)>>24)&0xff), \749 (*((buf)+1) = (u_char)((data)>>16)&0xff), \750 (*((buf)+2) = (u_char)((data)>>8)&0xff), \751 (*((buf)+3) = (u_char)(data)&0xff), \752 753 #define aimutil_get32(buf) ((((*(buf)) <<24)&0xff000000) + \754 (((*((buf)+1))<<16)&0x00ff0000) + \755 (((*((buf)+2))<< 8)&0x0000ff00) + \756 (((*((buf)+3) )&0x000000ff)))754 (*((buf)) = (u_char) ((data) >> 24) & 0xff), \ 755 (*((buf) + 1) = (u_char) ((data) >> 16) & 0xff), \ 756 (*((buf) + 2) = (u_char) ((data) >> 8) & 0xff), \ 757 (*((buf) + 3) = (u_char) (data) & 0xff), \ 758 4) 759 #define aimutil_get32(buf) ((((*(buf)) << 24) & 0xff000000) + \ 760 (((*((buf) + 1)) << 16) & 0x00ff0000) + \ 761 (((*((buf) + 2)) << 8) & 0x0000ff00) + \ 762 (((*((buf) + 3)) & 0x000000ff))) 757 763 758 764 /* Little-endian versions (damn ICQ) */ 759 765 #define aimutil_putle8(buf, data) ( \ 760 (*(buf) = (unsigned char)(data) & 0xff), \761 766 (*(buf) = (unsigned char) (data) & 0xff), \ 767 1) 762 768 #define aimutil_getle8(buf) ( \ 763 764 769 (*(buf)) & 0xff \ 770 ) 765 771 #define aimutil_putle16(buf, data) ( \ 766 (*((buf)+0) = (unsigned char)((data) >> 0) & 0xff), \767 (*((buf)+1) = (unsigned char)((data) >> 8) & 0xff), \768 772 (*((buf) + 0) = (unsigned char) ((data) >> 0) & 0xff), \ 773 (*((buf) + 1) = (unsigned char) ((data) >> 8) & 0xff), \ 774 2) 769 775 #define aimutil_getle16(buf) ( \ 770 (((*((buf)+0)) << 0) & 0x00ff) + \771 (((*((buf)+1)) << 8) & 0xff00) \772 776 (((*((buf) + 0)) << 0) & 0x00ff) + \ 777 (((*((buf) + 1)) << 8) & 0xff00) \ 778 ) 773 779 #define aimutil_putle32(buf, data) ( \ 774 (*((buf)+0) = (unsigned char)((data) >> 0) & 0xff), \775 (*((buf)+1) = (unsigned char)((data) >> 8) & 0xff), \776 (*((buf)+2) = (unsigned char)((data) >> 16) & 0xff), \777 (*((buf)+3) = (unsigned char)((data) >> 24) & 0xff), \778 780 (*((buf) + 0) = (unsigned char) ((data) >> 0) & 0xff), \ 781 (*((buf) + 1) = (unsigned char) ((data) >> 8) & 0xff), \ 782 (*((buf) + 2) = (unsigned char) ((data) >> 16) & 0xff), \ 783 (*((buf) + 3) = (unsigned char) ((data) >> 24) & 0xff), \ 784 4) 779 785 #define aimutil_getle32(buf) ( \ 780 (((*((buf)+0)) << 0) & 0x000000ff) + \781 (((*((buf)+1)) << 8) & 0x0000ff00) + \782 (((*((buf)+2)) << 16) & 0x00ff0000) + \783 (((*((buf)+3)) << 24) & 0xff000000))786 (((*((buf) + 0)) << 0) & 0x000000ff) + \ 787 (((*((buf) + 1)) << 8) & 0x0000ff00) + \ 788 (((*((buf) + 2)) << 16) & 0x00ff0000) + \ 789 (((*((buf) + 3)) << 24) & 0xff000000)) 784 790 785 791 … … 797 803 /* 798 804 * SNAC Family: Ack. 799 * 805 * 800 806 * Not really a family, but treating it as one really 801 807 * helps it fit into the libfaim callback structure better. … … 806 812 /* 807 813 * SNAC Family: General. 808 */ 814 */ 809 815 #define AIM_CB_GEN_ERROR 0x0001 810 816 #define AIM_CB_GEN_CLIENTREADY 0x0002 … … 831 837 /* 832 838 * SNAC Family: Advertisement Services 833 */ 839 */ 834 840 #define AIM_CB_ADS_ERROR 0x0001 835 841 #define AIM_CB_ADS_DEFAULT 0xffff … … 840 846 * See non-SNAC note below. 841 847 */ 842 #define AIM_CB_OFT_DIRECTIMCONNECTREQ 0x0001 /* connect request -- actually an OSCAR CAP*/848 #define AIM_CB_OFT_DIRECTIMCONNECTREQ 0x0001 /* connect request -- actually an OSCAR CAP*/ 843 849 #define AIM_CB_OFT_DIRECTIMINCOMING 0x0002 844 850 #define AIM_CB_OFT_DIRECTIMDISCONNECT 0x0003 … … 869 875 * the SNAC-centered libfaim callback structure. 870 876 * 871 */ 877 */ 872 878 #define AIM_CB_SPECIAL_AUTHSUCCESS 0x0001 873 879 #define AIM_CB_SPECIAL_AUTHOTHER 0x0002
Note: See TracChangeset
for help on using the changeset viewer.