⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oscar.h

📁 Linux下的多协议即时通讯程序源代码
💻 H
📖 第 1 页 / 共 4 页
字号:
	const char *destsn;	guint32 fgcolor;	guint32 bgcolor;	const char *rtfmsg; /* must be in RTF */};/* * This information is provided in the Incoming ICBM callback for * Channel 1 ICBM's. * * Note that although CUSTOMFEATURES and CUSTOMCHARSET say they * are optional, both are always set by the current libfaim code. * That may or may not change in the future.  It is mainly for * consistency with aim_sendimext_args. * * Multipart messages require some explanation. If you want to use them, * I suggest you read all the comments in family_icbm.c. * */struct aim_incomingim_ch1_args{	/* Always provided */	aim_mpmsg_t mpmsg;	guint32 icbmflags; /* some flags apply only to ->msg, not all mpmsg */	/* Only provided if message has a human-readable section */	gchar *msg;	int msglen;	/* Only provided if AIM_IMFLAGS_HASICON is set */	time_t iconstamp;	guint32 iconlen;	guint16 iconsum;	/* Only provided if AIM_IMFLAGS_CUSTOMFEATURES is set */	guint8 *features;	guint8 featureslen;	/* Only provided if AIM_IMFLAGS_EXTDATA is set */	guint8 extdatalen;	guint8 *extdata;	/* Only used if AIM_IMFLAGS_CUSTOMCHARSET is set */	guint16 charset;	guint16 charsubset;};/* Valid values for channel 2 args->status */#define AIM_RENDEZVOUS_PROPOSE   0x0000#define AIM_RENDEZVOUS_CANCEL    0x0001#define AIM_RENDEZVOUS_CONNECTED 0x0002struct _IcbmArgsCh2{	guint16 status;	guchar cookie[8];	int type; /* One of the OSCAR_CAPABILITY_ constants */	const char *proxyip;	const char *clientip;	const char *verifiedip;	guint16 port;	gboolean use_proxy;	guint16 errorcode;	const char *msg; /* invite message or file description */	guint16 msglen;	const char *encoding;	const char *language;	guint16 requestnumber;	union {		struct {			guint32 checksum;			guint32 length;			time_t timestamp;			guint8 *icon;		} icon;		struct {			struct aim_chat_roominfo roominfo;		} chat;		struct {			guint16 msgtype;			guint32 fgcolor;			guint32 bgcolor;			const char *rtfmsg;		} rtfmsg;		struct {			guint16 subtype;			guint16 totfiles;			guint32 totsize;			char *filename;		} sendfile;	} info;	void *destructor; /* used internally only */};/* Valid values for channel 4 args->type */#define AIM_ICQMSG_AUTHREQUEST	0x0006#define AIM_ICQMSG_AUTHDENIED	0x0007#define AIM_ICQMSG_AUTHGRANTED	0x0008struct aim_incomingim_ch4_args{	guint32 uin; /* Of the sender of the ICBM */	guint8 type;	guint8 flags;	gchar *msg; /* Reason for auth request, deny, or accept */	int msglen;};/* SNAC sending functions *//* 0x0002 */ int aim_im_setparams(OscarData *od, struct aim_icbmparameters *params);/* 0x0004 */ int aim_im_reqparams(OscarData *od);/* 0x0006 */ int aim_im_sendch1_ext(OscarData *od, struct aim_sendimext_args *args);/* 0x0006 */ int aim_im_sendch1(OscarData *, const char *destsn, guint16 flags, const char *msg);/* 0x0006 */ int aim_im_sendch2_chatinvite(OscarData *od, const char *sn, const char *msg, guint16 exchange, const char *roomname, guint16 instance);/* 0x0006 */ int aim_im_sendch2_icon(OscarData *od, const char *sn, const guint8 *icon, int iconlen, time_t stamp, guint16 iconsum);/* 0x0006 */ int aim_im_sendch2_rtfmsg(OscarData *od, struct aim_sendrtfmsg_args *args);/* 0x0006 */ void aim_im_sendch2_cancel(PeerConnection *peer_conn);/* 0x0006 */ void aim_im_sendch2_connected(PeerConnection *peer_conn);/* 0x0006 */ void aim_im_sendch2_odc_requestdirect(OscarData *od, guchar *cookie, const char *sn, const guint8 *ip, guint16 port, guint16 requestnumber);/* 0x0006 */ void aim_im_sendch2_odc_requestproxy(OscarData *od, guchar *cookie, const char *sn, const guint8 *ip, guint16 pin, guint16 requestnumber);/* 0x0006 */ void aim_im_sendch2_sendfile_requestdirect(OscarData *od, guchar *cookie, const char *sn, const guint8 *ip, guint16 port, guint16 requestnumber, const gchar *filename, guint32 size, guint16 numfiles);/* 0x0006 */ void aim_im_sendch2_sendfile_requestproxy(OscarData *od, guchar *cookie, const char *sn, const guint8 *ip, guint16 pin, guint16 requestnumber, const gchar *filename, guint32 size, guint16 numfiles);/* 0x0006 */ int aim_im_sendch2_geticqaway(OscarData *od, const char *sn, int type);/* 0x0006 */ int aim_im_sendch4(OscarData *od, const char *sn, guint16 type, const char *message);/* 0x0008 */ int aim_im_warn(OscarData *od, FlapConnection *conn, const char *destsn, guint32 flags);/* 0x000b */ int aim_im_denytransfer(OscarData *od, const char *sn, const guchar *cookie, guint16 code);/* 0x0014 */ int aim_im_sendmtn(OscarData *od, guint16 type1, const char *sn, guint16 type2);void aim_icbm_makecookie(guchar* cookie);gchar *oscar_encoding_extract(const char *encoding);gchar *oscar_encoding_to_utf8(PurpleAccount *account, const char *encoding, const char *text, int textlen);gchar *purple_plugin_oscar_decode_im_part(PurpleAccount *account, const char *sourcesn, guint16 charset, guint16 charsubset, const gchar *data, gsize datalen);/* 0x0002 - family_locate.c *//* * AIM User Info, Standard Form. */#define AIM_FLAG_UNCONFIRMED     0x0001 /* "damned transients" */#define AIM_FLAG_ADMINISTRATOR   0x0002#define AIM_FLAG_AOL             0x0004#define AIM_FLAG_OSCAR_PAY       0x0008#define AIM_FLAG_FREE            0x0010#define AIM_FLAG_AWAY            0x0020#define AIM_FLAG_ICQ             0x0040#define AIM_FLAG_WIRELESS        0x0080#define AIM_FLAG_UNKNOWN100      0x0100#define AIM_FLAG_UNKNOWN200      0x0200#define AIM_FLAG_ACTIVEBUDDY     0x0400#define AIM_FLAG_UNKNOWN800      0x0800#define AIM_FLAG_ABINTERNAL      0x1000#define AIM_FLAG_ALLUSERS        0x001f#define AIM_USERINFO_PRESENT_FLAGS        0x00000001#define AIM_USERINFO_PRESENT_MEMBERSINCE  0x00000002#define AIM_USERINFO_PRESENT_ONLINESINCE  0x00000004#define AIM_USERINFO_PRESENT_IDLE         0x00000008#define AIM_USERINFO_PRESENT_ICQEXTSTATUS 0x00000010#define AIM_USERINFO_PRESENT_ICQIPADDR    0x00000020#define AIM_USERINFO_PRESENT_ICQDATA      0x00000040#define AIM_USERINFO_PRESENT_CAPABILITIES 0x00000080#define AIM_USERINFO_PRESENT_SESSIONLEN   0x00000100#define AIM_USERINFO_PRESENT_CREATETIME   0x00000200struct userinfo_node{	char *sn;	struct userinfo_node *next;};typedef struct aim_userinfo_s{	char *sn;	guint16 warnlevel; /* evil percent * 10 (999 = 99.9%) */	guint16 idletime; /* in seconds */	guint16 flags;	guint32 createtime; /* time_t */	guint32 membersince; /* time_t */	guint32 onlinesince; /* time_t */	guint32 sessionlen;  /* in seconds */	guint32 capabilities;	struct {		guint32 status;		guint32 ipaddr;		guint8 crap[0x25]; /* until we figure it out... */	} icqinfo;	guint32 present;	guint8 iconcsumtype;	guint16 iconcsumlen;	guint8 *iconcsum;	char *info;	char *info_encoding;	guint16 info_len;	char *status;	char *status_encoding;	guint16 status_len;	char *itmsurl;	char *itmsurl_encoding;	guint16 itmsurl_len;	char *away;	char *away_encoding;	guint16 away_len;	struct aim_userinfo_s *next;} aim_userinfo_t;#define AIM_SENDMEMBLOCK_FLAG_ISREQUEST  0#define AIM_SENDMEMBLOCK_FLAG_ISHASH     1int aim_sendmemblock(OscarData *od, FlapConnection *conn, guint32 offset, guint32 len, const guint8 *buf, guint8 flag);struct aim_invite_priv{	char *sn;	char *roomname;	guint16 exchange;	guint16 instance;};#define AIM_COOKIETYPE_UNKNOWN  0x00#define AIM_COOKIETYPE_ICBM     0x01#define AIM_COOKIETYPE_ADS      0x02#define AIM_COOKIETYPE_BOS      0x03#define AIM_COOKIETYPE_IM       0x04#define AIM_COOKIETYPE_CHAT     0x05#define AIM_COOKIETYPE_CHATNAV  0x06#define AIM_COOKIETYPE_INVITE   0x07/* we'll move OFT up a bit to give breathing room.  not like it really * matters. */#define AIM_COOKIETYPE_OFTIM    0x10#define AIM_COOKIETYPE_OFTGET   0x11#define AIM_COOKIETYPE_OFTSEND  0x12#define AIM_COOKIETYPE_OFTVOICE 0x13#define AIM_COOKIETYPE_OFTIMAGE 0x14#define AIM_COOKIETYPE_OFTICON  0x15aim_userinfo_t *aim_locate_finduserinfo(OscarData *od, const char *sn);void aim_locate_dorequest(OscarData *od);/* 0x0002 */ int aim_locate_reqrights(OscarData *od);/* 0x0004 */ int aim_locate_setcaps(OscarData *od, guint32 caps);/* 0x0004 */ int aim_locate_setprofile(OscarData *od, const char *profile_encoding, const gchar *profile, const int profile_len, const char *awaymsg_encoding, const gchar *awaymsg, const int awaymsg_len);/* 0x0005 */ int aim_locate_getinfo(OscarData *od, const char *, guint16);/* 0x0009 */ int aim_locate_setdirinfo(OscarData *od, 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, guint16 privacy);/* 0x000b */ int aim_locate_000b(OscarData *od, const char *sn);/* 0x000f */ int aim_locate_setinterests(OscarData *od, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, guint16 privacy);/* 0x0015 */ int aim_locate_getinfoshort(OscarData *od, const char *sn, guint32 flags);void aim_locate_requestuserinfo(OscarData *od, const char *sn);guint32 aim_locate_getcaps(OscarData *od, ByteStream *bs, int len);guint32 aim_locate_getcaps_short(OscarData *od, ByteStream *bs, int len);void aim_info_free(aim_userinfo_t *);int aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *);int aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info);/* 0x0003 - family_buddy.c *//* 0x0002 */ void aim_buddylist_reqrights(OscarData *, FlapConnection *);/* 0x0004 */ int aim_buddylist_set(OscarData *, FlapConnection *, const char *);/* 0x0004 */ int aim_buddylist_addbuddy(OscarData *, FlapConnection *, const char *);/* 0x0005 */ int aim_buddylist_removebuddy(OscarData *, FlapConnection *, const char *);/* 0x000a - family_userlookup.c */int aim_search_address(OscarData *, const char *);/* 0x000d - family_chatnav.c *//* 0x000e - family_chat.c *//* These apply to exchanges as well. */#define AIM_CHATROOM_FLAG_EVILABLE 0x0001#define AIM_CHATROOM_FLAG_NAV_ONLY 0x0002#define AIM_CHATROOM_FLAG_INSTANCING_ALLOWED 0x0004#define AIM_CHATROOM_FLAG_OCCUPANT_PEEK_ALLOWED 0x0008struct aim_chat_exchangeinfo{	guint16 number;	guint16 flags;	char *name;	char *charset1;	char *lang1;	char *charset2;	char *lang2;};#define AIM_CHATFLAGS_NOREFLECT 0x0001#define AIM_CHATFLAGS_AWAY      0x0002int aim_chat_send_im(OscarData *od, FlapConnection *conn, guint16 flags, const gchar *msg, int msglen, const char *encoding, const char *language);int aim_chat_join(OscarData *od, guint16 exchange, const char *roomname, guint16 instance);int aim_chat_attachname(FlapConnection *conn, guint16 exchange, const char *roomname, guint16 instance);char *aim_chat_getname(FlapConnection *conn);FlapConnection *aim_chat_getconn(OscarData *, const char *name);void aim_chatnav_reqrights(OscarData *od, FlapConnection *conn);int aim_chatnav_createroom(OscarData *od, FlapConnection *conn, const char *name, guint16 exchange);int aim_chat_leaveroom(OscarData *od, const char *name);/* 0x000f - family_odir.c */struct aim_odir{	char *first;	char *last;	char *middle;	char *maiden;	char *email;	char *country;	char *state;	char *city;	char *sn;	char *interest;	char *nick;	char *zip;	char *region;	char *address;	struct aim_odir *next;};int aim_odir_email(OscarData *, const char *, const char *);int aim_odir_name(OscarData *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *);int aim_odir_interest(OscarData *, const char *, const char *);/* 0x0010 - family_bart.c */int aim_bart_upload(OscarData *od, const guint8 *icon, guint16 iconlen);int aim_bart_request(OscarData *od, const char *sn, guint8 iconcsumtype, const guint8 *iconstr, guint16 iconstrlen);/* 0x0013 - family_feedbag.c */#define AIM_SSI_TYPE_BUDDY		0x0000#define AIM_SSI_TYPE_GROUP		0x0001#define AIM_SSI_TYPE_PERMIT		0x0002#define AIM_SSI_TYPE_DENY		0x0003#define AIM_SSI_TYPE_PDINFO		0x0004#define AIM_SSI_TYPE_PRESENCEPREFS	0x0005#define AIM_SSI_TYPE_ICONINFO		0x0014#define AIM_SSI_ACK_SUCCESS		0x0000#define AIM_SSI_ACK_ITEMNOTFOUND	0x0002#define AIM_SSI_ACK_IDNUMINUSE		0x000a#define AIM_SSI_ACK_ATMAX		0x000c#define AIM_SSI_ACK_INVALIDNAME		0x000d#define AIM_SSI_ACK_AUTHREQUIRED	0x000e/* These flags are set in the 0x00c9 TLV of SSI teyp 0x0005 */#define AIM_SSI_PRESENCE_FLAG_SHOWIDLE        0x00000400#define AIM_SSI_PRESENCE_FLAG_NORECENTBUDDIES 0x00020000struct aim_ssi_item{	char *name;	guint16 gid;	guint16 bid;	guint16 type;	GSList *data;	struct aim_ssi_item *next;};struct aim_ssi_tmp{	guint16 action;	guint16 ack;	char *name;	struct aim_ssi_item *item;	struct aim_ssi_tmp *next;};/* These build the actual SNACs and queue them to be sent *//* 0x0002 */ int aim_ssi_reqrights(OscarData *od);/* 0x0004 */ int aim_ssi_reqdata(OscarData *od);/* 0x0005 */ int aim_ssi_reqifchanged(OscarData *od, time_t localstamp, guint16 localrev);/* 0x0007 */ int aim_ssi_enable(OscarData *od);/* 0x0011 */ int aim_ssi_modbegin(OscarData *od);/* 0x0012 */ int aim_ssi_modend(OscarData *od);/* 0x0014 */ int aim_ssi_sendauth(OscarData *od, char *sn, char *msg);/* 0x0018 */ int aim_ssi_sendauthrequest(OscarData *od, char *sn, const char *msg);/* 0x001a */ int aim_ssi_sendauthreply(OscarData *od, char *sn, guint8 reply, const char *msg);/* Client functions for retrieving SSI data */struct aim_ssi_item *aim_ssi_itemlist_find(struct aim_ssi_item *list, guint16 gid, guint16 bid);struct aim_ssi_item *aim_ssi_itemlist_finditem(struct aim_ssi_item *list, const char *gn, const char *sn, guint16 type);struct aim_ssi_item *aim_ssi_itemlist_exists(struct aim_ssi_item *list, const char *sn);char *aim_ssi_itemlist_findparentname(struct aim_ssi_item *list, const char *sn);int aim_ssi_getpermdeny(struct aim_ssi_item *list);guint32 aim_ssi_getpresence(struct aim_ssi_item *list);char *aim_ssi_getalias(struct aim_ssi_item *list, const char *gn, const char *sn);char *aim_ssi_getcomment(struct aim_ssi_item *list, const char *gn, const char *sn);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -