+int faimtest_parse_msgack(struct aim_session_t *, struct command_rx_struct *command, ...);
+int faimtest_parse_motd(struct aim_session_t *, struct command_rx_struct *command, ...);
+int faimtest_parse_login(struct aim_session_t *, struct command_rx_struct *command, ...);
+int faimtest_chatnav_info(struct aim_session_t *, struct command_rx_struct *command, ...);
+int faimtest_chat_incomingmsg(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_chat_infoupdate(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_chat_leave(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_chat_join(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_parse_connerr(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_debugconn_connect(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+
+int faimtest_directim_request(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_directim_initiate(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_directim_connect(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_directim_incoming(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_directim_disconnect(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_directim_typing(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+#define FILESUPPORT
+#ifdef FILESUPPORT
+int faimtest_getfile_filereq(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_getfile_filesend(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_getfile_complete(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_getfile_disconnect(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+#endif
+
+int faimtest_parse_ratechange(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_parse_evilnotify(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_parse_msgerr(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_parse_buddyrights(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+int faimtest_parse_locerr(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+
+static char *msgerrreasons[] = {
+ "Invalid error",
+ "Invalid SNAC",
+ "Rate to host",
+ "Rate to client",
+ "Not logged on",
+ "Service unavailable",
+ "Service not defined",
+ "Obsolete SNAC",
+ "Not supported by host",
+ "Not supported by client",
+ "Refused by client",
+ "Reply too big",
+ "Responses lost",
+ "Request denied",
+ "Busted SNAC payload",
+ "Insufficient rights",
+ "In local permit/deny",
+ "Too evil (sender)",
+ "Too evil (receiver)",
+ "User temporarily unavailable",
+ "No match",
+ "List overflow",
+ "Request ambiguous",
+ "Queue full",
+ "Not while on AOL"};
+static int msgerrreasonslen = 25;
+
+static char *screenname,*password,*server=NULL;
+static int connected = 0;
+
+int faimtest_reportinterval(struct aim_session_t *sess, struct command_rx_struct *command, ...)
+{
+ if (command->data) {
+ printf("aim: minimum report interval: %d (seconds?)\n", aimutil_get16(command->data+10));
+ } else
+ printf("aim: NULL minimum report interval!\n");
+ return 1;
+}
+
+int faimtest_flapversion(struct aim_session_t *sess, struct command_rx_struct *command, ...)
+{
+
+ printf("faimtest: using FLAP version %u\n", aimutil_get32(command->data));
+
+#if 0
+ /*
+ * This is an alternate location for starting the login process.
+ */
+ /* XXX should do more checking to make sure its really the right AUTH conn */
+ if (command->conn->type == AIM_CONN_TYPE_AUTH) {
+ /* do NOT send a connack/flapversion, request_login will send it if needed */
+ aim_request_login(sess, command->conn, screenname);
+ printf("faimtest: login request sent\n");
+ }
+#endif
+
+ return 1;
+}
+
+/*
+ * This is a frivilous callback. You don't need it. I only used it for
+ * debugging non-blocking connects.
+ *
+ * If packets are sent to a conn before its fully connected, they
+ * will be queued and then transmitted when the connection completes.
+ *
+ */
+int faimtest_conncomplete(struct aim_session_t *sess, struct command_rx_struct *command, ...)
+{
+ va_list ap;
+ struct aim_conn_t *conn;
+
+ va_start(ap, command);
+ conn = va_arg(ap, struct aim_conn_t *);
+ va_end(ap);
+
+ if (conn)
+ printf("faimtest: connection on %d completed\n", conn->fd);
+
+ return 1;
+}
+
+#ifdef _WIN32
+/*
+ * This is really all thats needed to link against libfaim on win32.
+ *
+ * Note that this particular version of faimtest has never been tested
+ * on win32, but I'm fairly sure it should.
+ */
+int initwsa(void)
+{
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2,2);
+ return WSAStartup(wVersionRequested, &wsaData);
+}
+#endif /* _WIN32 */