+ /*
+ * Type = 0x000f: Session Length. (AIM)
+ * Type = 0x0010: Session Length. (AOL)
+ *
+ * The duration, in seconds, of the user's
+ * current session.
+ *
+ * Which TLV type this comes in depends
+ * on the service the user is using (AIM or AOL).
+ *
+ */
+ case 0x000f:
+ case 0x0010:
+ outinfo->sessionlen = aimutil_get32(&buf[i+4]);
+ break;
+
+ /*
+ * Reaching here indicates that either AOL has
+ * added yet another TLV for us to deal with,
+ * or the parsing has gone Terribly Wrong.
+ *
+ * Either way, inform the owner and attempt
+ * recovery.
+ *
+ */
+ default:
+ {
+ int len,z = 0, y = 0, x = 0;
+ char tmpstr[80];
+ printf("faim: userinfo: **warning: unexpected TLV:\n");
+ printf("faim: userinfo: sn =%s\n", outinfo->sn);
+ printf("faim: userinfo: curtlv=0x%04x\n", curtlv);
+ printf("faim: userinfo: type =0x%04x\n",aimutil_get16(&buf[i]));
+ printf("faim: userinfo: length=0x%04x\n", len = aimutil_get16(&buf[i+2]));
+ printf("faim: userinfo: data: \n");
+ while (z<len)
+ {
+ x = sprintf(tmpstr, "faim: userinfo: ");
+ for (y = 0; y < 8; y++)
+ {
+ if (z<len)
+ {
+ sprintf(tmpstr+x, "%02x ", buf[i+4+z]);
+ z++;
+ x += 3;
+ }
+ else
+ break;
+ }
+ printf("%s\n", tmpstr);
+ }
+ }
+ break;
+ }
+ /*
+ * No matter what, TLV triplets should always look like this:
+ *
+ * u_short type;
+ * u_short length;
+ * u_char data[length];
+ *
+ */
+ if (lastvalid) {
+ i += (2 + 2 + aimutil_get16(&buf[i+2]));