comparison libpurple/protocols/yahoo/yahoo_packet.h @ 15373:5fe8042783c1

Rename gtk/ and libgaim/ to pidgin/ and libpurple/
author Sean Egan <seanegan@gmail.com>
date Sat, 20 Jan 2007 02:32:10 +0000
parents
children 32c366eeeb99
comparison
equal deleted inserted replaced
15372:f79e0f4df793 15373:5fe8042783c1
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,
68 YAHOO_SERVICE_PEERTOPEER = 0x4F,
69 YAHOO_SERVICE_WEBCAM,
70 YAHOO_SERVICE_AUTHRESP = 0x54,
71 YAHOO_SERVICE_LIST = 0x55,
72 YAHOO_SERVICE_AUTH = 0x57,
73 YAHOO_SERVICE_AUTHBUDDY = 0x6d,
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,
89 YAHOO_SERVICE_PRESENCE_PERM = 0xb9,
90 YAHOO_SERVICE_PRESENCE_SESSION = 0xba,
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,
101 YAHOO_SERVICE_STATUS_15 = 0xf0,
102 YAHOO_SERVICE_LIST_15 = 0Xf1,
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
120 #define YAHOO_PROTO_VER 0x000c
121 #define YAHOO_PROTO_VER_JAPAN 0x000c
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);
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);
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);
132 size_t yahoo_packet_build(struct yahoo_packet *pkt, int pad, gboolean wm, gboolean jp,
133 guchar **buf);
134 void yahoo_packet_read(struct yahoo_packet *pkt, const guchar *data, int len);
135 void yahoo_packet_write(struct yahoo_packet *pkt, guchar *data);
136 void yahoo_packet_dump(guchar *data, int len);
137 size_t yahoo_packet_length(struct yahoo_packet *pkt);
138 void yahoo_packet_free(struct yahoo_packet *pkt);
139
140 #endif /* _YAHOO_PACKET_H_ */