]> andersk Git - libfaim.git/blobdiff - aim_tlv.c
Lots of minor cleanups. Adds new (disabled) SNAC-based login.
[libfaim.git] / aim_tlv.c
index a8cf05b1478ba9e74bd18ed60fa19ada7cd52c91..94acf033ea516fc55d16c55f229583c9fd58a560 100644 (file)
--- a/aim_tlv.c
+++ b/aim_tlv.c
@@ -1,4 +1,4 @@
-#include <aim.h>
+#include <faim/aim.h>
 
 struct aim_tlvlist_t *aim_readtlvchain(u_char *buf, int maxlen)
 {
@@ -188,3 +188,26 @@ int aim_puttlv_16(u_char *buf, u_short t, u_short v)
   curbyte += aimutil_put16(buf+curbyte, (u_short)(v&0xffff));
   return curbyte;
 }
+
+int aim_puttlv_32(u_char *buf, u_short t, u_long v)
+{
+  int curbyte=0;
+  curbyte += aimutil_put16(buf+curbyte, (u_short)(t&0xffff));
+  curbyte += aimutil_put16(buf+curbyte, (u_short)0x0004);
+  curbyte += aimutil_put32(buf+curbyte, (u_long)(v&0xffffffff));
+  return curbyte;
+}
+
+int aim_puttlv_str(u_char *buf, u_short t, u_short l, u_char *v)
+{
+  int curbyte;
+  if (!v || !buf)
+    return 0;
+  
+  curbyte  = 0;
+  curbyte += aimutil_put16(buf+curbyte, (u_short)(t&0xffff));
+  curbyte += aimutil_put16(buf+curbyte, (u_short)(l&0xffff));
+  memcpy(buf+curbyte, v, l);
+  curbyte += l;
+  return curbyte;
+}
This page took 0.058344 seconds and 4 git commands to generate.