comparison src/protocols/oscar/aim.h @ 4617:858979ab3867

[gaim-migrate @ 4908] Big Changes: -Rewrote some of the perl stuff so perl scripts can change a few of their parameters -Receiving a file with AIM over oscar works pretty well Now, the "nitty gritty": Very minor change to prefs.c: In the plugins details tab, I changed "URL" to "Web Site." I was just going to fix the tabbing, but silvestrij suggested changing it to "Web site," and I thought that sounded good. I think it fits better, too. I dunno, maybe that's just me. "Get Capabilities" has stopped working for some reason. I'm just going to blame AOL. It's really not important anyway, and some people wanted it taken off. It is now #ifdef 0'ed out. I'll remove it completely if it continues to no longer function. I took out a few plugin_event calls from oscar.c and put them in core code. "event_error" should be, uh, "evented" when there is an error signing on. Hopefully no one was using this. It's really pretty useless. The parameter is now the reason for not being able to connect rather than the archaic toc error code. I screwed around with how perl functions are called some. There was way the hell too much malloc'ing going on here. I think all in all it's an improvement, though I'm still not a big fan of how changes to parameters propagate to the actual memory. I really think it would be nice if the perl stuff was made into a C plugin. It's just so much cleaner. Especially if someone wanted to write, say, a python or tcl interpreter. That's how xchat2 does it. I just think that would be really slick. Like butter. Or ice. Very unlike Velcro. I added a "Change Password" Protocol Action for ICQ over oscar. This was really pretty easy. I'd like to thank my housemate Andrew for complaining a lot that having to use Windows ICQ to change his password was a pain. I rewrote a lot of the oscar file transfer stuff to use Christian's new xfer interface. This involved moving a few functions from ft.c to im.c, where they belong. I also removed all the #if 0'ed getfile functions. I'll be rewritting them soonish. Receiving a file should work perfectly, aside from maybe a small memleak when stuff is canceled. Sending a file is currently disabled. No ETA on when I'll have that working. I renamed pretty much all of the functions in im.c so they have kind of a scheme now. They should all be aim_im_bleh, since "im" is the family name. There comes a time when you must break the crap out of any clients that might be using libfaim in order to make stuff cleaner. Maybe. I got rid of the snac destructor stuff for now. I'll probably add it back later. I wasn't entirely comfortable with how it was done. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 26 Feb 2003 05:01:37 +0000
parents 051265d35a36
children a964972cb361
comparison
equal deleted inserted replaced
4616:767093a2ddaf 4617:858979ab3867
26 #include <time.h> 26 #include <time.h>
27 27
28 #ifndef _WIN32 28 #ifndef _WIN32
29 #include <sys/time.h> 29 #include <sys/time.h>
30 #include <unistd.h> 30 #include <unistd.h>
31 #include <netdb.h>
31 #include <netinet/in.h> 32 #include <netinet/in.h>
32 #include <sys/socket.h> 33 #include <sys/socket.h>
33 #else 34 #else
34 #include <winsock.h> 35 #include <winsock.h>
35 #endif 36 #endif
249 #endif 250 #endif
250 251
251 /* 252 /*
252 * These could be arbitrary, but its easier to use the actual AIM values 253 * These could be arbitrary, but its easier to use the actual AIM values
253 */ 254 */
254 #define AIM_CONN_TYPE_AUTH 0x0007 255 #define AIM_CONN_TYPE_BOS 0x0002
255 #define AIM_CONN_TYPE_ADS 0x0005 256 #define AIM_CONN_TYPE_ADS 0x0005
256 #define AIM_CONN_TYPE_BOS 0x0002 257 #define AIM_CONN_TYPE_AUTH 0x0007
257 #define AIM_CONN_TYPE_CHAT 0x000e 258 #define AIM_CONN_TYPE_CHATNAV 0x000d
258 #define AIM_CONN_TYPE_CHATNAV 0x000d 259 #define AIM_CONN_TYPE_CHAT 0x000e
259 #define AIM_CONN_TYPE_SEARCH 0x000f 260 #define AIM_CONN_TYPE_SEARCH 0x000f
260 #define AIM_CONN_TYPE_EMAIL 0x0018 261 #define AIM_CONN_TYPE_EMAIL 0x0018
261 262
262 /* they start getting arbitrary in rendezvous stuff =) */ 263 /* they start getting arbitrary for rendezvous stuff =) */
263 #define AIM_CONN_TYPE_RENDEZVOUS 0x0101 /* these do not speak FLAP! */ 264 #define AIM_CONN_TYPE_RENDEZVOUS 0xfffe /* these do not speak FLAP! */
264 #define AIM_CONN_TYPE_RENDEZVOUS_OUT 0x0102 /* socket waiting for accept() */ 265 #define AIM_CONN_TYPE_LISTENER 0xffff /* socket waiting for accept() */
265 266
266 /* 267 /*
267 * Subtypes, we need these for OFT stuff. 268 * Subtypes, we need these for OFT stuff.
268 */ 269 */
269 #define AIM_CONN_SUBTYPE_OFT_DIRECTIM 0x0001 270 #define AIM_CONN_SUBTYPE_OFT_DIRECTIM 0x0001
326 struct { 327 struct {
327 fu8_t type; 328 fu8_t type;
328 flap_seqnum_t seqnum; 329 flap_seqnum_t seqnum;
329 } flap; 330 } flap;
330 struct { 331 struct {
331 fu8_t magic[4]; /* ODC2 OFT2 */ 332 fu8_t magic[4]; /* ODC2 or OFT2 */
332 fu16_t hdrlen; 333 fu16_t hdrlen;
333 fu16_t type; 334 fu16_t type;
334 } rend; 335 } rend;
335 } hdr; 336 } hdr;
336 aim_bstream_t data; /* payload stream */ 337 aim_bstream_t data; /* payload stream */
677 #define AIM_PRIVFLAGS_ALLOWMEMBERSINCE 0x02 678 #define AIM_PRIVFLAGS_ALLOWMEMBERSINCE 0x02
678 679
679 #define AIM_WARN_ANON 0x01 680 #define AIM_WARN_ANON 0x01
680 681
681 faim_export int aim_sendpauseack(aim_session_t *sess, aim_conn_t *conn); 682 faim_export int aim_sendpauseack(aim_session_t *sess, aim_conn_t *conn);
682 faim_export int aim_send_warning(aim_session_t *sess, aim_conn_t *conn, const char *destsn, fu32_t flags);
683 faim_export int aim_nop(aim_session_t *, aim_conn_t *); 683 faim_export int aim_nop(aim_session_t *, aim_conn_t *);
684 faim_export int aim_flap_nop(aim_session_t *sess, aim_conn_t *conn); 684 faim_export int aim_flap_nop(aim_session_t *sess, aim_conn_t *conn);
685 faim_export int aim_bos_setidle(aim_session_t *, aim_conn_t *, fu32_t); 685 faim_export int aim_bos_setidle(aim_session_t *, aim_conn_t *, fu32_t);
686 faim_export int aim_bos_changevisibility(aim_session_t *, aim_conn_t *, int, const char *); 686 faim_export int aim_bos_changevisibility(aim_session_t *, aim_conn_t *, int, const char *);
687 faim_export int aim_bos_setbuddylist(aim_session_t *, aim_conn_t *, const char *); 687 faim_export int aim_bos_setbuddylist(aim_session_t *, aim_conn_t *, const char *);
695 faim_export int aim_bos_reqlocaterights(aim_session_t *, aim_conn_t *); 695 faim_export int aim_bos_reqlocaterights(aim_session_t *, aim_conn_t *);
696 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); 696 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);
697 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); 697 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);
698 faim_export int aim_setextstatus(aim_session_t *sess, aim_conn_t *conn, fu32_t status); 698 faim_export int aim_setextstatus(aim_session_t *sess, aim_conn_t *conn, fu32_t status);
699 699
700 faim_export struct aim_fileheader_t *aim_getlisting(aim_session_t *sess, FILE *);
701
702 #define AIM_CLIENTTYPE_UNKNOWN 0x0000 700 #define AIM_CLIENTTYPE_UNKNOWN 0x0000
703 #define AIM_CLIENTTYPE_MC 0x0001 701 #define AIM_CLIENTTYPE_MC 0x0001
704 #define AIM_CLIENTTYPE_WINAIM 0x0002 702 #define AIM_CLIENTTYPE_WINAIM 0x0002
705 #define AIM_CLIENTTYPE_WINAIM41 0x0003 703 #define AIM_CLIENTTYPE_WINAIM41 0x0003
706 #define AIM_CLIENTTYPE_AOL_TOC 0x0004 704 #define AIM_CLIENTTYPE_AOL_TOC 0x0004
707 faim_export unsigned short aim_fingerprintclient(unsigned char *msghdr, int len); 705 faim_export unsigned short aim_im_fingerprint(unsigned char *msghdr, int len);
708 706
709 #define AIM_RATE_CODE_CHANGE 0x0001 707 #define AIM_RATE_CODE_CHANGE 0x0001
710 #define AIM_RATE_CODE_WARNING 0x0002 708 #define AIM_RATE_CODE_WARNING 0x0002
711 #define AIM_RATE_CODE_LIMIT 0x0003 709 #define AIM_RATE_CODE_LIMIT 0x0003
712 #define AIM_RATE_CODE_CLEARLIMIT 0x0004 710 #define AIM_RATE_CODE_CLEARLIMIT 0x0004
713 faim_export int aim_ads_requestads(aim_session_t *sess, aim_conn_t *conn); 711 faim_export int aim_ads_requestads(aim_session_t *sess, aim_conn_t *conn);
714 712
713
714
715 /* im.c */ 715 /* im.c */
716 716 #define AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED 0x00000001
717 struct aim_fileheader_t { 717 #define AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED 0x00000002
718 #if 0 718
719 char magic[4]; /* 0 */ 719 /* This is what the server will give you if you don't set them yourself. */
720 short hdrlen; /* 4 */ 720 #define AIM_IMPARAM_DEFAULTS { \
721 short hdrtype; /* 6 */ 721 0, \
722 #endif 722 AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \
723 char bcookie[8]; /* 8 */ 723 512, /* !! Note how small this is. */ \
724 short encrypt; /* 16 */ 724 (99.9)*10, (99.9)*10, \
725 short compress; /* 18 */ 725 1000 /* !! And how large this is. */ \
726 short totfiles; /* 20 */ 726 }
727 short filesleft; /* 22 */ 727
728 short totparts; /* 24 */ 728 /* This is what most AIM versions use. */
729 short partsleft; /* 26 */ 729 #define AIM_IMPARAM_REASONABLE { \
730 long totsize; /* 28 */ 730 0, \
731 long size; /* 32 */ 731 AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \
732 long modtime; /* 36 */ 732 8000, \
733 long checksum; /* 40 */ 733 (99.9)*10, (99.9)*10, \
734 long rfrcsum; /* 44 */ 734 0 \
735 long rfsize; /* 48 */ 735 }
736 long cretime; /* 52 */ 736
737 long rfcsum; /* 56 */ 737 struct aim_icbmparameters {
738 long nrecvd; /* 60 */ 738 fu16_t maxchan;
739 long recvcsum; /* 64 */ 739 fu32_t flags; /* AIM_IMPARAM_FLAG_ */
740 char idstring[32]; /* 68 */ 740 fu16_t maxmsglen; /* message size that you will accept */
741 char flags; /* 100 */ 741 fu16_t maxsenderwarn; /* this and below are *10 (999=99.9%) */
742 char lnameoffset; /* 101 */ 742 fu16_t maxrecverwarn;
743 char lsizeoffset; /* 102 */ 743 fu32_t minmsginterval; /* in milliseconds? */
744 char dummy[69]; /* 103 */ 744 };
745 char macfileinfo[16]; /* 172 */
746 short nencode; /* 188 */
747 short nlanguage; /* 190 */
748 char name[64]; /* 192 */
749 /* 256 */
750 };
751
752 #define AIM_OFT_SUBTYPE_SEND_FILE 0x0001
753 #define AIM_OFT_SUBTYPE_SEND_DIR 0x0002
754 #define AIM_OFT_SUBTYPE_GET_FILE 0x0011
755 #define AIM_OPT_SUBTYPE_GET_LIST 0x0012
756 745
757 struct aim_chat_roominfo { 746 struct aim_chat_roominfo {
758 unsigned short exchange; 747 unsigned short exchange;
759 char *name; 748 char *name;
760 unsigned short instance; 749 unsigned short instance;
884 #define AIM_RENDEZVOUS_PROPOSE 0x0000 873 #define AIM_RENDEZVOUS_PROPOSE 0x0000
885 #define AIM_RENDEZVOUS_CANCEL 0x0001 874 #define AIM_RENDEZVOUS_CANCEL 0x0001
886 #define AIM_RENDEZVOUS_ACCEPT 0x0002 875 #define AIM_RENDEZVOUS_ACCEPT 0x0002
887 876
888 struct aim_incomingim_ch2_args { 877 struct aim_incomingim_ch2_args {
878 fu16_t status;
889 fu8_t cookie[8]; 879 fu8_t cookie[8];
890 fu16_t reqclass; 880 fu16_t reqclass;
891 fu16_t status;
892 fu16_t errorcode;
893 const char *clientip; 881 const char *clientip;
894 const char *clientip2; 882 const char *clientip2;
895 const char *verifiedip; 883 const char *verifiedip;
896 fu16_t port; 884 fu16_t port;
885 fu16_t errorcode;
897 const char *msg; /* invite message or file description */ 886 const char *msg; /* invite message or file description */
898 const char *encoding; 887 const char *encoding;
899 const char *language; 888 const char *language;
900 union { 889 union {
901 struct { 890 struct {
933 fu8_t flags; 922 fu8_t flags;
934 char *msg; /* Reason for auth request, deny, or accept */ 923 char *msg; /* Reason for auth request, deny, or accept */
935 int msglen; 924 int msglen;
936 }; 925 };
937 926
938 faim_export int aim_send_rtfmsg(aim_session_t *sess, struct aim_sendrtfmsg_args *args); 927 /* SNAC sending functions */
939 faim_export int aim_send_im_ext(aim_session_t *sess, struct aim_sendimext_args *args); 928 /* 0x0002 */ faim_export int aim_im_setparams(aim_session_t *sess, struct aim_icbmparameters *params);
940 faim_export int aim_send_im(aim_session_t *, const char *destsn, unsigned short flags, const char *msg); 929 /* 0x0004 */ faim_export int aim_im_reqparams(aim_session_t *sess);
941 faim_export int aim_send_icon(aim_session_t *sess, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu16_t iconsum); 930 /* 0x0006 */ faim_export int aim_im_sendch1_ext(aim_session_t *sess, struct aim_sendimext_args *args);
942 faim_export fu16_t aim_iconsum(const fu8_t *buf, int buflen); 931 /* 0x0006 */ faim_export int aim_im_sendch1(aim_session_t *, const char *destsn, unsigned short flags, const char *msg);
943 faim_export int aim_send_typing(aim_session_t *sess, aim_conn_t *conn, int typing); 932 /* 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);
944 faim_export int aim_send_im_direct(aim_session_t *, aim_conn_t *, const char *msg, int len, int encoding); 933 /* 0x0006 */ faim_export int aim_im_sendch2_rtfmsg(aim_session_t *sess, struct aim_sendrtfmsg_args *args);
945 faim_export const char *aim_directim_getsn(aim_conn_t *conn); 934 /* 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);
946 faim_export aim_conn_t *aim_directim_initiate(aim_session_t *, const char *destsn); 935 /* 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);
947 faim_export aim_conn_t *aim_directim_connect(aim_session_t *, const char *sn, const char *addr, const fu8_t *cookie); 936 /* 0x0006 */ faim_export int aim_im_sendch2_sendfile_accept(aim_session_t *sess, const fu8_t *cookie, const char *sn, fu16_t rendid);
948 937 /* 0x0006 */ faim_export int aim_im_sendch2_sendfile_cancel(aim_session_t *sess, const fu8_t *cookie, const char *sn, fu16_t rendid);
949 faim_export int aim_send_im_ch2_geticqmessage(aim_session_t *sess, const char *sn, int type); 938 /* 0x0006 */ faim_export int aim_im_sendch2_geticqaway(aim_session_t *sess, const char *sn, int type);
950 faim_export aim_conn_t *aim_sendfile_initiate(aim_session_t *, const char *destsn, const char *filename, fu16_t numfiles, fu32_t totsize, char *cookret); 939 /* 0x0006 */ faim_export int aim_im_sendch4(aim_session_t *sess, char *sn, fu16_t type, fu8_t *message);
951 faim_export int aim_send_im_ch4(aim_session_t *sess, char *sn, fu16_t type, fu8_t *message); 940 /* 0x0008 */ faim_export int aim_im_warn(aim_session_t *sess, aim_conn_t *conn, const char *destsn, fu32_t flags);
952 941 /* 0x000b */ faim_export int aim_im_denytransfer(aim_session_t *sess, const char *sender, const char *cookie, unsigned short code);
953 faim_export int aim_mtn_send(aim_session_t *sess, fu16_t type1, char *sn, fu16_t type2); 942 /* 0x0014 */ faim_export int aim_im_sendmtn(aim_session_t *sess, fu16_t type1, char *sn, fu16_t type2);
954 943
955 faim_export aim_conn_t *aim_getfile_initiate(aim_session_t *sess, aim_conn_t *conn, const char *destsn); 944
956 faim_export int aim_oft_getfile_request(aim_session_t *sess, aim_conn_t *conn, const char *name, int size); 945
957 faim_export int aim_oft_sendfile_request(aim_session_t *sess, aim_conn_t *conn, 946 /* ft.c */
958 const char *name, int filesdone, int numfiles, int size, 947 #define AIM_OFT_SUBTYPE_SEND_FILE 0x0001
959 int totsize); 948 #define AIM_OFT_SUBTYPE_SEND_DIR 0x0002
960 faim_export int aim_oft_getfile_ack(aim_session_t *sess, aim_conn_t *conn); 949 #define AIM_OFT_SUBTYPE_GET_FILE 0x0011
961 faim_export int aim_oft_end(aim_session_t *sess, aim_conn_t *conn); 950 #define AIM_OPT_SUBTYPE_GET_LIST 0x0012
951
952 #define AIM_TRANSFER_DENY_NOTSUPPORTED 0x0000
953 #define AIM_TRANSFER_DENY_DECLINE 0x0001
954 #define AIM_TRANSFER_DENY_NOTACCEPTING 0x0002
955
956 struct aim_fileheader_t {
957 #if 0
958 char magic[4]; /* 0 */
959 fu16_t hdrlen; /* 4 */
960 fu16_t hdrtype; /* 6 */
961 #endif
962 char bcookie[8]; /* 8 */
963 fu16_t encrypt; /* 16 */
964 fu16_t compress; /* 18 */
965 fu16_t totfiles; /* 20 */
966 fu16_t filesleft; /* 22 */
967 fu16_t totparts; /* 24 */
968 fu16_t partsleft; /* 26 */
969 fu32_t totsize; /* 28 */
970 fu32_t size; /* 32 */
971 fu32_t modtime; /* 36 */
972 fu32_t checksum; /* 40 */
973 fu32_t rfrcsum; /* 44 */
974 fu32_t rfsize; /* 48 */
975 fu32_t cretime; /* 52 */
976 fu32_t rfcsum; /* 56 */
977 fu32_t nrecvd; /* 60 */
978 fu32_t recvcsum; /* 64 */
979 fu8_t idstring[32]; /* 68 */
980 fu8_t flags; /* 100 */
981 fu8_t lnameoffset; /* 101 */
982 fu8_t lsizeoffset; /* 102 */
983 char dummy[69]; /* 103 */
984 char macfileinfo[16]; /* 172 */
985 fu16_t nencode; /* 188 */
986 fu16_t nlanguage; /* 190 */
987 char name[64]; /* 192 */
988 /* 256 */
989 };
990
991 struct aim_filetransfer_priv {
992 char cookie[8];
993 char ip[30];
994 int state;
995 struct aim_fileheader_t fh;
996 };
997
998 faim_export fu32_t aim_oft_checksum(const unsigned char *buffer, int bufferlen, fu32_t prevcheck);
999 faim_export int aim_handlerendconnect(aim_session_t *sess, aim_conn_t *cur);
1000 faim_export int aim_odc_send_typing(aim_session_t *sess, aim_conn_t *conn, int typing);
1001 faim_export int aim_odc_send_im(aim_session_t *sess, aim_conn_t *conn, const char *msg, int len, int encoding);
1002 faim_export const char *aim_odc_getsn(aim_conn_t *conn);
1003 faim_export aim_conn_t *aim_odc_getconn(aim_session_t *sess, const char *sn);
1004 faim_export aim_conn_t *aim_odc_initiate(aim_session_t *sess, const char *sn);
1005 faim_export aim_conn_t *aim_odc_connect(aim_session_t *sess, const char *sn, const char *addr, const fu8_t *cookie);
1006 faim_export aim_conn_t *aim_sendfile_listen(aim_session_t *sess, const fu8_t *cookie, const fu8_t *ip, fu16_t port);
1007 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);
1008
1009
962 1010
963 /* info.c */ 1011 /* info.c */
964 #define AIM_CAPS_BUDDYICON 0x00000001 1012 #define AIM_CAPS_BUDDYICON 0x00000001
965 #define AIM_CAPS_VOICE 0x00000002 1013 #define AIM_CAPS_VOICE 0x00000002
966 #define AIM_CAPS_IMIMAGE 0x00000004 1014 #define AIM_CAPS_IMIMAGE 0x00000004
1013 #define AIM_COOKIETYPE_OFTSEND 0x12 1061 #define AIM_COOKIETYPE_OFTSEND 0x12
1014 #define AIM_COOKIETYPE_OFTVOICE 0x13 1062 #define AIM_COOKIETYPE_OFTVOICE 0x13
1015 #define AIM_COOKIETYPE_OFTIMAGE 0x14 1063 #define AIM_COOKIETYPE_OFTIMAGE 0x14
1016 #define AIM_COOKIETYPE_OFTICON 0x15 1064 #define AIM_COOKIETYPE_OFTICON 0x15
1017 1065
1018 faim_export int aim_handlerendconnect(aim_session_t *sess, aim_conn_t *cur);
1019
1020 #define AIM_TRANSFER_DENY_NOTSUPPORTED 0x0000
1021 #define AIM_TRANSFER_DENY_DECLINE 0x0001
1022 #define AIM_TRANSFER_DENY_NOTACCEPTING 0x0002
1023 faim_export int aim_denytransfer(aim_session_t *sess, const char *sender, const char *cookie, unsigned short code);
1024 faim_export aim_conn_t *aim_accepttransfer(aim_session_t *sess, aim_conn_t *conn, const char *sn, const fu8_t *cookie, const fu8_t *ip, fu16_t port, fu16_t rendid, ...);
1025 faim_export int aim_canceltransfer(aim_session_t *sess, aim_conn_t *conn,
1026 const char *cookie, const char *sn, int rendid);
1027 faim_export fu32_t aim_update_checksum(aim_session_t *sess, aim_conn_t *conn,
1028 const unsigned char *buffer, int bufferlen);
1029
1030 faim_export int aim_getinfo(aim_session_t *, aim_conn_t *, const char *, unsigned short); 1066 faim_export int aim_getinfo(aim_session_t *, aim_conn_t *, const char *, unsigned short);
1031 faim_export int aim_sendbuddyoncoming(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *info); 1067 faim_export int aim_sendbuddyoncoming(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *info);
1032 faim_export int aim_sendbuddyoffgoing(aim_session_t *sess, aim_conn_t *conn, const char *sn); 1068 faim_export int aim_sendbuddyoffgoing(aim_session_t *sess, aim_conn_t *conn, const char *sn);
1033 1069
1034 #define AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED 0x00000001
1035 #define AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED 0x00000002
1036
1037 /* This is what the server will give you if you don't set them yourself. */
1038 #define AIM_IMPARAM_DEFAULTS { \
1039 0, \
1040 AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \
1041 512, /* !! Note how small this is. */ \
1042 (99.9)*10, (99.9)*10, \
1043 1000 /* !! And how large this is. */ \
1044 }
1045
1046 /* This is what most AIM versions use. */
1047 #define AIM_IMPARAM_REASONABLE { \
1048 0, \
1049 AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \
1050 8000, \
1051 (99.9)*10, (99.9)*10, \
1052 0 \
1053 }
1054
1055
1056 struct aim_icbmparameters {
1057 fu16_t maxchan;
1058 fu32_t flags; /* AIM_IMPARAM_FLAG_ */
1059 fu16_t maxmsglen; /* message size that you will accept */
1060 fu16_t maxsenderwarn; /* this and below are *10 (999=99.9%) */
1061 fu16_t maxrecverwarn;
1062 fu32_t minmsginterval; /* in milliseconds? */
1063 };
1064
1065 faim_export int aim_reqicbmparams(aim_session_t *sess);
1066 faim_export int aim_seticbmparam(aim_session_t *sess, struct aim_icbmparameters *params);
1067 1070
1068 1071
1069 /* auth.c */ 1072 /* auth.c */
1070 faim_export int aim_sendcookie(aim_session_t *, aim_conn_t *, const fu16_t length, const fu8_t *); 1073 faim_export int aim_sendcookie(aim_session_t *, aim_conn_t *, const fu16_t length, const fu8_t *);
1071 1074
1073 faim_export int aim_admin_reqconfirm(aim_session_t *sess, aim_conn_t *conn); 1076 faim_export int aim_admin_reqconfirm(aim_session_t *sess, aim_conn_t *conn);
1074 faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info); 1077 faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info);
1075 faim_export int aim_admin_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail); 1078 faim_export int aim_admin_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail);
1076 faim_export int aim_admin_setnick(aim_session_t *sess, aim_conn_t *conn, const char *newnick); 1079 faim_export int aim_admin_setnick(aim_session_t *sess, aim_conn_t *conn, const char *newnick);
1077 1080
1081
1082
1078 /* buddylist.c */ 1083 /* buddylist.c */
1079 faim_export int aim_add_buddy(aim_session_t *, aim_conn_t *, const char *); 1084 faim_export int aim_add_buddy(aim_session_t *, aim_conn_t *, const char *);
1080 faim_export int aim_remove_buddy(aim_session_t *, aim_conn_t *, const char *); 1085 faim_export int aim_remove_buddy(aim_session_t *, aim_conn_t *, const char *);
1081 1086
1087
1088
1082 /* search.c */ 1089 /* search.c */
1083 faim_export int aim_usersearch_address(aim_session_t *, aim_conn_t *, const char *); 1090 faim_export int aim_usersearch_address(aim_session_t *, aim_conn_t *, const char *);
1091
1092
1084 1093
1085 /* newsearch.c */ 1094 /* newsearch.c */
1086 struct aim_usersearch { 1095 struct aim_usersearch {
1087 char *first; 1096 char *first;
1088 char *last; 1097 char *last;
1244 char *workwebpage; 1253 char *workwebpage;
1245 }; 1254 };
1246 1255
1247 faim_export int aim_icq_reqofflinemsgs(aim_session_t *sess); 1256 faim_export int aim_icq_reqofflinemsgs(aim_session_t *sess);
1248 faim_export int aim_icq_ackofflinemsgs(aim_session_t *sess); 1257 faim_export int aim_icq_ackofflinemsgs(aim_session_t *sess);
1258 faim_export int aim_icq_changepasswd(aim_session_t *sess, const char *passwd);
1249 faim_export int aim_icq_getsimpleinfo(aim_session_t *sess, const char *uin); 1259 faim_export int aim_icq_getsimpleinfo(aim_session_t *sess, const char *uin);
1250 faim_export int aim_icq_getallinfo(aim_session_t *sess, const char *uin); 1260 faim_export int aim_icq_getallinfo(aim_session_t *sess, const char *uin);
1261
1262
1251 1263
1252 /* email.c */ 1264 /* email.c */
1253 struct aim_emailinfo { 1265 struct aim_emailinfo {
1254 fu8_t *cookie16; 1266 fu8_t *cookie16;
1255 fu8_t *cookie8; 1267 fu8_t *cookie8;
1261 struct aim_emailinfo *next; 1273 struct aim_emailinfo *next;
1262 }; 1274 };
1263 1275
1264 faim_export int aim_email_sendcookies(aim_session_t *sess, aim_conn_t *conn); 1276 faim_export int aim_email_sendcookies(aim_session_t *sess, aim_conn_t *conn);
1265 faim_export int aim_email_activate(aim_session_t *sess, aim_conn_t *conn); 1277 faim_export int aim_email_activate(aim_session_t *sess, aim_conn_t *conn);
1278
1279
1266 1280
1267 /* util.c */ 1281 /* util.c */
1268 /* 1282 /*
1269 * These are really ugly. You'd think this was LISP. I wish it was. 1283 * These are really ugly. You'd think this was LISP. I wish it was.
1270 * 1284 *
1317 (((*((buf)+2)) << 16) & 0x00ff0000) + \ 1331 (((*((buf)+2)) << 16) & 0x00ff0000) + \
1318 (((*((buf)+3)) << 24) & 0xff000000)) 1332 (((*((buf)+3)) << 24) & 0xff000000))
1319 1333
1320 1334
1321 faim_export int aimutil_putstr(u_char *, const char *, int); 1335 faim_export int aimutil_putstr(u_char *, const char *, int);
1336 faim_export fu16_t aimutil_iconsum(const fu8_t *buf, int buflen);
1337 faim_export int aim_util_getlocalip(fu8_t *ip);
1322 faim_export int aimutil_tokslen(char *toSearch, int index, char dl); 1338 faim_export int aimutil_tokslen(char *toSearch, int index, char dl);
1323 faim_export int aimutil_itemcnt(char *toSearch, char dl); 1339 faim_export int aimutil_itemcnt(char *toSearch, char dl);
1324 faim_export char *aimutil_itemidx(char *toSearch, int index, char dl); 1340 faim_export char *aimutil_itemidx(char *toSearch, int index, char dl);
1325 1341
1326 faim_export int aim_snlen(const char *sn); 1342 faim_export int aim_snlen(const char *sn);