Changeset 862371b for libfaim/aim.h


Ignore:
Timestamp:
Jun 29, 2003, 1:47:04 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
e016fc2
Parents:
03ad7b2
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfaim/aim.h

    r5e53c4a r862371b  
    1212#define FAIM_VERSION_MAJOR 0
    1313#define FAIM_VERSION_MINOR 99
    14 #define FAIM_VERSION_MINORMINOR 4
     14#define FAIM_VERSION_MINORMINOR 1
    1515
    1616#include <faimconfig.h>
     
    2626#include <time.h>
    2727
    28 #ifdef _WIN32
    29 #include <windows.h>
    30 #include <io.h>
    31 #else
     28#ifndef _WIN32
    3229#include <sys/time.h>
    3330#include <unistd.h>
    3431#include <netinet/in.h>
    3532#include <sys/socket.h>
     33#else
     34#include <winsock.h>
    3635#endif
    3736
     
    4241typedef fu32_t aim_snacid_t;
    4342typedef fu16_t flap_seqnum_t;
    44 
    45 /* Portability stuff (DMP) */
    46 
    47 #ifdef _WIN32
    48 #define sleep(x) Sleep((x)*1000)
    49 #define snprintf _snprintf /* I'm not sure whats wrong with Microsoft here */
    50 #define close(x) closesocket(x) /* no comment */
    51 #endif
    5243
    5344#if defined(mach) && defined(__APPLE__)
     
    147138};
    148139
    149 #define AIM_CLIENTINFO_KNOWNGOOD_3_5_1670 { \
     140#define CLIENTINFO_AIM_3_5_1670 { \
    150141        "AOL Instant Messenger (SM), version 3.5.1670/WIN32", \
    151142        0x0004, \
     
    158149}
    159150
    160 #define AIM_CLIENTINFO_KNOWNGOOD_4_1_2010 { \
     151#define CLIENTINFO_AIM_4_1_2010 { \
    161152          "AOL Instant Messenger (SM), version 4.1.2010/WIN32", \
    162153          0x0004, \
     
    169160}
    170161
     162#define CLIENTINFO_AIM_5_0_2938 { \
     163          "AOL Instant Messenger, version 5.0.2938/WIN32", \
     164          0x0109, \
     165          0x0005, \
     166          0x0000, \
     167          0x0000, \
     168          0x0b7a, \
     169          "us", \
     170          "en", \
     171}
     172
     173#define CLIENTINFO_ICQ_4_65_3281 { \
     174        "ICQ Inc. - Product of ICQ (TM) 2000b.4.65.1.3281.85", \
     175        0x010a, \
     176        0x0004, \
     177        0x0041, \
     178        0x0001, \
     179        0x0cd1, \
     180        "us", \
     181        "en", \
     182}
     183
     184#define CLIENTINFO_ICQ_5_34_3728 { \
     185        "ICQ Inc. - Product of ICQ (TM).2002a.5.34.1.3728.85", \
     186        0x010a, \
     187        0x0005, \
     188        0x0022, \
     189        0x0001, \
     190        0x0e8f, \
     191        "us", \
     192        "en", \
     193}
     194
    171195/*
    172196 * I would make 4.1.2010 the default, but they seem to have found
     
    174198 *
    175199 * 3.5.1670 should work fine, however, you will be subjected to the
    176  * memory test, which may require you to have a WinAIM binary laying
     200 * memory test, which may require you to have a WinAIM binary lying
    177201 * around. (see login.c::memrequest())
    178202 */
    179 #define AIM_CLIENTINFO_KNOWNGOOD AIM_CLIENTINFO_KNOWNGOOD_3_5_1670
     203#define CLIENTINFO_AIM_KNOWNGOOD CLIENTINFO_AIM_3_5_1670
     204#define CLIENTINFO_ICQ_KNOWNGOOD CLIENTINFO_ICQ_4_65_3281
    180205
    181206#ifndef TRUE
     
    192217#define AIM_CONN_TYPE_CHAT          0x000e
    193218#define AIM_CONN_TYPE_CHATNAV       0x000d
     219#define AIM_CONN_TYPE_SEARCH        0x000f
     220#define AIM_CONN_TYPE_EMAIL         0x0018
    194221
    195222/* they start getting arbitrary in rendezvous stuff =) */
     
    250277typedef struct aim_bstream_s {
    251278        fu8_t *data;
    252         fu16_t len;
    253         fu16_t offset;
     279        fu32_t len;
     280        fu32_t offset;
    254281} aim_bstream_t;
    255282
     
    262289                } flap;
    263290                struct {
     291                        fu8_t magic[4]; /* ODC2 OFT2 */
     292                        fu16_t hdrlen;
    264293                        fu16_t type;
    265                         fu8_t magic[4]; /* ODC2 OFT2 */
    266                         fu16_t hdr2len;
    267                         fu8_t *hdr2; /* rest of bloated header */
    268                 } oft;
     294                } rend;
    269295        } hdr;
    270296        aim_bstream_t data;     /* payload stream */
     
    305331
    306332        /* ---- Internal Use Only ------------------------ */
     333
     334        /* Server-stored information (ssi) */
     335        struct {
     336                int received_data;
     337                fu16_t revision;
     338                struct aim_ssi_item *items;
     339                time_t timestamp;
     340                int waiting_for_ack;
     341                aim_frame_t *holding_queue;
     342        } ssi;
     343
     344        struct aim_emailinfo *emailinfo;
    307345
    308346        /* Connection information */
     
    381419        fu32_t membersince; /* time_t */
    382420        fu32_t onlinesince; /* time_t */
    383         fu32_t sessionlen; /* in seconds */
     421        fu32_t sessionlen;  /* in seconds */
    384422        fu32_t capabilities;
    385423        struct {
     
    459497/* TLV list handling. */
    460498faim_internal aim_tlvlist_t *aim_readtlvchain(aim_bstream_t *bs);
     499faim_internal aim_tlvlist_t *aim_readtlvchain_num(aim_bstream_t *bs, fu16_t num);
    461500faim_internal void aim_freetlvchain(aim_tlvlist_t **list);
    462501faim_internal aim_tlv_t *aim_gettlv(aim_tlvlist_t *, fu16_t t, const int n);
     
    518557        char *bosip;
    519558        fu8_t *cookie;
     559        char *chpassurl;
    520560        struct aim_clientrelease latestrelease;
    521561        struct aim_clientrelease latestbeta;
     
    574614faim_export aim_conn_t *aim_getconn_fd(aim_session_t *, int fd);
    575615
    576 /* aim_misc.c */
     616/* misc.c */
    577617
    578618#define AIM_VISIBILITYCHANGE_PERMITADD    0x05
     
    620660faim_export int aim_ads_requestads(aim_session_t *sess, aim_conn_t *conn);
    621661
    622 /* aim_im.c */
     662/* im.c */
    623663
    624664struct aim_fileheader_t {
     
    657697};
    658698
    659 struct aim_filetransfer_priv {
    660         char sn[MAXSNLEN];
    661         char cookie[8];
    662         char ip[30];
    663         int state;
    664         struct aim_fileheader_t fh;
    665 };
     699#define AIM_OFT_SUBTYPE_SEND_FILE 0x0001
     700#define AIM_OFT_SUBTYPE_SEND_DIR 0x0002
     701#define AIM_OFT_SUBTYPE_GET_FILE 0x0011
     702#define AIM_OPT_SUBTYPE_GET_LIST 0x0012
    666703
    667704struct aim_chat_roominfo {
     
    683720#define AIM_IMFLAGS_MULTIPART           0x0400 /* ->mpmsg section valid */
    684721#define AIM_IMFLAGS_OFFLINE             0x0800 /* send to offline user */
     722#define AIM_IMFLAGS_TYPINGNOT           0x1000 /* typing notification */
    685723
    686724/*
     
    822860                        const char *rtfmsg;
    823861                } rtfmsg;
     862                struct {
     863                        fu16_t subtype;
     864                        fu16_t totfiles;
     865                        fu32_t totsize;
     866                        char *filename;
     867                } sendfile;
    824868        } info;
    825869        void *destructor; /* used internally only */
     870};
     871
     872/* Valid values for channel 4 args->type */
     873#define AIM_ICQMSG_AUTHREQUEST 0x0006
     874#define AIM_ICQMSG_AUTHDENIED 0x0007
     875#define AIM_ICQMSG_AUTHGRANTED 0x0008
     876
     877struct aim_incomingim_ch4_args {
     878        fu32_t uin; /* Of the sender of the ICBM */
     879        fu16_t type;
     880        char *msg; /* Reason for auth request, deny, or accept */
    826881};
    827882
     
    831886faim_export int aim_send_icon(aim_session_t *sess, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu16_t iconsum);
    832887faim_export fu16_t aim_iconsum(const fu8_t *buf, int buflen);
    833 faim_export int aim_send_im_direct(aim_session_t *, aim_conn_t *, const char *msg);
     888faim_export int aim_send_typing(aim_session_t *sess, aim_conn_t *conn, int typing);
     889faim_export int aim_send_im_direct(aim_session_t *, aim_conn_t *, const char *msg, int len, int encoding);
    834890faim_export const char *aim_directim_getsn(aim_conn_t *conn);
    835891faim_export aim_conn_t *aim_directim_initiate(aim_session_t *, const char *destsn);
    836892faim_export aim_conn_t *aim_directim_connect(aim_session_t *, const char *sn, const char *addr, const fu8_t *cookie);
    837893
    838 faim_export aim_conn_t *aim_sendfile_initiate(aim_session_t *, const char *destsn, const char *filename, fu16_t numfiles, fu32_t totsize);
     894faim_export int aim_send_im_ch2_geticqmessage(aim_session_t *sess, const char *sn, int type);
     895faim_export aim_conn_t *aim_sendfile_initiate(aim_session_t *, const char *destsn, const char *filename, fu16_t numfiles, fu32_t totsize, char *cookret);
     896faim_export int aim_send_im_ch4(aim_session_t *sess, char *sn, fu16_t type, fu8_t *message);
     897
     898faim_export int aim_mtn_send(aim_session_t *sess, fu16_t type1, char *sn, fu16_t type2);
    839899
    840900faim_export aim_conn_t *aim_getfile_initiate(aim_session_t *sess, aim_conn_t *conn, const char *destsn);
    841901faim_export int aim_oft_getfile_request(aim_session_t *sess, aim_conn_t *conn, const char *name, int size);
     902faim_export int aim_oft_sendfile_request(aim_session_t *sess, aim_conn_t *conn,
     903                const char *name, int filesdone, int numfiles, int size,
     904                int totsize);
    842905faim_export int aim_oft_getfile_ack(aim_session_t *sess, aim_conn_t *conn);
    843 faim_export int aim_oft_getfile_end(aim_session_t *sess, aim_conn_t *conn);
    844 
    845 /* aim_info.c */
     906faim_export int aim_oft_end(aim_session_t *sess, aim_conn_t *conn);
     907
     908/* info.c */
    846909#define AIM_CAPS_BUDDYICON      0x00000001
    847910#define AIM_CAPS_VOICE          0x00000002
     
    904967#define AIM_TRANSFER_DENY_NOTACCEPTING 0x0002
    905968faim_export int aim_denytransfer(aim_session_t *sess, const char *sender, const char *cookie, unsigned short code);
    906 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 listingfiles, fu16_t listingtotsize, fu16_t listingsize, fu32_t listingchecksum, fu16_t rendid);
     969faim_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, ...);
     970faim_export int aim_canceltransfer(aim_session_t *sess, aim_conn_t *conn,
     971                                const char *cookie, const char *sn, int rendid);
     972faim_export fu32_t aim_update_checksum(aim_session_t *sess, aim_conn_t *conn,
     973                                const unsigned char *buffer, int bufferlen);
    907974
    908975faim_export int aim_getinfo(aim_session_t *, aim_conn_t *, const char *, unsigned short);
     
    9331000
    9341001struct aim_icbmparameters {
    935         unsigned short maxchan;
    936         unsigned long flags; /* AIM_IMPARAM_FLAG_ */
    937         unsigned short maxmsglen; /* message size that you will accept */
    938         unsigned short maxsenderwarn; /* this and below are *10 (999=99.9%) */
    939         unsigned short maxrecverwarn;
    940         unsigned long minmsginterval; /* in milliseconds? */
     1002        fu16_t maxchan;
     1003        fu32_t flags; /* AIM_IMPARAM_FLAG_ */
     1004        fu16_t maxmsglen; /* message size that you will accept */
     1005        fu16_t maxsenderwarn; /* this and below are *10 (999=99.9%) */
     1006        fu16_t maxrecverwarn;
     1007        fu32_t minmsginterval; /* in milliseconds? */
    9411008};
    9421009
     
    9541021faim_export int aim_admin_setnick(aim_session_t *sess, aim_conn_t *conn, const char *newnick);
    9551022
    956 /* aim_buddylist.c */
     1023/* buddylist.c */
    9571024faim_export int aim_add_buddy(aim_session_t *, aim_conn_t *, const char *);
    9581025faim_export int aim_remove_buddy(aim_session_t *, aim_conn_t *, const char *);
    9591026
    960 /* aim_search.c */
     1027/* search.c */
    9611028faim_export int aim_usersearch_address(aim_session_t *, aim_conn_t *, const char *);
     1029
     1030/* newsearch.c */
     1031struct aim_usersearch {
     1032        char *first;
     1033        char *last;
     1034        char *middle;
     1035        char *maiden;
     1036        char *email;
     1037        char *country;
     1038        char *state;
     1039        char *city;
     1040        char *sn;
     1041        char *interest;
     1042        char *nick;
     1043        char *zip;
     1044        char *region;
     1045        char *address;
     1046        struct aim_usersearch *next;
     1047};
     1048
     1049faim_export int aim_usersearch_email(aim_session_t *, const char *, const char *);
     1050faim_export int aim_usersearch_name(aim_session_t *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *);
     1051faim_export int aim_usersearch_interest(aim_session_t *, const char *, const char *);
     1052
    9621053
    9631054/* These apply to exchanges as well. */
     
    9951086#define AIM_SSI_TYPE_BUDDY         0x0000
    9961087#define AIM_SSI_TYPE_GROUP         0x0001
    997 #define AIM_SSI_TYPE_PERMITLIST    0x0002
    998 #define AIM_SSI_TYPE_DENYLIST      0x0003
     1088#define AIM_SSI_TYPE_PERMIT        0x0002
     1089#define AIM_SSI_TYPE_DENY          0x0003
    9991090#define AIM_SSI_TYPE_PDINFO        0x0004
    10001091#define AIM_SSI_TYPE_PRESENCEPREFS 0x0005
     
    10091100};
    10101101
     1102/* These build the actual SNACs and queue them to be sent */
    10111103faim_export int aim_ssi_reqrights(aim_session_t *sess, aim_conn_t *conn);
    10121104faim_export int aim_ssi_reqdata(aim_session_t *sess, aim_conn_t *conn, time_t localstamp, fu16_t localrev);
    10131105faim_export int aim_ssi_enable(aim_session_t *sess, aim_conn_t *conn);
     1106faim_export int aim_ssi_addmoddel(aim_session_t *sess, aim_conn_t *conn, struct aim_ssi_item **items, unsigned int num, fu16_t subtype);
    10141107faim_export int aim_ssi_modbegin(aim_session_t *sess, aim_conn_t *conn);
    10151108faim_export int aim_ssi_modend(aim_session_t *sess, aim_conn_t *conn);
     1109
     1110/* These handle the local variables */
     1111faim_export struct aim_ssi_item *aim_ssi_itemlist_find(struct aim_ssi_item *list, fu16_t gid, fu16_t bid);
     1112faim_export struct aim_ssi_item *aim_ssi_itemlist_finditem(struct aim_ssi_item *list, const char *gn, const char *sn, fu16_t type);
     1113faim_export struct aim_ssi_item *aim_ssi_itemlist_findparent(struct aim_ssi_item *list, char *sn);
     1114faim_export int aim_ssi_getpermdeny(struct aim_ssi_item *list);
     1115faim_export fu32_t aim_ssi_getpresence(struct aim_ssi_item *list);
     1116faim_export int aim_ssi_cleanlist(aim_session_t *sess, aim_conn_t *conn);
     1117faim_export int aim_ssi_addbuddies(aim_session_t *sess, aim_conn_t *conn, const char *gn, const char **sn, unsigned int num);
     1118faim_export int aim_ssi_addmastergroup(aim_session_t *sess, aim_conn_t *conn);
     1119faim_export int aim_ssi_addgroups(aim_session_t *sess, aim_conn_t *conn, const char **gn, unsigned int num);
     1120faim_export int aim_ssi_addpord(aim_session_t *sess, aim_conn_t *conn, const char **sn, unsigned int num, fu16_t type);
     1121faim_export int aim_ssi_movebuddy(aim_session_t *sess, aim_conn_t *conn, const char *oldgn, const char *newgn, const char *sn);
     1122faim_export int aim_ssi_rename_group(aim_session_t *sess, aim_conn_t *conn, const char *oldgn, const char *newgn);
     1123faim_export int aim_ssi_delbuddies(aim_session_t *sess, aim_conn_t *conn, const char *gn, char **sn, unsigned int num);
     1124faim_export int aim_ssi_delmastergroup(aim_session_t *sess, aim_conn_t *conn);
     1125faim_export int aim_ssi_delgroups(aim_session_t *sess, aim_conn_t *conn, char **gn, unsigned int num);
     1126faim_export int aim_ssi_deletelist(aim_session_t *sess, aim_conn_t *conn);
     1127faim_export int aim_ssi_delpord(aim_session_t *sess, aim_conn_t *conn, const char **sn, unsigned int num, fu16_t type);
     1128faim_export int aim_ssi_setpermdeny(aim_session_t *sess, aim_conn_t *conn, fu8_t permdeny, fu32_t vismask);
     1129faim_export int aim_ssi_setpresence(aim_session_t *sess, aim_conn_t *conn, fu32_t presence);
    10161130
    10171131struct aim_icq_offlinemsg {
     
    10351149faim_export int aim_icq_getsimpleinfo(aim_session_t *sess, const char *uin);
    10361150
    1037 /* aim_util.c */
     1151/* email.c */
     1152struct aim_emailinfo {
     1153        fu8_t *cookie16;
     1154        fu8_t *cookie8;
     1155        char *url;
     1156        fu16_t nummsgs;
     1157        fu8_t unread;
     1158        char *domain;
     1159        fu16_t flag;
     1160        struct aim_emailinfo *next;
     1161};
     1162
     1163faim_export int aim_email_sendcookies(aim_session_t *sess, aim_conn_t *conn);
     1164faim_export int aim_email_activate(aim_session_t *sess, aim_conn_t *conn);
     1165
     1166/* util.c */
    10381167/*
    10391168 * These are really ugly.  You'd think this was LISP.  I wish it was.
     
    11001229faim_export char *aim_strsep(char **pp, const char *delim);
    11011230
    1102 /* aim_meta.c */
     1231/* meta.c */
    11031232faim_export char *aim_getbuilddate(void);
    11041233faim_export char *aim_getbuildtime(void);
Note: See TracChangeset for help on using the changeset viewer.