No release numbers
------------------
+ - Sat Dec 16 01:34:19 UTC 2000
+ - Rename paramid to rateclass
+ - Add a long comment about the rate system
+ - Add a few other comments
+ - Clean up aim_bos_clientready().
+
- Fri Dec 15 23:35:01 UTC 2000
- Add genericerr callback/middle.
- This is for catching the errors that come back, for instance, from
/*
* The registration status. (Not real sure what it means.)
* Not available for ICQ logins.
+ *
+ * 1 = No disclosure
+ * 2 = Limited disclosure
+ * 3 = Full disclosure
+ *
+ * This has to do with whether your email address is available
+ * to other users or not. AFAIK, this feature is no longer used.
+ *
*/
if (aim_gettlv(tlvlist, 0x0013, 1))
regstatus = aim_gettlv16(tlvlist, 0x0013, 1);
*
* Send Client Ready.
*
- * TODO: Dynamisize.
- *
*/
faim_export unsigned long aim_bos_clientready(struct aim_session_t *sess,
struct aim_conn_t *conn)
{
- u_char command_2[] = {
- /* placeholders for dynamic data */
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff,
- /* real data */
- 0x00, 0x01,
- 0x00, 0x03,
- 0x00, 0x04,
- 0x06, 0x86, /* the good ones */
-#if 0
- 0x07, 0xda, /* DUPLE OF DEATH! */
-#endif
-
- 0x00, 0x02,
- 0x00, 0x01,
- 0x00, 0x04,
- 0x00, 0x01,
-
- 0x00, 0x03,
- 0x00, 0x01,
- 0x00, 0x04,
- 0x00, 0x01,
-
- 0x00, 0x04,
- 0x00, 0x01,
- 0x00, 0x04,
- 0x00, 0x01,
-
- 0x00, 0x06,
- 0x00, 0x01,
- 0x00, 0x04,
- 0x00, 0x01,
- 0x00, 0x08,
- 0x00, 0x01,
- 0x00, 0x04,
- 0x00, 0x01,
-
- 0x00, 0x09,
- 0x00, 0x01,
- 0x00, 0x04,
- 0x00, 0x01,
- 0x00, 0x0a,
- 0x00, 0x01,
- 0x00, 0x04,
- 0x00, 0x01,
-
- 0x00, 0x0b,
- 0x00, 0x01,
- 0x00, 0x04,
- 0x00, 0x01
+#define AIM_TOOL_JAVA 0x0001
+#define AIM_TOOL_MAC 0x0002
+#define AIM_TOOL_WIN16 0x0003
+#define AIM_TOOL_WIN32 0x0004
+#define AIM_TOOL_MAC68K 0x0005
+#define AIM_TOOL_MACPPC 0x0006
+ struct aim_tool_version {
+ unsigned short group;
+ unsigned short version;
+ unsigned short tool;
+ unsigned short toolversion;
+ } tools[] = {
+ {0x0001, 0x0003, AIM_TOOL_WIN32, 0x0686},
+ {0x0002, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x0003, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x0004, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x0006, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x0008, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x0009, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x000a, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x000b, 0x0001, AIM_TOOL_WIN32, 0x0001}
};
- int command_2_len = 0x52;
+ int i,j;
struct command_tx_struct *newpacket;
-
- if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, command_2_len)))
+ int toolcount = sizeof(tools)/sizeof(struct aim_tool_version);
+
+ if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 1152)))
return -1;
newpacket->lock = 1;
- memcpy(newpacket->data, command_2, command_2_len);
-
- /* This write over the dynamic parts of the byte block */
- aim_putsnac(newpacket->data, 0x0001, 0x0002, 0x0000, sess->snac_nextid);
+ i = aim_putsnac(newpacket->data, 0x0001, 0x0002, 0x0000, sess->snac_nextid);
+ aim_cachesnac(sess, 0x0001, 0x0002, 0x0000, NULL, 0);
+
+ for (j = 0; j < toolcount; j++) {
+ i += aimutil_put16(newpacket->data+i, tools[j].group);
+ i += aimutil_put16(newpacket->data+i, tools[j].version);
+ i += aimutil_put16(newpacket->data+i, tools[j].tool);
+ i += aimutil_put16(newpacket->data+i, tools[j].toolversion);
+ }
+
+ newpacket->commandlen = i;
+ newpacket->lock = 0;
aim_tx_enqueue(sess, newpacket);
- return (sess->snac_nextid++);
+ return sess->snac_nextid;
}
/*
return ret;
}
+/*
+ * The Rate Limiting System, An Abridged Guide to Nonsense.
+ *
+ * OSCAR defines several 'rate classes'. Each class has seperate
+ * rate limiting properties (limit level, alert level, disconnect
+ * level, etc), and a set of SNAC family/type pairs associated with
+ * it. The rate classes, their limiting properties, and the definitions
+ * of which SNACs are belong to which class, are defined in the
+ * Rate Response packet at login to each host.
+ *
+ * Logically, all rate offenses within one class count against further
+ * offenses for other SNACs in the same class (ie, sending messages
+ * too fast will limit the number of user info requests you can send,
+ * since those two SNACs are in the same rate class).
+ *
+ * Since the rate classes are defined dynamically at login, the values
+ * below may change. But they seem to be fairly constant.
+ *
+ * Currently, BOS defines five rate classes, with the commonly used
+ * members as follows...
+ *
+ * Rate class 0x0001:
+ * - Everything thats not in any of the other classes
+ *
+ * Rate class 0x0002:
+ * - Buddy list add/remove
+ * - Permit list add/remove
+ * - Deny list add/remove
+ *
+ * Rate class 0x0003:
+ * - User information requests
+ * - Outgoing ICBMs
+ *
+ * Rate class 0x0004:
+ * - A few unknowns: 2/9, 2/b, and f/2
+ *
+ * Rate class 0x0005:
+ * - Chat room create
+ * - Outgoing chat ICBMs
+ *
+ * The only other thing of note is that class 5 (chat) has slightly looser
+ * limiting properties than class 3 (normal messages). But thats just a
+ * small bit of trivia for you.
+ *
+ * The last thing that needs to be learned about the rate limiting
+ * system is how the actual numbers relate to the passing of time. This
+ * seems to be a big mystery.
+ *
+ */
faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct command_rx_struct *command)
{
rxcallback_t userfunc = NULL;
int ret = 1;
int i;
int code;
- unsigned long parmid, windowsize, clear, alert, limit, disconnect;
+ unsigned long rateclass, windowsize, clear, alert, limit, disconnect;
unsigned long currentavg, maxavg;
i = 10;
code = aimutil_get16(command->data+i);
i += 2;
- parmid = aimutil_get16(command->data+i);
+ rateclass = aimutil_get16(command->data+i);
i += 2;
windowsize = aimutil_get32(command->data+i);
i += 4;
if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x000a)))
- ret = userfunc(sess, command, code, parmid, windowsize, clear, alert, limit, disconnect, currentavg, maxavg);
+ ret = userfunc(sess, command, code, rateclass, windowsize, clear, alert, limit, disconnect, currentavg, maxavg);
return ret;
}
"limit cleared"};
va_list ap;
int code;
- unsigned long parmid, windowsize, clear, alert, limit, disconnect;
+ unsigned long rateclass, windowsize, clear, alert, limit, disconnect;
unsigned long currentavg, maxavg;
va_start(ap, command);
code = va_arg(ap, int);
/*
- * Known parameter ID's...
- * 0x0001 Warnings
- * 0x0003 BOS (normal ICBMs, userinfo requests, etc)
- * 0x0005 Chat messages
+ * See comments above aim_parse_ratechange_middle() in aim_rxhandlers.c.
*/
- parmid = va_arg(ap, unsigned long);
+ rateclass = va_arg(ap, unsigned long);
/*
* Not sure what this is exactly. I think its the temporal
va_end(ap);
- printf("faimtest: rate %s (paramid 0x%04lx): curavg = %ld, maxavg = %ld, alert at %ld, clear warning at %ld, limit at %ld, disconnect at %ld (window size = %ld)\n",
+ printf("faimtest: rate %s (rate class 0x%04lx): curavg = %ld, maxavg = %ld, alert at %ld, clear warning at %ld, limit at %ld, disconnect at %ld (window size = %ld)\n",
(code < 5)?codes[code]:"invalid",
- parmid,
+ rateclass,
currentavg, maxavg,
alert, clear,
limit, disconnect,