+static int incomingim_ch2_buddyicon(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2)
+{
+ aim_rxcallback_t userfunc;
+ int ret = 0;
+ aim_tlv_t *miscinfo;
+ aim_bstream_t tbs;
+
+ miscinfo = aim_gettlv(list2, 0x2711, 1);
+ aim_bstream_init(&tbs, miscinfo->value, miscinfo->length);
+
+ args->info.icon.checksum = aimbs_get32(&tbs);
+ args->info.icon.length = aimbs_get32(&tbs);
+ args->info.icon.timestamp = aimbs_get32(&tbs);
+ args->info.icon.icon = aimbs_getraw(&tbs, args->info.icon.length);
+
+ if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
+ ret = userfunc(sess, rx, 0x0002, userinfo, args);
+
+ free(args->info.icon.icon);
+
+ return ret;
+}
+
+static int incomingim_ch2_imimage(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2)
+{
+ aim_rxcallback_t userfunc;
+ int ret = 0;
+
+ /* Primary IP address */
+ if (aim_gettlv(list2, 0x0003, 1)) {
+ aim_tlv_t *tlv;
+
+ tlv = aim_gettlv(list2, 0x0003, 1);
+
+ snprintf(args->info.imimage.ip, sizeof(args->info.imimage.ip),
+ "%d.%d.%d.%d:4443",
+ tlv->value[0],
+ tlv->value[1],
+ tlv->value[2],
+ tlv->value[3]);
+ }
+
+ /*
+ * Alternate IP address
+ *
+ * Sort of. The peer doesn't send this -- the OSCAR
+ * server does. So it will be the IP address that the
+ * peer is directly connected to the internet with, which
+ * may not be the same as the IP above. If these two
+ * values differ, it's rather unlikely that this
+ * rendezvous is going to happen...
+ *
+ */
+ if (aim_gettlv(list2, 0x0004, 1))
+ ;
+
+ /* Port number (not correct -- ignore) */
+ if (aim_gettlv(list2, 0x0005, 1))
+ ;
+
+ /* Unknown -- two bytes = 0x0001 */
+ if (aim_gettlv(list2, 0x000a, 1))
+ ;
+
+ /* Unknown -- no value */
+ if (aim_gettlv(list2, 0x000f, 1))
+ ;
+
+ faimdprintf(sess, 1, "rend: directIM request from %s (%s)\n", userinfo->sn, args->info.imimage.ip);
+
+ /*
+ * XXX: there are a couple of different request packets for
+ * different things
+ */
+
+ if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
+ ret = userfunc(sess, rx, 0x0002, userinfo, args);
+
+ return ret;
+}
+