+
+ if (aim_gettlv(list2, 0x0003, 1) && aim_gettlv(list2, 0x0005, 1)) {
+ struct aim_tlv_t *iptlv, *porttlv;
+
+ if (!(iptlv = aim_gettlv(list2, 0x0003, 1)) || !(porttlv = aim_gettlv(list2, 0x0005, 1))) {
+ free(cachedcook);
+ return 0;
+ }
+
+ snprintf(ip, 30, "%d.%d.%d.%d:%d",
+ aimutil_get8(iptlv->value+0),
+ aimutil_get8(iptlv->value+1),
+ aimutil_get8(iptlv->value+2),
+ aimutil_get8(iptlv->value+3),
+ aimutil_get16(porttlv->value));
+ }
+
+ printf("faim: rend: file get request from %s (%s)\n", userinfo.sn, ip);
+
+ /*
+ * Call client.
+ */
+ userfunc = aim_callhandler(command->conn, 0x0004, 0x0007);
+ if (userfunc || (i = 0))
+ i = userfunc(sess,
+ command,
+ channel,
+ reqclass,
+ &userinfo,
+ ip,
+ cookie);
+
+ } else if (reqclass & AIM_CAPS_SENDFILE) {
+#if 0
+ char ip[30];
+ char *desc = NULL;
+ struct aim_msgcookie_t *cachedcook;
+ struct aim_filetransfer_priv *ft;
+ struct aim_tlv_t *miscinfo;
+
+ memset(ip, 0, sizeof(ip));
+
+ if (!(miscinfo = aim_gettlv(list2, 0x2711, 1)))
+ return 0;
+
+ if (aim_gettlv(list2, 0x0003, 1) && aim_gettlv(list2, 0x0003, 1)) {
+ struct aim_tlv_t *iptlv, *porttlv;
+
+ iptlv = aim_gettlv(list2, 0x0003, 1);
+ porttlv = aim_gettlv(list2, 0x0005, 1);
+
+ snprintf(ip, sizeof(ip)-1, "%d.%d.%d.%d:%d",
+ aimutil_get8(iptlv->value+0),
+ aimutil_get8(iptlv->value+1),
+ aimutil_get8(iptlv->value+2),
+ aimutil_get8(iptlv->value+3),
+ aimutil_get16(porttlv->value));
+ }
+
+ if (aim_gettlv(list2, 0x000c, 1)) {
+ desc = aim_gettlv_str(list2, 0x000c, 1);
+ }
+
+ printf("faim: rend: file transfer request from %s for %s: %s (%s)\n",
+ userinfo.sn,
+ miscinfo->value+8,
+ desc,
+ ip);
+
+ memcpy(cachedcook->cookie, cookie, 8);
+
+ ft = malloc(sizeof(struct aim_filetransfer_priv));
+ strncpy(ft->sn, userinfo.sn, sizeof(ft->sn));
+ strncpy(ft->ip, ip, sizeof(ft->ip));
+ strncpy(ft->fh.name, miscinfo->value+8, sizeof(ft->fh.name));
+ cachedcook->type = AIM_COOKIETYPE_OFTSEND;
+ cachedcook->data = ft;
+
+ if (aim_cachecookie(sess, cachedcook) != 0)
+ printf("faim: ERROR caching message cookie\n");
+
+
+ aim_accepttransfer(sess, command->conn, ft->sn, cookie, AIM_CAPS_SENDFILE);
+
+ if (desc)
+ free(desc);
+#endif
+ /*
+ * Call client.
+ */
+ userfunc = aim_callhandler(command->conn, 0x0004, 0x0007);
+ if (userfunc || (i = 0))
+ i = userfunc(sess,
+ command,
+ channel,
+ reqclass,
+ &userinfo);
+ } else {
+ printf("faim: rend: unknown rendezvous 0x%04x\n", reqclass);
+ }
+