annotate libfaim/aim_rxhandlers.c @ 1362:3cea00ca7a34

[gaim-migrate @ 1372] yay. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 22 Dec 2000 10:48:19 +0000
parents 4c5c2fcb83cd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
1 /*
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
2 * aim_rxhandlers.c
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
3 *
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
4 * This file contains most all of the incoming packet handlers, along
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
5 * with aim_rxdispatch(), the Rx dispatcher. Queue/list management is
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
6 * actually done in aim_rxqueue.c.
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
7 *
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
8 */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
9
283
0f14e6d8a51b [gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 279
diff changeset
10 #include <faim/aim.h>
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 /*
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
13 * Bleck functions get called when there's no non-bleck functions
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
14 * around to cleanup the mess...
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 */
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
16 faim_internal int bleck(struct aim_session_t *sess,struct command_rx_struct *workingPtr, ...)
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
17 {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
18 u_short family;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
19 u_short subtype;
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
21 u_short maxf;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
22 u_short maxs;
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
23
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
24 /* XXX: this is ugly. and big just for debugging. */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
25 char *literals[14][25] = {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
26 {"Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
27 NULL
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
28 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
29 {"General",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
30 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
31 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
32 "Client Ready",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
33 "Server Ready",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
34 "Service Request",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
35 "Redirect",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
36 "Rate Information Request",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
37 "Rate Information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
38 "Rate Information Ack",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
39 NULL,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
40 "Rate Information Change",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
41 "Server Pause",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
42 NULL,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
43 "Server Resume",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
44 "Request Personal User Information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
45 "Personal User Information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
46 "Evil Notification",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
47 NULL,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
48 "Migration notice",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
49 "Message of the Day",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
50 "Set Privacy Flags",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
51 "Well Known URL",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
52 "NOP"
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
53 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
54 {"Location",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
55 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
56 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
57 "Request Rights",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
58 "Rights Information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
59 "Set user information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
60 "Request User Information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
61 "User Information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
62 "Watcher Sub Request",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
63 "Watcher Notification"
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
64 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
65 {"Buddy List Management",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
66 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
67 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
68 "Request Rights",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
69 "Rights Information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
70 "Add Buddy",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
71 "Remove Buddy",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
72 "Watcher List Query",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
73 "Watcher List Response",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
74 "Watcher SubRequest",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
75 "Watcher Notification",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
76 "Reject Notification",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
77 "Oncoming Buddy",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
78 "Offgoing Buddy"
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
79 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
80 {"Messeging",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
81 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
82 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
83 "Add ICBM Parameter",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
84 "Remove ICBM Parameter",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
85 "Request Parameter Information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
86 "Parameter Information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
87 "Outgoing Message",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
88 "Incoming Message",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
89 "Evil Request",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
90 "Evil Reply",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
91 "Missed Calls",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
92 "Message Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
93 "Host Ack"
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
94 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
95 {"Advertisements",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
96 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
97 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
98 "Request Ad",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
99 "Ad Data (GIFs)"
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
100 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
101 {"Invitation / Client-to-Client",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
102 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
103 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
104 "Invite a Friend",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
105 "Invitation Ack"
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
106 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
107 {"Administrative",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
108 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
109 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
110 "Information Request",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
111 "Information Reply",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
112 "Information Change Request",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
113 "Information Chat Reply",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
114 "Account Confirm Request",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
115 "Account Confirm Reply",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
116 "Account Delete Request",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
117 "Account Delete Reply"
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
118 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
119 {"Popups",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
120 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
121 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
122 "Display Popup"
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
123 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
124 {"BOS",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
125 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
126 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
127 "Request Rights",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
128 "Rights Response",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
129 "Set group permission mask",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
130 "Add permission list entries",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
131 "Delete permission list entries",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
132 "Add deny list entries",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
133 "Delete deny list entries",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
134 "Server Error"
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
135 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
136 {"User Lookup",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
137 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
138 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
139 "Search Request",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
140 "Search Response"
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
141 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
142 {"Stats",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
143 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
144 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
145 "Set minimum report interval",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
146 "Report Events"
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
147 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
148 {"Translate",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
149 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
150 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
151 "Translate Request",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
152 "Translate Reply",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
153 },
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
154 {"Chat Navigation",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
155 "Invalid",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
156 "Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
157 "Request rights",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
158 "Request Exchange Information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
159 "Request Room Information",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
160 "Request Occupant List",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
161 "Search for Room",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
162 "Outgoing Message",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
163 "Incoming Message",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
164 "Evil Request",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
165 "Evil Reply",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
166 "Chat Error",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
167 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
168 };
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
169
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
170 maxf = sizeof(literals) / sizeof(literals[0]);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
171 maxs = sizeof(literals[0]) / sizeof(literals[0][0]);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
172
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
173 family = aimutil_get16(workingPtr->data+0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
174 subtype= aimutil_get16(workingPtr->data+2);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
175
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
176 if((family < maxf) && (subtype+1 < maxs) && (literals[family][subtype] != NULL))
446
6d78b988b479 [gaim-migrate @ 456]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 445
diff changeset
177 printf("bleck: null handler for %04x/%04x (%s)\n", family, subtype, literals[family][subtype+1]);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
178 else
446
6d78b988b479 [gaim-migrate @ 456]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 445
diff changeset
179 printf("bleck: null handler for %04x/%04x (no literal)\n",family,subtype);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
180
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
181 return 1;
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
182 }
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
183
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
184 faim_export int aim_conn_addhandler(struct aim_session_t *sess,
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
185 struct aim_conn_t *conn,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
186 u_short family,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
187 u_short type,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
188 rxcallback_t newhandler,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
189 u_short flags)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
190 {
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
191 struct aim_rxcblist_t *newcb;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
192
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
193 if (!conn)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
194 return -1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
195
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
196 faimdprintf(1, "aim_conn_addhandler: adding for %04x/%04x\n", family, type);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
197
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
198 if (!(newcb = (struct aim_rxcblist_t *)calloc(1, sizeof(struct aim_rxcblist_t))))
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
199 return -1;
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 840
diff changeset
200 newcb->family = family;
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 840
diff changeset
201 newcb->type = type;
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 840
diff changeset
202 newcb->flags = flags;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
203 if (!newhandler)
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 840
diff changeset
204 newcb->handler = &bleck;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
205 else
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 840
diff changeset
206 newcb->handler = newhandler;
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 840
diff changeset
207 newcb->next = NULL;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
208
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
209 if (!conn->handlerlist)
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 840
diff changeset
210 conn->handlerlist = newcb;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
211 else {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
212 struct aim_rxcblist_t *cur;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
213
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
214 cur = conn->handlerlist;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
215
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
216 while (cur->next)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
217 cur = cur->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
218 cur->next = newcb;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
219 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
220
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
221 return 0;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
222 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
223
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
224 faim_export int aim_clearhandlers(struct aim_conn_t *conn)
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
225 {
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
226 struct aim_rxcblist_t *cur;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
227
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
228 if (!conn)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
229 return -1;
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
230
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1081
diff changeset
231 for (cur = conn->handlerlist; cur; ) {
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
232 struct aim_rxcblist_t *tmp;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
233
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
234 tmp = cur->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
235 free(cur);
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
236 cur = tmp;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
237 }
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1081
diff changeset
238 conn->handlerlist = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
239
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
240 return 0;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
241 }
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
242
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
243 faim_internal rxcallback_t aim_callhandler(struct aim_conn_t *conn,
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
244 u_short family,
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
245 u_short type)
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
246 {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
247 struct aim_rxcblist_t *cur;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
248
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
249 if (!conn)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
250 return NULL;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
251
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
252 faimdprintf(1, "aim_callhandler: calling for %04x/%04x\n", family, type);
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
253
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
254 cur = conn->handlerlist;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
255 while(cur)
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
256 {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
257 if ( (cur->family == family) && (cur->type == type) )
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
258 return cur->handler;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
259 cur = cur->next;
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
260 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
261
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
262 if (type==0xffff)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
263 return NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
264
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
265 return aim_callhandler(conn, family, 0xffff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
266 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
267
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
268 faim_internal int aim_callhandler_noparam(struct aim_session_t *sess,
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
269 struct aim_conn_t *conn,
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
270 u_short family,
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
271 u_short type,
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
272 struct command_rx_struct *ptr)
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
273 {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
274 rxcallback_t userfunc = NULL;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
275 userfunc = aim_callhandler(conn, family, type);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
276 if (userfunc)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
277 return userfunc(sess, ptr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
278 return 1; /* XXX */
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
279 }
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
280
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
281 /*
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
282 aim_rxdispatch()
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
283
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
284 Basically, heres what this should do:
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
285 1) Determine correct packet handler for this packet
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
286 2) Mark the packet handled (so it can be dequeued in purge_queue())
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
287 3) Send the packet to the packet handler
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
288 4) Go to next packet in the queue and start over
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
289 5) When done, run purge_queue() to purge handled commands
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
290
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
291 Note that any unhandlable packets should probably be left in the
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
292 queue. This is the best way to prevent data loss. This means
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
293 that a single packet may get looked at by this function multiple
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
294 times. This is more good than bad! This behavior may change.
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
295
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
296 Aren't queue's fun?
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
297
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
298 TODO: Get rid of all the ugly if's.
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
299 TODO: Clean up.
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
300 TODO: More support for mid-level handlers.
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
301 TODO: Allow for NULL handlers.
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
302
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
303 */
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
304 faim_export int aim_rxdispatch(struct aim_session_t *sess)
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
305 {
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
306 int i = 0;
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
307 struct command_rx_struct *workingPtr = NULL;
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
308
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
309 if (sess->queue_incoming == NULL) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
310 faimdprintf(1, "parse_generic: incoming packet queue empty.\n");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
311 return 0;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
312 } else {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
313 workingPtr = sess->queue_incoming;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
314 for (i = 0; workingPtr != NULL; workingPtr = workingPtr->next, i++) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
315 /*
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
316 * XXX: This is still fairly ugly.
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
317 */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
318 if (workingPtr->handled)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
319 continue;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
320
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
321 /*
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
322 * This is a debugging/sanity check only and probably could/should be removed
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
323 * for stable code.
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
324 */
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
325 if (((workingPtr->hdrtype == AIM_FRAMETYPE_OFT) &&
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
326 (workingPtr->conn->type != AIM_CONN_TYPE_RENDEZVOUS)) ||
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
327 ((workingPtr->hdrtype == AIM_FRAMETYPE_OSCAR) &&
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
328 (workingPtr->conn->type == AIM_CONN_TYPE_RENDEZVOUS))) {
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
329 printf("faim: rxhandlers: incompatible frame type %d on connection type 0x%04x\n", workingPtr->hdrtype, workingPtr->conn->type);
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
330 workingPtr->handled = 1;
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
331 continue;
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
332 }
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
333
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
334 switch(workingPtr->conn->type) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
335 case -1:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
336 /*
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
337 * This can happen if we have a queued command
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
338 * that was recieved after a connection has
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
339 * been terminated. In which case, the handler
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
340 * list has been cleared, and there's nothing we
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
341 * can do for it. We can only cancel it.
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
342 */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
343 workingPtr->handled = 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
344 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
345 case AIM_CONN_TYPE_AUTH: {
1081
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
346 unsigned long head;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
347
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
348 head = aimutil_get32(workingPtr->data);
1081
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
349 if ((head == 0x00000001) && (workingPtr->commandlen == 4)) {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
350 faimdprintf(1, "got connection ack on auth line\n");
1081
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
351 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, workingPtr);
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
352 } else if (workingPtr->hdr.oscar.type == 0x04) {
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
353 /* Used only by the older login protocol */
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
354 workingPtr->handled = aim_authparse(sess, workingPtr);
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
355 } else {
1081
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
356 unsigned short family,subtype;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
357
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
358 family = aimutil_get16(workingPtr->data);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
359 subtype = aimutil_get16(workingPtr->data+2);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
360
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
361 switch (family) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
362 /* New login protocol */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
363 case 0x0017:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
364 if (subtype == 0x0001)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
365 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0x0001, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
366 else if (subtype == 0x0003)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
367 workingPtr->handled = aim_authparse(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
368 else if (subtype == 0x0007)
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 715
diff changeset
369 workingPtr->handled = aim_authkeyparse(sess, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
370 else
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
371 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0xffff, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
372 break;
1258
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
373 case 0x0001:
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
374 if (subtype == 0x0003)
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
375 workingPtr->handled = aim_parse_hostonline(sess, workingPtr);
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
376 else
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
377 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0xffff, workingPtr);
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
378 break;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
379 case 0x0007:
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
380 if (subtype == 0x0005)
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
381 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_ADM, AIM_CB_ADM_INFOCHANGE_REPLY, workingPtr);
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
382 break;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
383 case AIM_CB_FAM_SPECIAL:
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
384 if (subtype == AIM_CB_SPECIAL_DEBUGCONN_CONNECT) {
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
385 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
386 break;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
387 } else
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
388 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0xffff, workingPtr);
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
389 break;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
390 default:
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
391 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
392 }
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
393 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
394 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
395 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
396 case AIM_CONN_TYPE_BOS: {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
397 u_short family;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
398 u_short subtype;
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
399
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
400 if (workingPtr->hdr.oscar.type == 0x04) {
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
401 workingPtr->handled = aim_negchan_middle(sess, workingPtr);
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
402 break;
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
403 }
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
404
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
405 family = aimutil_get16(workingPtr->data);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
406 subtype = aimutil_get16(workingPtr->data+2);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
407
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
408 switch (family) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
409 case 0x0000: /* not really a family, but it works */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
410 if (subtype == 0x0001)
1081
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
411 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
412 else
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
413 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_UNKNOWN, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
414 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
415 case 0x0001: /* Family: General */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
416 switch (subtype) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
417 case 0x0001:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
418 workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
419 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
420 case 0x0003:
1258
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
421 workingPtr->handled = aim_parse_hostonline(sess, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
422 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
423 case 0x0005:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
424 workingPtr->handled = aim_handleredirect_middle(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
425 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
426 case 0x0007:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
427 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x0007, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
428 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
429 case 0x000a:
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
430 workingPtr->handled = aim_parse_ratechange_middle(sess, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
431 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
432 case 0x000f:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
433 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x000f, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
434 break;
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
435 case 0x0010:
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
436 workingPtr->handled = aim_parse_evilnotify_middle(sess, workingPtr);
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
437 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
438 case 0x0013:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
439 workingPtr->handled = aim_parsemotd_middle(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
440 break;
1258
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
441 case 0x0018:
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
442 workingPtr->handled = aim_parse_hostversions(sess, workingPtr);
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
443 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
444 default:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
445 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_GEN, AIM_CB_GEN_DEFAULT, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
446 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
447 }
835
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
448 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
449 case 0x0002: /* Family: Location */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
450 switch (subtype) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
451 case 0x0001:
835
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
452 workingPtr->handled = aim_parse_locateerr(sess, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
453 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
454 case 0x0003:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
455 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0002, 0x0003, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
456 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
457 case 0x0006:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
458 workingPtr->handled = aim_parse_userinfo_middle(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
459 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
460 default:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
461 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_LOC, AIM_CB_LOC_DEFAULT, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
462 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
463 }
835
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
464 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
465 case 0x0003: /* Family: Buddy List */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
466 switch (subtype) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
467 case 0x0001:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
468 workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
469 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
470 case 0x0003:
835
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
471 workingPtr->handled = aim_parse_buddyrights(sess, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
472 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
473 case 0x000b: /* oncoming buddy */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
474 workingPtr->handled = aim_parse_oncoming_middle(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
475 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
476 case 0x000c: /* offgoing buddy */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
477 workingPtr->handled = aim_parse_offgoing_middle(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
478 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
479 default:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
480 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_BUD, AIM_CB_BUD_DEFAULT, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
481 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
482 break;
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
483 case 0x0004: /* Family: Messaging */
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
484 switch (subtype) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
485 case 0x0001:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
486 workingPtr->handled = aim_parse_msgerror_middle(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
487 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
488 case 0x0005:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
489 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0004, 0x0005, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
490 break;
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
491 case 0x0006:
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
492 workingPtr->handled = aim_parse_outgoing_im_middle(sess, workingPtr);
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
493 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
494 case 0x0007:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
495 workingPtr->handled = aim_parse_incoming_im_middle(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
496 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
497 case 0x000a:
835
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
498 workingPtr->handled = aim_parse_missedcall(sess, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
499 break;
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
500 case 0x000c:
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
501 workingPtr->handled = aim_parse_msgack_middle(sess, workingPtr);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
502 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
503 default:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
504 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_MSG, AIM_CB_MSG_DEFAULT, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
505 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
506 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
507 case 0x0009:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
508 if (subtype == 0x0001)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
509 workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
510 else if (subtype == 0x0003)
835
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
511 workingPtr->handled = aim_parse_bosrights(sess, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
512 else
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
513 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_BOS, AIM_CB_BOS_DEFAULT, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
514 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
515 case 0x000a: /* Family: User lookup */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
516 switch (subtype) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
517 case 0x0001:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
518 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x000a, 0x0001, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
519 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
520 case 0x0003:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
521 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x000a, 0x0003, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
522 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
523 default:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
524 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_LOK, AIM_CB_LOK_DEFAULT, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
525 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
526 break;
835
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
527 case 0x000b: {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
528 if (subtype == 0x0001)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
529 workingPtr->handled = aim_parse_generalerrs(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
530 else if (subtype == 0x0002)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
531 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x000b, 0x0002, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
532 else
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
533 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_STS, AIM_CB_STS_DEFAULT, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
534 break;
835
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
535 }
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
536 case 0x0013: {
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
537 printf("lalala: 0x%04x/0x%04x\n", family, subtype);
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
538 break;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
539 }
835
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
540 case AIM_CB_FAM_SPECIAL:
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
541 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
542 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
543 default:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
544 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_UNKNOWN, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
545 break;
835
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
546 } /* switch(family) */
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
547 break;
835
88f8f98de02d [gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
548 } /* AIM_CONN_TYPE_BOS */
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
549 case AIM_CONN_TYPE_CHATNAV: {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
550 u_short family;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
551 u_short subtype;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
552 family = aimutil_get16(workingPtr->data);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
553 subtype= aimutil_get16(workingPtr->data+2);
1081
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
554
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
555 if ((family == 0x0000) && (subtype == 0x00001)) {
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
556 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, workingPtr);
1258
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
557 } else if ((family == 0x0001) && (subtype == 0x0003)) {
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
558 workingPtr->handled = aim_parse_hostonline(sess, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
559 } else if ((family == 0x000d) && (subtype == 0x0009)) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
560 workingPtr->handled = aim_chatnav_parse_info(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
561 } else {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
562 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
563 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
564 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
565 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
566 case AIM_CONN_TYPE_CHAT: {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
567 u_short family, subtype;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
568
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
569 family = aimutil_get16(workingPtr->data);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
570 subtype= aimutil_get16(workingPtr->data+2);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
571
1081
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
572 if ((family == 0x0000) && (subtype == 0x00001)) {
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
573 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, workingPtr);
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
574 } else if (family == 0x0001) {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
575 if (subtype == 0x0001)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
576 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x0001, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
577 else if (subtype == 0x0003)
1258
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
578 workingPtr->handled = aim_parse_hostonline(sess, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
579 else if (subtype == 0x0007)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
580 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x0007, workingPtr);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
581 else if (subtype == 0x000a)
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
582 workingPtr->handled = aim_parse_ratechange_middle(sess, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
583 else
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
584 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
585 } else if (family == 0x000e) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
586 if (subtype == 0x0002)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
587 workingPtr->handled = aim_chat_parse_infoupdate(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
588 else if (subtype == 0x0003)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
589 workingPtr->handled = aim_chat_parse_joined(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
590 else if (subtype == 0x0004)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
591 workingPtr->handled = aim_chat_parse_leave(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
592 else if (subtype == 0x0006)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
593 workingPtr->handled = aim_chat_parse_incoming(sess, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
594 else
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
595 printf("Chat: unknown snac %04x/%04x\n", family, subtype);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
596 } else {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
597 printf("Chat: unknown snac %04x/%04x\n", family, subtype);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
598 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_DEFAULT, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
599 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
600 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
601 }
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
602 case AIM_CONN_TYPE_RENDEZVOUS: {
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
603 /* make sure that we only get OFT frames on these connections */
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
604 if (workingPtr->hdrtype != AIM_FRAMETYPE_OFT) {
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
605 printf("faim: internal error: non-OFT frames on OFT connection\n");
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
606 workingPtr->handled = 1; /* get rid of it */
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
607 break;
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
608 }
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
609
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
610 /* XXX: implement this */
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
611 printf("faim: OFT frame!\n");
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
612
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
613 break;
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
614 }
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
615 case AIM_CONN_TYPE_RENDEZVOUS_OUT: {
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
616 /* not possible */
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
617 break;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
618 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
619 default:
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
620 printf("\ninternal error: unknown connection type (very bad.) (type = %d, fd = %d, commandlen = %02x)\n\n", workingPtr->conn->type, workingPtr->conn->fd, workingPtr->commandlen);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
621 workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_UNKNOWN, workingPtr);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
622 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
623 }
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
624 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
625 }
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
626
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
627 /*
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
628 * This doesn't have to be called here. It could easily be done
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
629 * by a seperate thread or something. It's an administrative operation,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
630 * and can take a while. Though the less you call it the less memory
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
631 * you'll have :)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
632 */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
633 aim_purge_rxqueue(sess);
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
634
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
635 return 0;
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
636 }
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
637
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
638 faim_internal int aim_parse_msgack_middle(struct aim_session_t *sess, struct command_rx_struct *command)
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
639 {
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
640 rxcallback_t userfunc = NULL;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
641 char sn[MAXSNLEN];
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
642 unsigned short type;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
643 int i = 10+8; /* skip SNAC and cookie */
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
644 int ret = 1;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
645 unsigned char snlen;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
646
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
647 type = aimutil_get16(command->data+i);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
648 i += 2;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
649
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
650 snlen = aimutil_get8(command->data+i);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
651 i++;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
652
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
653 memset(sn, 0, sizeof(sn));
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
654 strncpy(sn, (char *)command->data+i, snlen);
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
655
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
656 if ((userfunc = aim_callhandler(command->conn, 0x0004, 0x000c)))
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
657 ret = userfunc(sess, command, type, sn);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
658
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
659 return ret;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
660 }
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
661
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
662 /*
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
663 * The Rate Limiting System, An Abridged Guide to Nonsense.
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
664 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
665 * OSCAR defines several 'rate classes'. Each class has seperate
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
666 * rate limiting properties (limit level, alert level, disconnect
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
667 * level, etc), and a set of SNAC family/type pairs associated with
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
668 * it. The rate classes, their limiting properties, and the definitions
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
669 * of which SNACs are belong to which class, are defined in the
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
670 * Rate Response packet at login to each host.
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
671 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
672 * Logically, all rate offenses within one class count against further
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
673 * offenses for other SNACs in the same class (ie, sending messages
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
674 * too fast will limit the number of user info requests you can send,
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
675 * since those two SNACs are in the same rate class).
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
676 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
677 * Since the rate classes are defined dynamically at login, the values
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
678 * below may change. But they seem to be fairly constant.
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
679 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
680 * Currently, BOS defines five rate classes, with the commonly used
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
681 * members as follows...
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
682 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
683 * Rate class 0x0001:
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
684 * - Everything thats not in any of the other classes
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
685 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
686 * Rate class 0x0002:
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
687 * - Buddy list add/remove
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
688 * - Permit list add/remove
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
689 * - Deny list add/remove
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
690 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
691 * Rate class 0x0003:
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
692 * - User information requests
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
693 * - Outgoing ICBMs
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
694 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
695 * Rate class 0x0004:
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
696 * - A few unknowns: 2/9, 2/b, and f/2
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
697 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
698 * Rate class 0x0005:
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
699 * - Chat room create
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
700 * - Outgoing chat ICBMs
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
701 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
702 * The only other thing of note is that class 5 (chat) has slightly looser
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
703 * limiting properties than class 3 (normal messages). But thats just a
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
704 * small bit of trivia for you.
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
705 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
706 * The last thing that needs to be learned about the rate limiting
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
707 * system is how the actual numbers relate to the passing of time. This
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
708 * seems to be a big mystery.
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
709 *
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
710 */
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
711 faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct command_rx_struct *command)
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
712 {
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
713 rxcallback_t userfunc = NULL;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
714 int ret = 1;
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
715 int i;
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
716 int code;
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
717 unsigned long rateclass, windowsize, clear, alert, limit, disconnect;
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
718 unsigned long currentavg, maxavg;
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
719
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
720 i = 10;
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
721
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
722 code = aimutil_get16(command->data+i);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
723 i += 2;
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
724
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
725 rateclass = aimutil_get16(command->data+i);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
726 i += 2;
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
727
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
728 windowsize = aimutil_get32(command->data+i);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
729 i += 4;
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
730 clear = aimutil_get32(command->data+i);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
731 i += 4;
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
732 alert = aimutil_get32(command->data+i);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
733 i += 4;
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
734 limit = aimutil_get32(command->data+i);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
735 i += 4;
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
736 disconnect = aimutil_get32(command->data+i);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
737 i += 4;
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
738 currentavg = aimutil_get32(command->data+i);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
739 i += 4;
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
740 maxavg = aimutil_get32(command->data+i);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1258
diff changeset
741 i += 4;
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
742
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
743 if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x000a)))
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
744 ret = userfunc(sess, command, code, rateclass, windowsize, clear, alert, limit, disconnect, currentavg, maxavg);
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
745
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
746 return ret;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
747 }
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 446
diff changeset
748
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
749 faim_internal int aim_parse_evilnotify_middle(struct aim_session_t *sess, struct command_rx_struct *command)
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
750 {
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
751 rxcallback_t userfunc = NULL;
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
752 int ret = 1;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
753 int i;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
754 unsigned short newevil;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
755 struct aim_userinfo_s userinfo;
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
756
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
757 i = 10;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
758 newevil = aimutil_get16(command->data+10);
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
759 i += 2;
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
760
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
761 memset(&userinfo, 0, sizeof(struct aim_userinfo_s));
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
762 if (command->commandlen-i)
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
763 i += aim_extractuserinfo(command->data+i, &userinfo);
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
764
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
765 if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x0010)))
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
766 ret = userfunc(sess, command, newevil, &userinfo);
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
767
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
768 return ret;
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
769 }
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
770
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
771 faim_internal int aim_parsemotd_middle(struct aim_session_t *sess,
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
772 struct command_rx_struct *command, ...)
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
773 {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
774 rxcallback_t userfunc = NULL;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
775 char *msg;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
776 int ret=1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
777 struct aim_tlvlist_t *tlvlist;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
778 u_short id;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
779
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
780 /*
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
781 * Code.
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
782 *
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
783 * Valid values:
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
784 * 1 Mandatory upgrade
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
785 * 2 Advisory upgrade
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
786 * 3 System bulletin
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
787 * 4 Nothing's wrong ("top o the world" -- normal)
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
788 *
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
789 */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
790 id = aimutil_get16(command->data+10);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
791
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
792 /*
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
793 * TLVs follow
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
794 */
715
58106806ac2b [gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
795 if (!(tlvlist = aim_readtlvchain(command->data+12, command->commandlen-12)))
58106806ac2b [gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
796 return ret;
58106806ac2b [gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
797
58106806ac2b [gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
798 if (!(msg = aim_gettlv_str(tlvlist, 0x000b, 1))) {
58106806ac2b [gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
799 aim_freetlvchain(&tlvlist);
58106806ac2b [gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
800 return ret;
58106806ac2b [gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
801 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
802
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
803 userfunc = aim_callhandler(command->conn, 0x0001, 0x0013);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
804 if (userfunc)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
805 ret = userfunc(sess, command, id, msg);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
806
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
807 aim_freetlvchain(&tlvlist);
715
58106806ac2b [gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
808 free(msg);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
809
715
58106806ac2b [gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
810 return ret;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
811 }
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
812
1258
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
813 faim_internal int aim_parse_hostonline(struct aim_session_t *sess,
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
814 struct command_rx_struct *command, ...)
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
815 {
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
816 rxcallback_t userfunc = NULL;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
817 int ret = 1;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
818 unsigned short *families = NULL;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
819 int famcount = 0, i;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
820
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
821 famcount = (command->commandlen-10)/2;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
822 if (!(families = malloc(command->commandlen-10)))
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
823 return ret;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
824
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
825 for (i = 0; i < famcount; i++)
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
826 families[i] = aimutil_get16(command->data+((i*2)+10));
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
827
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
828 if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x0003)))
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
829 ret = userfunc(sess, command, famcount, families);
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
830
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
831 free(families);
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
832
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
833 return ret;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
834 }
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
835
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
836 faim_internal int aim_parse_hostversions(struct aim_session_t *sess,
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
837 struct command_rx_struct *command, ...)
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
838 {
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
839 rxcallback_t userfunc = NULL;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
840 int ret = 1;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
841 int vercount;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
842
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
843 vercount = (command->commandlen-10)/4;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
844
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
845 if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x0018)))
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
846 ret = userfunc(sess, command, vercount, command->data+10);
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
847
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
848 return ret;
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
849 }
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
850
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
851 faim_internal int aim_handleredirect_middle(struct aim_session_t *sess,
1258
385c1a1d96aa [gaim-migrate @ 1268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1248
diff changeset
852 struct command_rx_struct *command, ...)
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
853 {
1248
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
854 int serviceid = 0;
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
855 unsigned char *cookie = NULL;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
856 char *ip = NULL;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
857 rxcallback_t userfunc = NULL;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
858 struct aim_tlvlist_t *tlvlist;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
859 int ret = 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
860
1248
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
861 tlvlist = aim_readtlvchain(command->data+10, command->commandlen-10);
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
862
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
863 if (aim_gettlv(tlvlist, 0x000d, 1))
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
864 serviceid = aim_gettlv16(tlvlist, 0x000d, 1);
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
865 if (aim_gettlv(tlvlist, 0x0005, 1))
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
866 ip = aim_gettlv_str(tlvlist, 0x0005, 1);
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
867 if (aim_gettlv(tlvlist, 0x0006, 1))
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
868 cookie = aim_gettlv_str(tlvlist, 0x0006, 1);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
869
1248
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
870 if ((serviceid == AIM_CONN_TYPE_CHAT) && sess->pendingjoin) {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
871
1248
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
872 /*
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
873 * Chat hack.
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
874 *
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
875 */
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
876 if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x0005)))
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
877 ret = userfunc(sess, command, serviceid, ip, cookie, sess->pendingjoin, (int)sess->pendingjoinexchange);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
878 free(sess->pendingjoin);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
879 sess->pendingjoin = NULL;
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1081
diff changeset
880 sess->pendingjoinexchange = 0;
1248
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
881 } else if (!serviceid || !ip || !cookie) { /* yeep! */
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
882 ret = 1;
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
883 } else {
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
884 if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x0005)))
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
885 ret = userfunc(sess, command, serviceid, ip, cookie);
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
886 }
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
887
1248
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
888 if (ip)
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
889 free(ip);
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
890 if (cookie)
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
891 free(cookie);
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
892
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
893 aim_freetlvchain(&tlvlist);
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
894
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
895 return ret;
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
896 }
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
897
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
898 faim_internal int aim_parse_unknown(struct aim_session_t *sess,
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
899 struct command_rx_struct *command, ...)
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
900 {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
901 u_int i = 0;
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
902
1081
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
903 if (!sess || !command)
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
904 return 1;
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
905
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
906 faimdprintf(1, "\nRecieved unknown packet:");
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
907
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
908 for (i = 0; i < command->commandlen; i++)
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
909 {
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
910 if ((i % 8) == 0)
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
911 faimdprintf(1, "\n\t");
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
912
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
913 faimdprintf(1, "0x%2x ", command->data[i]);
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
914 }
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
915
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 331
diff changeset
916 faimdprintf(1, "\n\n");
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
917
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
918 return 1;
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
919 }
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
920
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
921
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
922 faim_internal int aim_negchan_middle(struct aim_session_t *sess,
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
923 struct command_rx_struct *command)
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
924 {
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
925 struct aim_tlvlist_t *tlvlist;
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
926 char *msg = NULL;
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
927 unsigned short code = 0;
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
928 rxcallback_t userfunc = NULL;
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
929 int ret = 1;
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
930
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
931 tlvlist = aim_readtlvchain(command->data, command->commandlen);
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
932
1248
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
933 if (aim_gettlv(tlvlist, 0x0009, 1))
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
934 code = aim_gettlv16(tlvlist, 0x0009, 1);
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
935
1248
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
936 if (aim_gettlv(tlvlist, 0x000b, 1))
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
937 msg = aim_gettlv_str(tlvlist, 0x000b, 1);
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
938
1248
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
939 if ((userfunc = aim_callhandler(command->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR)))
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
940 ret = userfunc(sess, command, code, msg);
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
941
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
942 aim_freetlvchain(&tlvlist);
1248
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
943
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
944 if (msg)
920c86b753d7 [gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
945 free(msg);
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
946
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
947 return ret;
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
948 }
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
949
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
950 /*
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
951 * aim_parse_generalerrs()
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
952 *
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
953 * Middle handler for 0x0001 snac of each family.
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
954 *
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
955 */
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
956 faim_internal int aim_parse_generalerrs(struct aim_session_t *sess,
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 835
diff changeset
957 struct command_rx_struct *command, ...)
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
958 {
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
959 unsigned short family;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
960 unsigned short subtype;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
961 int ret = 1;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
962 int error = 0;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
963 rxcallback_t userfunc = NULL;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
964
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
965 family = aimutil_get16(command->data+0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2
diff changeset
966 subtype= aimutil_get16(command->data+2);
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
967
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
968 if (command->commandlen > 10)
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
969 error = aimutil_get16(command->data+10);
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
970
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
971 if ((userfunc = aim_callhandler(command->conn, family, subtype)))
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
972 ret = userfunc(sess, command, error);
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
973
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
974 return ret;
2
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
975 }
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
976
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
977
68b230f8da5f [gaim-migrate @ 11]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
978