Wed, 12 Nov 2008 05:14:03 +0000
merge of '77693555855fe9cd3215414f79964dba346cc5fa'
and '19a87e98e5857ad0289f2c760d460f7f1dbbb42d'
| 10392 | 1 | /** |
| 2 | * @file yahoo_packet.h The Yahoo! protocol plugin | |
| 3 | * | |
| 4 | * gaim | |
| 5 | * | |
| 6 | * Gaim is the legal property of its developers, whose names are too numerous | |
| 7 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 8 | * source distribution. | |
| 9 | * | |
| 10 | * This program is free software; you can redistribute it and/or modify | |
| 11 | * it under the terms of the GNU General Public License as published by | |
| 12 | * the Free Software Foundation; either version 2 of the License, or | |
| 13 | * (at your option) any later version. | |
| 14 | * | |
| 15 | * This program is distributed in the hope that it will be useful, | |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | * GNU General Public License for more details. | |
| 19 | * | |
| 20 | * You should have received a copy of the GNU General Public License | |
| 21 | * along with this program; if not, write to the Free Software | |
| 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 23 | */ | |
| 24 | ||
| 25 | #ifndef _YAHOO_PACKET_H_ | |
| 26 | #define _YAHOO_PACKET_H_ | |
| 27 | ||
| 28 | enum yahoo_service { /* these are easier to see in hex */ | |
| 29 | YAHOO_SERVICE_LOGON = 1, | |
| 30 | YAHOO_SERVICE_LOGOFF, | |
| 31 | YAHOO_SERVICE_ISAWAY, | |
| 32 | YAHOO_SERVICE_ISBACK, | |
| 33 | YAHOO_SERVICE_IDLE, /* 5 (placemarker) */ | |
| 34 | YAHOO_SERVICE_MESSAGE, | |
| 35 | YAHOO_SERVICE_IDACT, | |
| 36 | YAHOO_SERVICE_IDDEACT, | |
| 37 | YAHOO_SERVICE_MAILSTAT, | |
| 38 | YAHOO_SERVICE_USERSTAT, /* 0xa */ | |
| 39 | YAHOO_SERVICE_NEWMAIL, | |
| 40 | YAHOO_SERVICE_CHATINVITE, | |
| 41 | YAHOO_SERVICE_CALENDAR, | |
| 42 | YAHOO_SERVICE_NEWPERSONALMAIL, | |
| 43 | YAHOO_SERVICE_NEWCONTACT, | |
| 44 | YAHOO_SERVICE_ADDIDENT, /* 0x10 */ | |
| 45 | YAHOO_SERVICE_ADDIGNORE, | |
| 46 | YAHOO_SERVICE_PING, | |
| 47 | YAHOO_SERVICE_GOTGROUPRENAME, | |
| 48 | YAHOO_SERVICE_SYSMESSAGE = 0x14, | |
| 49 | YAHOO_SERVICE_SKINNAME = 0x15, | |
| 50 | YAHOO_SERVICE_PASSTHROUGH2 = 0x16, | |
| 51 | YAHOO_SERVICE_CONFINVITE = 0x18, | |
| 52 | YAHOO_SERVICE_CONFLOGON, | |
| 53 | YAHOO_SERVICE_CONFDECLINE, | |
| 54 | YAHOO_SERVICE_CONFLOGOFF, | |
| 55 | YAHOO_SERVICE_CONFADDINVITE, | |
| 56 | YAHOO_SERVICE_CONFMSG, | |
| 57 | YAHOO_SERVICE_CHATLOGON, | |
| 58 | YAHOO_SERVICE_CHATLOGOFF, | |
| 59 | YAHOO_SERVICE_CHATMSG = 0x20, | |
| 60 | YAHOO_SERVICE_GAMELOGON = 0x28, | |
| 61 | YAHOO_SERVICE_GAMELOGOFF, | |
| 62 | YAHOO_SERVICE_GAMEMSG = 0x2a, | |
| 63 | YAHOO_SERVICE_FILETRANSFER = 0x46, | |
| 64 | YAHOO_SERVICE_VOICECHAT = 0x4A, | |
| 65 | YAHOO_SERVICE_NOTIFY = 0x4B, | |
| 66 | YAHOO_SERVICE_VERIFY, | |
| 67 | YAHOO_SERVICE_P2PFILEXFER, | |
|
11180
4098d74c03c2
[gaim-migrate @ 13291]
Daniel Atallah <datallah@pidgin.im>
parents:
10989
diff
changeset
|
68 | YAHOO_SERVICE_PEERTOPEER = 0x4F, |
| 10392 | 69 | YAHOO_SERVICE_WEBCAM, |
| 70 | YAHOO_SERVICE_AUTHRESP = 0x54, | |
| 71 | YAHOO_SERVICE_LIST = 0x55, | |
| 72 | YAHOO_SERVICE_AUTH = 0x57, | |
| 14927 | 73 | YAHOO_SERVICE_AUTHBUDDY = 0x6d, |
| 10392 | 74 | YAHOO_SERVICE_ADDBUDDY = 0x83, |
| 75 | YAHOO_SERVICE_REMBUDDY = 0x84, | |
| 76 | YAHOO_SERVICE_IGNORECONTACT, /* > 1, 7, 13 < 1, 66, 13, 0*/ | |
| 77 | YAHOO_SERVICE_REJECTCONTACT, | |
| 78 | YAHOO_SERVICE_GROUPRENAME = 0x89, /* > 1, 65(new), 66(0), 67(old) */ | |
| 79 | /* YAHOO_SERVICE_??? = 0x8A, */ | |
| 80 | YAHOO_SERVICE_CHATONLINE = 0x96, /* > 109(id), 1, 6(abcde) < 0,1*/ | |
| 81 | YAHOO_SERVICE_CHATGOTO, | |
| 82 | YAHOO_SERVICE_CHATJOIN, /* > 1 104-room 129-1600326591 62-2 */ | |
| 83 | YAHOO_SERVICE_CHATLEAVE, | |
| 84 | YAHOO_SERVICE_CHATEXIT = 0x9b, | |
| 85 | YAHOO_SERVICE_CHATADDINVITE = 0x9d, | |
| 86 | YAHOO_SERVICE_CHATLOGOUT = 0xa0, | |
| 87 | YAHOO_SERVICE_CHATPING, | |
| 88 | YAHOO_SERVICE_COMMENT = 0xa8, | |
|
12010
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
89 | YAHOO_SERVICE_PRESENCE_PERM = 0xb9, |
|
aa2f3b07ec09
[gaim-migrate @ 14303]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11644
diff
changeset
|
90 | YAHOO_SERVICE_PRESENCE_SESSION = 0xba, |
| 10392 | 91 | YAHOO_SERVICE_AVATAR = 0xbc, |
| 92 | YAHOO_SERVICE_PICTURE_CHECKSUM = 0xbd, | |
| 93 | YAHOO_SERVICE_PICTURE = 0xbe, | |
| 94 | YAHOO_SERVICE_PICTURE_UPDATE = 0xc1, | |
| 95 | YAHOO_SERVICE_PICTURE_UPLOAD = 0xc2, | |
| 96 | YAHOO_SERVICE_Y6_VISIBLE_TOGGLE = 0xc5, | |
| 97 | YAHOO_SERVICE_Y6_STATUS_UPDATE = 0xc6, | |
| 98 | YAHOO_SERVICE_AVATAR_UPDATE = 0xc7, | |
| 99 | YAHOO_SERVICE_VERIFY_ID_EXISTS = 0xc8, | |
| 100 | YAHOO_SERVICE_AUDIBLE = 0xd0, | |
| 14317 | 101 | YAHOO_SERVICE_STATUS_15 = 0xf0, |
| 14320 | 102 | YAHOO_SERVICE_LIST_15 = 0Xf1, |
| 10392 | 103 | YAHOO_SERVICE_WEBLOGIN = 0x0226, |
| 104 | YAHOO_SERVICE_SMS_MSG = 0x02ea | |
| 105 | }; | |
| 106 | ||
| 107 | struct yahoo_pair { | |
| 108 | int key; | |
| 109 | char *value; | |
| 110 | }; | |
| 111 | ||
| 112 | struct yahoo_packet { | |
| 113 | guint16 service; | |
| 114 | guint32 status; | |
| 115 | guint32 id; | |
| 116 | GSList *hash; | |
| 117 | }; | |
| 118 | ||
| 119 | #define YAHOO_WEBMESSENGER_PROTO_VER 0x0065 | |
| 14927 | 120 | #define YAHOO_PROTO_VER 0x000c |
|
14508
02d80a119d80
[gaim-migrate @ 17160]
Evan Schoenberg <evands@pidgin.im>
parents:
14320
diff
changeset
|
121 | #define YAHOO_PROTO_VER_JAPAN 0x000c |
| 10392 | 122 | |
| 123 | #define YAHOO_PACKET_HDRLEN (4 + 2 + 2 + 2 + 2 + 4 + 4) | |
| 124 | ||
| 125 | struct yahoo_packet *yahoo_packet_new(enum yahoo_service service, | |
| 126 | enum yahoo_status status, int id); | |
| 10394 | 127 | void yahoo_packet_hash(struct yahoo_packet *pkt, const char *fmt, ...); |
| 128 | void yahoo_packet_hash_str(struct yahoo_packet *pkt, int key, const char *value); | |
| 129 | void yahoo_packet_hash_int(struct yahoo_packet *pkt, int key, int value); | |
| 10392 | 130 | int yahoo_packet_send(struct yahoo_packet *pkt, struct yahoo_data *yd); |
| 131 | int yahoo_packet_send_and_free(struct yahoo_packet *pkt, struct yahoo_data *yd); | |
|
14508
02d80a119d80
[gaim-migrate @ 17160]
Evan Schoenberg <evands@pidgin.im>
parents:
14320
diff
changeset
|
132 | size_t yahoo_packet_build(struct yahoo_packet *pkt, int pad, gboolean wm, gboolean jp, |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
12010
diff
changeset
|
133 | guchar **buf); |
|
14096
55cd8614d564
[gaim-migrate @ 16636]
Mark Doliner <markdoliner@pidgin.im>
parents:
13277
diff
changeset
|
134 | void yahoo_packet_read(struct yahoo_packet *pkt, const guchar *data, int len); |
| 10392 | 135 | void yahoo_packet_write(struct yahoo_packet *pkt, guchar *data); |
| 136 | void yahoo_packet_dump(guchar *data, int len); | |
|
13277
c8a85dd74704
[gaim-migrate @ 15642]
Richard Laager <rlaager@pidgin.im>
parents:
13276
diff
changeset
|
137 | size_t yahoo_packet_length(struct yahoo_packet *pkt); |
| 10392 | 138 | void yahoo_packet_free(struct yahoo_packet *pkt); |
| 139 | ||
| 140 | #endif /* _YAHOO_PACKET_H_ */ |