switch (family) {
/* New login protocol */
-#ifdef SNACLOGIN
case 0x0017:
if (subtype == 0x0001)
workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0x0001, workingPtr);
else if (subtype == 0x0003)
workingPtr->handled = aim_authparse(sess, workingPtr);
else if (subtype == 0x0007)
- workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0x0007, workingPtr);
+ workingPtr->handled = aim_authkeyparse(sess, workingPtr);
else
workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0017, 0xffff, workingPtr);
break;
-#else
- /* XXX: this isnt foolproof */
- case 0x0001:
- workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_GEN, AIM_CB_GEN_SERVERREADY, workingPtr);
- break;
- case 0x0007:
- if (subtype == 0x0005)
- workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_ADM, AIM_CB_ADM_INFOCHANGE_REPLY, workingPtr);
+ case 0x0007:
+ if (subtype == 0x0005)
+ workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_ADM, AIM_CB_ADM_INFOCHANGE_REPLY, workingPtr);
+ break;
+ case AIM_CB_FAM_SPECIAL:
+ if (subtype == AIM_CB_SPECIAL_DEBUGCONN_CONNECT) {
+ workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
+ break;
+ } /* others fall through */
+ default:
+#if 0
+ /* Old login protocol */
+ /* any user callbacks will be called from here */
+ workingPtr->handled = aim_authparse(sess, workingPtr);
break;
- case AIM_CB_FAM_SPECIAL:
- if (subtype == AIM_CB_SPECIAL_DEBUGCONN_CONNECT) {
- workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
- break;
- } /* others fall through */
- default:
- /* Old login protocol */
- /* any user callbacks will be called from here */
- workingPtr->handled = aim_authparse(sess, workingPtr);
#endif
}
}
case 0x000f:
workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x0001, 0x000f, workingPtr);
break;
+ case 0x0010:
+ workingPtr->handled = aim_parse_evilnotify_middle(sess, workingPtr);
+ break;
case 0x0013:
workingPtr->handled = aim_parsemotd_middle(sess, workingPtr);
break;
return ret;
}
+int aim_parse_evilnotify_middle(struct aim_session_t *sess, struct command_rx_struct *command)
+{
+ rxcallback_t userfunc = NULL;
+ int ret = 1, pos;
+ char *sn = NULL;
+
+ if(command->commandlen < 12) /* a warning level dec sends this */
+ return 1;
+
+ if ((pos = aimutil_get8(command->data+ 12)) > MAXSNLEN)
+ return 1;
+
+ if(!(sn = (char *)calloc(1, pos+1)))
+ return 1;
+
+ memcpy(sn, command->data+13, pos);
+
+ if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x0010)))
+ ret = userfunc(sess, command, sn);
+
+ free(sn);
+
+ return ret;
+}
+
int aim_parsemotd_middle(struct aim_session_t *sess,
struct command_rx_struct *command, ...)
{
u_short id;
/*
- * Dunno.
+ * Code.
+ *
+ * Valid values:
+ * 1 Mandatory upgrade
+ * 2 Advisory upgrade
+ * 3 System bulletin
+ * 4 Nothing's wrong ("top o the world" -- normal)
+ *
*/
id = aimutil_get16(command->data+10);