]> andersk Git - libfaim.git/commitdiff
- Sat Dec 16 01:34:19 UTC 2000
authormid <mid>
Sat, 16 Dec 2000 01:41:03 +0000 (01:41 +0000)
committermid <mid>
Sat, 16 Dec 2000 01:41:03 +0000 (01:41 +0000)
  - Rename paramid to rateclass
  - Add a long comment about the rate system
  - Add a few other comments
  - Clean up aim_bos_clientready().

CHANGES
aim_login.c
aim_misc.c
aim_rxhandlers.c
utils/faimtest/faimtest.c

diff --git a/CHANGES b/CHANGES
index 0ed63f5cf57fd780c0c7f8997e3d91caf7d7ce8d..3f04d26bba0efb47281a783b6a494eed5f827575 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,12 @@
 
 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
index 5a4c7790e4434a75b74e7b6c9a2d5350ea7075e7..8f880b1068c7bcc56ed5224020573f7c45660537 100644 (file)
@@ -361,6 +361,14 @@ faim_internal int aim_authparse(struct aim_session_t *sess,
   /*
    * 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);
index 590d981a1e694a1ec184550506662d05e302ab47..f5e78d76ad1214b0dbc78593634eb2da0d617ab6 100644 (file)
@@ -301,79 +301,57 @@ faim_internal int aim_parse_bosrights(struct aim_session_t *sess,
  * 
  * 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;
 }
 
 /* 
index 16b77443df251edc771dcc40b37549c58390b1aa..784016728fb0650d6258fde4bdb6c563257982a4 100644 (file)
@@ -659,13 +659,62 @@ faim_internal int aim_parse_msgack_middle(struct aim_session_t *sess, struct com
   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;
@@ -673,7 +722,7 @@ faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct
   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);
@@ -692,7 +741,7 @@ faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct
   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;
 }
index 3afbc7de6ae4913580f0120e5389569e1e130a54..d0c0453a3ead9750f8bc0cfd247e3d202ac1208e 100644 (file)
@@ -1631,7 +1631,7 @@ int faimtest_parse_ratechange(struct aim_session_t *sess, struct command_rx_stru
                           "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); 
@@ -1640,12 +1640,9 @@ int faimtest_parse_ratechange(struct aim_session_t *sess, struct command_rx_stru
   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 
@@ -1665,9 +1662,9 @@ int faimtest_parse_ratechange(struct aim_session_t *sess, struct command_rx_stru
   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,
This page took 0.077025 seconds and 5 git commands to generate.