changeset 13239:f260d319bbbc

[gaim-migrate @ 15605] Renaming a bunch of structs and typedefs to use the same naming scheme as the rest of Gaim committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 12 Feb 2006 16:02:05 +0000
parents 1e855032d7bc
children 049847559e96
files src/protocols/oscar/bstream.c src/protocols/oscar/conn.c src/protocols/oscar/family_admin.c src/protocols/oscar/family_advert.c src/protocols/oscar/family_alert.c src/protocols/oscar/family_auth.c src/protocols/oscar/family_bart.c src/protocols/oscar/family_bos.c src/protocols/oscar/family_buddy.c src/protocols/oscar/family_chat.c src/protocols/oscar/family_chatnav.c src/protocols/oscar/family_feedbag.c src/protocols/oscar/family_icbm.c src/protocols/oscar/family_icq.c src/protocols/oscar/family_invite.c src/protocols/oscar/family_locate.c src/protocols/oscar/family_odir.c src/protocols/oscar/family_oservice.c src/protocols/oscar/family_popup.c src/protocols/oscar/family_stats.c src/protocols/oscar/family_translate.c src/protocols/oscar/family_userlookup.c src/protocols/oscar/misc.c src/protocols/oscar/msgcookie.c src/protocols/oscar/oscar.c src/protocols/oscar/oscar.h src/protocols/oscar/oscar_internal.h src/protocols/oscar/peer.c src/protocols/oscar/peer.h src/protocols/oscar/rxhandlers.c src/protocols/oscar/rxqueue.c src/protocols/oscar/snac.c src/protocols/oscar/tlv.c src/protocols/oscar/txqueue.c src/protocols/oscar/util.c
diffstat 35 files changed, 1393 insertions(+), 1337 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/bstream.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/bstream.c	Sun Feb 12 16:02:05 2006 +0000
@@ -24,7 +24,7 @@
 
 #include "oscar.h"
 
-faim_internal int aim_bstream_init(aim_bstream_t *bs, guint8 *data, int len)
+faim_internal int aim_bstream_init(ByteStream *bs, guint8 *data, int len)
 {
 
 	if (!bs)
@@ -37,17 +37,17 @@
 	return 0;
 }
 
-faim_internal int aim_bstream_empty(aim_bstream_t *bs)
+faim_internal int aim_bstream_empty(ByteStream *bs)
 {
 	return bs->len - bs->offset;
 }
 
-faim_internal int aim_bstream_curpos(aim_bstream_t *bs)
+faim_internal int aim_bstream_curpos(ByteStream *bs)
 {
 	return bs->offset;
 }
 
-faim_internal int aim_bstream_setpos(aim_bstream_t *bs, unsigned int off)
+faim_internal int aim_bstream_setpos(ByteStream *bs, unsigned int off)
 {
 
 	if (off > bs->len)
@@ -58,7 +58,7 @@
 	return off;
 }
 
-faim_internal void aim_bstream_rewind(aim_bstream_t *bs)
+faim_internal void aim_bstream_rewind(ByteStream *bs)
 {
 
 	aim_bstream_setpos(bs, 0);
@@ -71,7 +71,7 @@
  * in a bstream.  I'm not sure if libfaim actually does
  * this anywhere...
  */
-faim_internal int aim_bstream_advance(aim_bstream_t *bs, int n)
+faim_internal int aim_bstream_advance(ByteStream *bs, int n)
 {
 
 	if ((aim_bstream_curpos(bs) + n < 0) || (aim_bstream_empty(bs) < n))
@@ -82,7 +82,7 @@
 	return n;
 }
 
-faim_internal guint8 aimbs_get8(aim_bstream_t *bs)
+faim_internal guint8 aimbs_get8(ByteStream *bs)
 {
 
 	if (aim_bstream_empty(bs) < 1)
@@ -93,7 +93,7 @@
 	return aimutil_get8(bs->data + bs->offset - 1);
 }
 
-faim_internal guint16 aimbs_get16(aim_bstream_t *bs)
+faim_internal guint16 aimbs_get16(ByteStream *bs)
 {
 
 	if (aim_bstream_empty(bs) < 2)
@@ -104,7 +104,7 @@
 	return aimutil_get16(bs->data + bs->offset - 2);
 }
 
-faim_internal guint32 aimbs_get32(aim_bstream_t *bs)
+faim_internal guint32 aimbs_get32(ByteStream *bs)
 {
 
 	if (aim_bstream_empty(bs) < 4)
@@ -115,7 +115,7 @@
 	return aimutil_get32(bs->data + bs->offset - 4);
 }
 
-faim_internal guint8 aimbs_getle8(aim_bstream_t *bs)
+faim_internal guint8 aimbs_getle8(ByteStream *bs)
 {
 
 	if (aim_bstream_empty(bs) < 1)
@@ -126,7 +126,7 @@
 	return aimutil_getle8(bs->data + bs->offset - 1);
 }
 
-faim_internal guint16 aimbs_getle16(aim_bstream_t *bs)
+faim_internal guint16 aimbs_getle16(ByteStream *bs)
 {
 
 	if (aim_bstream_empty(bs) < 2)
@@ -137,7 +137,7 @@
 	return aimutil_getle16(bs->data + bs->offset - 2);
 }
 
-faim_internal guint32 aimbs_getle32(aim_bstream_t *bs)
+faim_internal guint32 aimbs_getle32(ByteStream *bs)
 {
 
 	if (aim_bstream_empty(bs) < 4)
@@ -148,7 +148,7 @@
 	return aimutil_getle32(bs->data + bs->offset - 4);
 }
 
-faim_internal int aimbs_getrawbuf(aim_bstream_t *bs, guint8 *buf, int len)
+faim_internal int aimbs_getrawbuf(ByteStream *bs, guint8 *buf, int len)
 {
 
 	if (aim_bstream_empty(bs) < len)
@@ -160,7 +160,7 @@
 	return len;
 }
 
-faim_internal guint8 *aimbs_getraw(aim_bstream_t *bs, int len)
+faim_internal guint8 *aimbs_getraw(ByteStream *bs, int len)
 {
 	guint8 *ob;
 
@@ -175,7 +175,7 @@
 	return ob;
 }
 
-faim_internal char *aimbs_getstr(aim_bstream_t *bs, int len)
+faim_internal char *aimbs_getstr(ByteStream *bs, int len)
 {
 	char *ob;
 
@@ -192,7 +192,7 @@
 	return ob;
 }
 
-faim_internal int aimbs_put8(aim_bstream_t *bs, guint8 v)
+faim_internal int aimbs_put8(ByteStream *bs, guint8 v)
 {
 
 	if (aim_bstream_empty(bs) < 1)
@@ -203,7 +203,7 @@
 	return 1;
 }
 
-faim_internal int aimbs_put16(aim_bstream_t *bs, guint16 v)
+faim_internal int aimbs_put16(ByteStream *bs, guint16 v)
 {
 
 	if (aim_bstream_empty(bs) < 2)
@@ -214,7 +214,7 @@
 	return 2;
 }
 
-faim_internal int aimbs_put32(aim_bstream_t *bs, guint32 v)
+faim_internal int aimbs_put32(ByteStream *bs, guint32 v)
 {
 
 	if (aim_bstream_empty(bs) < 4)
@@ -225,7 +225,7 @@
 	return 1;
 }
 
-faim_internal int aimbs_putle8(aim_bstream_t *bs, guint8 v)
+faim_internal int aimbs_putle8(ByteStream *bs, guint8 v)
 {
 
 	if (aim_bstream_empty(bs) < 1)
@@ -236,7 +236,7 @@
 	return 1;
 }
 
-faim_internal int aimbs_putle16(aim_bstream_t *bs, guint16 v)
+faim_internal int aimbs_putle16(ByteStream *bs, guint16 v)
 {
 
 	if (aim_bstream_empty(bs) < 2)
@@ -247,7 +247,7 @@
 	return 2;
 }
 
-faim_internal int aimbs_putle32(aim_bstream_t *bs, guint32 v)
+faim_internal int aimbs_putle32(ByteStream *bs, guint32 v)
 {
 
 	if (aim_bstream_empty(bs) < 4)
@@ -259,7 +259,7 @@
 }
 
 
-faim_internal int aimbs_putraw(aim_bstream_t *bs, const guint8 *v, int len)
+faim_internal int aimbs_putraw(ByteStream *bs, const guint8 *v, int len)
 {
 
 	if (aim_bstream_empty(bs) < len)
@@ -271,12 +271,12 @@
 	return len;
 }
 
-faim_internal int aimbs_putstr(aim_bstream_t *bs, const char *str)
+faim_internal int aimbs_putstr(ByteStream *bs, const char *str)
 {
 	return aimbs_putraw(bs, (guint8 *)str, strlen(str));
 }
 
-faim_internal int aimbs_putbs(aim_bstream_t *bs, aim_bstream_t *srcbs, int len)
+faim_internal int aimbs_putbs(ByteStream *bs, ByteStream *srcbs, int len)
 {
 
 	if (aim_bstream_empty(srcbs) < len)
--- a/src/protocols/oscar/conn.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/conn.c	Sun Feb 12 16:02:05 2006 +0000
@@ -29,7 +29,7 @@
 
 /* This is defined in oscar.h, but only when !FAIM_INTERNAL, since the rest of
  * the library is not allowed to call it. */
-faim_export void aim_conn_kill(aim_session_t *sess, aim_conn_t **deadconn);
+faim_export void aim_conn_kill(OscarSession *sess, OscarConnection **deadconn);
 
 #ifndef _WIN32
 #include <netdb.h>
@@ -96,7 +96,7 @@
  * about such inane things.
  *
  */
-faim_internal void aim_conn_addgroup(aim_conn_t *conn, guint16 group)
+faim_internal void aim_conn_addgroup(OscarConnection *conn, guint16 group)
 {
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
 	struct snacgroup *sg;
@@ -113,9 +113,9 @@
 	return;
 }
 
-faim_export aim_conn_t *aim_conn_findbygroup(aim_session_t *sess, guint16 group)
+faim_export OscarConnection *aim_conn_findbygroup(OscarSession *sess, guint16 group)
 {
-	aim_conn_t *cur;
+	OscarConnection *cur;
 
 	for (cur = sess->connlist; cur; cur = cur->next) {
 		aim_conn_inside_t *ins = (aim_conn_inside_t *)cur->inside;
@@ -174,7 +174,7 @@
 	return;
 }
 
-static void connkill_real(aim_session_t *sess, aim_conn_t **deadconn)
+static void connkill_real(OscarSession *sess, OscarConnection **deadconn)
 {
 
 	aim_rxqueue_cleanbyconn(sess, *deadconn);
@@ -211,9 +211,9 @@
  * been destroyed.
  */
 static int
-aim_flap_close(aim_session_t *sess, aim_conn_t *conn)
+aim_flap_close(OscarSession *sess, OscarConnection *conn)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 
 	if (!sess || !conn)
 		return -EINVAL;
@@ -231,11 +231,11 @@
  *
  * @param sess Session to be cleared.
  */
-static void aim_connrst(aim_session_t *sess)
+static void aim_connrst(OscarSession *sess)
 {
 
 	if (sess->connlist) {
-		aim_conn_t *cur = sess->connlist, *tmp;
+		OscarConnection *cur = sess->connlist, *tmp;
 
 		/* Attempt to send the log-off packet */
 		if (cur->type == AIM_CONN_TYPE_BOS)
@@ -259,7 +259,7 @@
  *
  * @param deadconn Connection to be reset.
  */
-static void aim_conn_init(aim_conn_t *deadconn)
+static void aim_conn_init(OscarConnection *deadconn)
 {
 
 	if (!deadconn)
@@ -284,13 +284,13 @@
  * @param sess Session
  * @return Returns the new connection structure.
  */
-static aim_conn_t *aim_conn_getnext(aim_session_t *sess)
+static OscarConnection *aim_conn_getnext(OscarSession *sess)
 {
-	aim_conn_t *newconn;
+	OscarConnection *newconn;
 
-	if (!(newconn = malloc(sizeof(aim_conn_t))))
+	if (!(newconn = malloc(sizeof(OscarConnection))))
 		return NULL;
-	memset(newconn, 0, sizeof(aim_conn_t));
+	memset(newconn, 0, sizeof(OscarConnection));
 
 	if (!(newconn->inside = malloc(sizeof(aim_conn_inside_t)))) {
 		free(newconn);
@@ -313,9 +313,9 @@
  * @param sess Session for the connection.
  * @param deadconn Connection to be freed.
  */
-faim_export void aim_conn_kill(aim_session_t *sess, aim_conn_t **deadconn)
+faim_export void aim_conn_kill(OscarSession *sess, OscarConnection **deadconn)
 {
-	aim_conn_t *cur, **prev;
+	OscarConnection *cur, **prev;
 
 	if (!deadconn || !*deadconn)
 		return;
@@ -348,7 +348,7 @@
  *
  * @param deadconn The connection to close.
  */
-faim_export void aim_conn_close(aim_conn_t *deadconn)
+faim_export void aim_conn_close(OscarConnection *deadconn)
 {
 	aim_rxcallback_t userfunc;
 
@@ -378,9 +378,9 @@
  * @return Returns the first connection found of the given target type,
  *         or NULL if none could be found.
  */
-faim_export aim_conn_t *aim_getconn_type(aim_session_t *sess, int type)
+faim_export OscarConnection *aim_getconn_type(OscarSession *sess, int type)
 {
-	aim_conn_t *cur;
+	OscarConnection *cur;
 
 	for (cur = sess->connlist; cur; cur = cur->next) {
 		if ((cur->type == type) &&
@@ -391,9 +391,9 @@
 	return cur;
 }
 
-faim_export aim_conn_t *aim_getconn_type_all(aim_session_t *sess, int type)
+faim_export OscarConnection *aim_getconn_type_all(OscarSession *sess, int type)
 {
-	aim_conn_t *cur;
+	OscarConnection *cur;
 
 	for (cur = sess->connlist; cur; cur = cur->next) {
 		if (cur->type == type)
@@ -404,9 +404,9 @@
 }
 
 /* If you pass -1 for the fd, you'll get what you ask for.  Gibberish. */
-faim_export aim_conn_t *aim_getconn_fd(aim_session_t *sess, int fd)
+faim_export OscarConnection *aim_getconn_fd(OscarSession *sess, int fd)
 {
-	aim_conn_t *cur;
+	OscarConnection *cur;
 
 	for (cur = sess->connlist; cur; cur = cur->next) {
 		if (cur->fd == fd)
@@ -417,7 +417,7 @@
 }
 
 /**
- * Clone an aim_conn_t.
+ * Clone an OscarConnection.
  *
  * A new connection is allocated, and the values are filled in
  * appropriately. Note that this function sets the new connnection's
@@ -426,11 +426,11 @@
  *
  * @param sess The session containing this connection.
  * @param src The connection to clone.
- * @return Returns a pointer to the new aim_conn_t, or %NULL on error.
+ * @return Returns a pointer to the new OscarConnection, or %NULL on error.
  */
-faim_internal aim_conn_t *aim_cloneconn(aim_session_t *sess, aim_conn_t *src)
+faim_internal OscarConnection *aim_cloneconn(OscarSession *sess, OscarConnection *src)
 {
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	if (!(conn = aim_conn_getnext(sess)))
 		return NULL;
@@ -470,9 +470,9 @@
  * @param sess Session to create connection in
  * @param type Type of connection to create
  */
-faim_export aim_conn_t *aim_newconn(aim_session_t *sess, int type)
+faim_export OscarConnection *aim_newconn(OscarSession *sess, int type)
 {
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	if (!(conn = aim_conn_getnext(sess)))
 		return NULL;
@@ -492,9 +492,9 @@
  * @param conn Connection to look for.
  * @return Returns 1 if the passed connection is present, zero otherwise.
  */
-faim_export int aim_conn_in_sess(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_conn_in_sess(OscarSession *sess, OscarConnection *conn)
 {
-	aim_conn_t *cur;
+	OscarConnection *cur;
 
 	for (cur = sess->connlist; cur; cur = cur->next) {
 		if (cur == conn)
@@ -518,7 +518,7 @@
  * @param newval Number of seconds to force between transmits.
  * @return Returns -1 if the connection does not exist, zero otherwise.
  */
-faim_export int aim_conn_setlatency(aim_conn_t *conn, int newval)
+faim_export int aim_conn_setlatency(OscarConnection *conn, int newval)
 {
 
 	if (!conn)
@@ -532,18 +532,18 @@
 
 /**
  * Initializes a session structure by setting the initial values
- * stuff in the aim_session_t struct.
+ * stuff in the OscarSession struct.
  *
  * @param sess Session to initialize.
  * @param nonblocking Set to true if you want connections to be non-blocking.
  */
-faim_export void aim_session_init(aim_session_t *sess, guint8 nonblocking)
+faim_export void aim_session_init(OscarSession *sess, guint8 nonblocking)
 {
 
 	if (!sess)
 		return;
 
-	memset(sess, 0, sizeof(aim_session_t));
+	memset(sess, 0, sizeof(OscarSession));
 	aim_connrst(sess);
 	sess->queue_outgoing = NULL;
 	sess->queue_incoming = NULL;
@@ -611,7 +611,7 @@
  *
  * @param sess Session to kill
  */
-faim_export void aim_session_kill(aim_session_t *sess)
+faim_export void aim_session_kill(OscarSession *sess)
 {
 	aim_cleansnacs(sess, -1);
 
@@ -630,7 +630,7 @@
  *         connecting (or if it just completed and
  *         aim_conn_completeconnect() has yet to be called on it).
  */
-faim_export int aim_conn_isconnecting(aim_conn_t *conn)
+faim_export int aim_conn_isconnecting(OscarConnection *conn)
 {
 
 	if (!conn)
@@ -642,7 +642,7 @@
 /*
  * XXX this is nearly as ugly as proxyconnect().
  */
-faim_export int aim_conn_completeconnect(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_conn_completeconnect(OscarSession *sess, OscarConnection *conn)
 {
 	aim_rxcallback_t userfunc;
 
@@ -665,13 +665,13 @@
 	return 0;
 }
 
-faim_export aim_session_t *aim_conn_getsess(aim_conn_t *conn)
+faim_export OscarSession *aim_conn_getsess(OscarConnection *conn)
 {
 
 	if (!conn)
 		return NULL;
 
-	return (aim_session_t *)conn->sessv;
+	return (OscarSession *)conn->sessv;
 }
 
 /**
@@ -680,7 +680,7 @@
  * @param sess The session.
  * @return Zero.
  */
-faim_export int aim_logoff(aim_session_t *sess)
+faim_export int aim_logoff(OscarSession *sess)
 {
 	aim_connrst(sess);  /* in case we want to connect again */
 
@@ -691,9 +691,9 @@
  * No-op.  This sends an empty channel 5 SNAC.  WinAIM 4.x and higher
  * sends these _every minute_ to keep the connection alive.
  */
-faim_export int aim_flap_nop(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_flap_nop(OscarSession *sess, OscarConnection *conn)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 
 	if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x05, 0)))
 		return -ENOMEM;
--- a/src/protocols/oscar/family_admin.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_admin.c	Sun Feb 12 16:02:05 2006 +0000
@@ -37,9 +37,9 @@
  * 0x0013 - Unknown
  *
  */
-faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, guint16 info)
+faim_export int aim_admin_getinfo(OscarSession *sess, OscarConnection *conn, guint16 info)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 14)))
@@ -63,7 +63,7 @@
  * an information change (subtype 0x0004).
  *
  */
-static int infochange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int infochange(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_rxcallback_t userfunc;
 	char *url=NULL, *sn=NULL, *email=NULL;
@@ -117,9 +117,9 @@
  * Subtype 0x0004 - Set screenname formatting.
  *
  */
-faim_export int aim_admin_setnick(aim_session_t *sess, aim_conn_t *conn, const char *newnick)
+faim_export int aim_admin_setnick(OscarSession *sess, OscarConnection *conn, const char *newnick)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 
@@ -144,9 +144,9 @@
  * Subtype 0x0004 - Change password.
  *
  */
-faim_export int aim_admin_changepasswd(aim_session_t *sess, aim_conn_t *conn, const char *newpw, const char *curpw)
+faim_export int aim_admin_changepasswd(OscarSession *sess, OscarConnection *conn, const char *newpw, const char *curpw)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_tlvlist_t *tl = NULL;
 	aim_snacid_t snacid;
 
@@ -174,9 +174,9 @@
  * Subtype 0x0004 - Change email address.
  *
  */
-faim_export int aim_admin_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail)
+faim_export int aim_admin_setemail(OscarSession *sess, OscarConnection *conn, const char *newemail)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 
@@ -204,7 +204,7 @@
  * get the TRIAL flag removed from your account.
  *
  */
-faim_export int aim_admin_reqconfirm(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_admin_reqconfirm(OscarSession *sess, OscarConnection *conn)
 {
 	return aim_genericreq_n(sess, conn, 0x0007, 0x0006);
 }
@@ -213,7 +213,7 @@
  * Subtype 0x0007 - Account confirmation request acknowledgement.
  *
  */
-static int accountconfirm(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int accountconfirm(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -231,7 +231,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if ((snac->subtype == 0x0003) || (snac->subtype == 0x0005))
@@ -242,7 +242,7 @@
 	return 0;
 }
 
-faim_internal int admin_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int admin_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0007;
--- a/src/protocols/oscar/family_advert.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_advert.c	Sun Feb 12 16:02:05 2006 +0000
@@ -25,17 +25,17 @@
 
 #include "oscar.h"
 
-faim_export int aim_ads_requestads(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_ads_requestads(OscarSession *sess, OscarConnection *conn)
 {
 	return aim_genericreq_n(sess, conn, 0x0005, 0x0002);
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	return 0;
 }
 
-faim_internal int adverts_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int adverts_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0005;
--- a/src/protocols/oscar/family_alert.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_alert.c	Sun Feb 12 16:02:05 2006 +0000
@@ -37,10 +37,10 @@
  * @param conn The email connection for this session.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_email_sendcookies(aim_session_t *sess)
+faim_export int aim_email_sendcookies(OscarSession *sess)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_ALERT)))
@@ -92,7 +92,7 @@
  * this is just a periodic status update, this will also contain
  * the number of unread emails that you have.
  */
-static int parseinfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parseinfo(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -168,10 +168,10 @@
  * @param conn The email connection for this session.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_email_activate(aim_session_t *sess)
+faim_export int aim_email_activate(OscarSession *sess)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_ALERT)))
@@ -195,7 +195,7 @@
 	return 0;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0007)
@@ -204,7 +204,7 @@
 	return 0;
 }
 
-static void email_shutdown(aim_session_t *sess, aim_module_t *mod)
+static void email_shutdown(OscarSession *sess, aim_module_t *mod)
 {
 	while (sess->emailinfo) {
 		struct aim_emailinfo *tmp = sess->emailinfo;
@@ -219,7 +219,7 @@
 	return;
 }
 
-faim_internal int email_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int email_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0018;
--- a/src/protocols/oscar/family_auth.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_auth.c	Sun Feb 12 16:02:05 2006 +0000
@@ -123,9 +123,9 @@
  * connections.  The FLAP version is also sent before the cookie when connecting
  * for other services (BOS, chatnav, chat, etc.).
  */
-faim_export int aim_sendflapver(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_sendflapver(OscarSession *sess, OscarConnection *conn)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 
 	if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x01, 4)))
 		return -ENOMEM;
@@ -145,9 +145,9 @@
  * be the first thing you send.
  *
  */
-faim_export int aim_sendcookie(aim_session_t *sess, aim_conn_t *conn, const guint16 length, const guint8 *chipsahoy)
+faim_export int aim_sendcookie(OscarSession *sess, OscarConnection *conn, const guint16 length, const guint8 *chipsahoy)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_tlvlist_t *tl = NULL;
 
 	if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x01, 4+2+2+length)))
@@ -167,9 +167,9 @@
 /*
  * Part two of the ICQ hack.  Note the ignoring of the key.
  */
-static int goddamnicq2(aim_session_t *sess, aim_conn_t *conn, const char *sn, const char *password, struct client_info_s *ci)
+static int goddamnicq2(OscarSession *sess, OscarConnection *conn, const char *sn, const char *password, ClientInfo *ci)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_tlvlist_t *tl = NULL;
 	int passwdlen;
 	guint8 *password_encoded;
@@ -230,7 +230,7 @@
  *   point = (not sent)
  *   build  = 0x0013
  *   unknown= (not sent)
- *   
+ *
  * AIM for Linux 1.1.112:
  *   clientstring = "AOL Instant Messenger (SM)"
  *   clientid = 0x1d09
@@ -242,9 +242,9 @@
  *   serverstore = 0x01
  *
  */
-faim_export int aim_send_login(aim_session_t *sess, aim_conn_t *conn, const char *sn, const char *password, struct client_info_s *ci, const char *key)
+faim_export int aim_send_login(OscarSession *sess, OscarConnection *conn, const char *sn, const char *password, ClientInfo *ci, const char *key)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_tlvlist_t *tl = NULL;
 	guint8 digest[16];
 	aim_snacid_t snacid;
@@ -319,7 +319,7 @@
  * The client should check the value passed as errorcode. If
  * its nonzero, there was an error.
  */
-static int parse(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parse(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_tlvlist_t *tlvlist;
 	aim_rxcallback_t userfunc;
@@ -489,9 +489,9 @@
  * being called from the context of aim_rxdispatch()...
  *
  */
-static int goddamnicq(aim_session_t *sess, aim_conn_t *conn, const char *sn)
+static int goddamnicq(OscarSession *sess, OscarConnection *conn, const char *sn)
 {
-	aim_frame_t fr;
+	FlapFrame fr;
 	aim_rxcallback_t userfunc;
 
 	fr.conn = conn;
@@ -513,9 +513,9 @@
  * login command (0017/0002). 
  *
  */
-faim_export int aim_request_login(aim_session_t *sess, aim_conn_t *conn, const char *sn)
+faim_export int aim_request_login(OscarSession *sess, OscarConnection *conn, const char *sn)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 
@@ -560,7 +560,7 @@
  * Calls the client, which should then use the value to call aim_send_login.
  *
  */
-static int keyparse(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int keyparse(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int keylen, ret = 1;
 	aim_rxcallback_t userfunc;
@@ -586,7 +586,7 @@
  *
  * Receive SecurID request.
  */
-static int got_securid_request(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int got_securid_request(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -602,10 +602,10 @@
  *
  * Send SecurID response.
  */
-faim_export int aim_auth_securid_send(aim_session_t *sess, const char *securid)
+faim_export int aim_auth_securid_send(OscarSession *sess, const char *securid)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int len;
 
@@ -628,7 +628,7 @@
 	return 0;
 }
 
-static void auth_shutdown(aim_session_t *sess, aim_module_t *mod)
+static void auth_shutdown(OscarSession *sess, aim_module_t *mod)
 {
 	if (sess->authinfo) {
 		free(sess->authinfo->sn);
@@ -646,7 +646,7 @@
 	}
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0003)
@@ -659,7 +659,7 @@
 	return 0;
 }
 
-faim_internal int auth_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int auth_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0017;
--- a/src/protocols/oscar/family_bart.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_bart.c	Sun Feb 12 16:02:05 2006 +0000
@@ -37,10 +37,10 @@
  * @param iconlen Length of the raw data of the icon image file.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_bart_upload(aim_session_t *sess, const guint8 *icon, guint16 iconlen)
+faim_export int aim_bart_upload(OscarSession *sess, const guint8 *icon, guint16 iconlen)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0010)) || !icon || !iconlen)
@@ -68,7 +68,7 @@
  *
  * You get this honky after you upload a buddy icon.
  */
-static int uploadack(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int uploadack(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -95,10 +95,10 @@
  * @param iconcsumlen Length of the MD5 checksum given above.  Should be 10 bytes.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_bart_request(aim_session_t *sess, const char *sn, guint8 iconcsumtype, const guint8 *iconcsum, guint16 iconcsumlen)
+faim_export int aim_bart_request(OscarSession *sess, const char *sn, guint8 iconcsumtype, const guint8 *iconcsum, guint16 iconcsumlen)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0010)) || !sn || !strlen(sn) || !iconcsum || !iconcsumlen)
@@ -132,7 +132,7 @@
  *
  * This is sent in response to a buddy icon request.
  */
-static int parseicon(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parseicon(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -158,7 +158,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0003)
@@ -169,7 +169,7 @@
 	return 0;
 }
 
-faim_internal int bart_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int bart_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0010;
--- a/src/protocols/oscar/family_bos.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_bos.c	Sun Feb 12 16:02:05 2006 +0000
@@ -29,13 +29,13 @@
 #include <string.h>
 
 /* Subtype 0x0002 - Request BOS rights. */
-faim_export int aim_bos_reqrights(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_bos_reqrights(OscarSession *sess, OscarConnection *conn)
 {
 	return aim_genericreq_n_snacid(sess, conn, 0x0009, 0x0002);
 }
 
 /* Subtype 0x0003 - BOS Rights. */
-static int rights(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int rights(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_rxcallback_t userfunc;
 	aim_tlvlist_t *tlvlist;
@@ -77,7 +77,7 @@
  * a bitwise OR of all the user classes you want to see you.
  *
  */
-faim_export int aim_bos_setgroupperm(aim_session_t *sess, aim_conn_t *conn, guint32 mask)
+faim_export int aim_bos_setgroupperm(OscarSession *sess, OscarConnection *conn, guint32 mask)
 {
 	return aim_genericreq_l(sess, conn, 0x0009, 0x0004, &mask);
 }
@@ -110,9 +110,9 @@
  *
  * XXX ye gods.
  */
-faim_export int aim_bos_changevisibility(aim_session_t *sess, aim_conn_t *conn, int changetype, const char *denylist)
+faim_export int aim_bos_changevisibility(OscarSession *sess, OscarConnection *conn, int changetype, const char *denylist)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	int packlen = 0;
 	guint16 subtype;
 	char *localcpy = NULL, *tmpptr = NULL;
@@ -162,7 +162,7 @@
 	return 0;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0003)
@@ -171,7 +171,7 @@
 	return 0;
 }
 
-faim_internal int bos_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int bos_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0009;
--- a/src/protocols/oscar/family_buddy.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_buddy.c	Sun Feb 12 16:02:05 2006 +0000
@@ -33,7 +33,7 @@
  * Request Buddy List rights.
  *
  */
-faim_export int aim_buddylist_reqrights(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_buddylist_reqrights(OscarSession *sess, OscarConnection *conn)
 {
 	return aim_genericreq_n_snacid(sess, conn, 0x0003, 0x0002);
 }
@@ -42,7 +42,7 @@
  * Subtype 0x0003 - Rights.
  *
  */
-static int rights(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int rights(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_rxcallback_t userfunc;
 	aim_tlvlist_t *tlvlist;
@@ -92,9 +92,9 @@
  * XXX This should just be an extension of setbuddylist()
  *
  */
-faim_export int aim_buddylist_addbuddy(aim_session_t *sess, aim_conn_t *conn, const char *sn)
+faim_export int aim_buddylist_addbuddy(OscarSession *sess, OscarConnection *conn, const char *sn)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sn || !strlen(sn))
@@ -124,9 +124,9 @@
  * XXX Clean this up.
  *
  */
-faim_export int aim_buddylist_set(aim_session_t *sess, aim_conn_t *conn, const char *buddy_list)
+faim_export int aim_buddylist_set(OscarSession *sess, OscarConnection *conn, const char *buddy_list)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int len = 0;
 	char *localcpy = NULL;
@@ -172,9 +172,9 @@
  * the same as setbuddylist() but with a different snac subtype).
  *
  */
-faim_export int aim_buddylist_removebuddy(aim_session_t *sess, aim_conn_t *conn, const char *sn)
+faim_export int aim_buddylist_removebuddy(OscarSession *sess, OscarConnection *conn, const char *sn)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sn || !strlen(sn))
@@ -200,9 +200,9 @@
  * XXX Why would we send this?
  *
  */
-faim_export int aim_buddylist_oncoming(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *info)
+faim_export int aim_buddylist_oncoming(OscarSession *sess, OscarConnection *conn, aim_userinfo_t *info)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !conn || !info)
@@ -227,9 +227,9 @@
  * XXX Why would we send this?
  *
  */
-faim_export int aim_buddylist_offgoing(aim_session_t *sess, aim_conn_t *conn, const char *sn)
+faim_export int aim_buddylist_offgoing(OscarSession *sess, OscarConnection *conn, const char *sn)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !conn || !sn)
@@ -260,7 +260,7 @@
  * it is still in a format parsable by aim_info_extract().
  *
  */
-static int buddychange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int buddychange(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_userinfo_t userinfo;
@@ -278,7 +278,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0003)
@@ -289,7 +289,7 @@
 	return 0;
 }
 
-faim_internal int buddylist_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int buddylist_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0003;
--- a/src/protocols/oscar/family_chat.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_chat.c	Sun Feb 12 16:02:05 2006 +0000
@@ -34,7 +34,7 @@
 	guint16 instance;
 };
 
-faim_internal void aim_conn_kill_chat(aim_session_t *sess, aim_conn_t *conn)
+faim_internal void aim_conn_kill_chat(OscarSession *sess, OscarConnection *conn)
 {
 	struct chatconnpriv *ccp = (struct chatconnpriv *)conn->internal;
 
@@ -45,7 +45,7 @@
 	return;
 }
 
-faim_export char *aim_chat_getname(aim_conn_t *conn)
+faim_export char *aim_chat_getname(OscarConnection *conn)
 {
 	struct chatconnpriv *ccp;
 
@@ -61,9 +61,9 @@
 }
 
 /* XXX get this into conn.c -- evil!! */
-faim_export aim_conn_t *aim_chat_getconn(aim_session_t *sess, const char *name)
+faim_export OscarConnection *aim_chat_getconn(OscarSession *sess, const char *name)
 {
-	aim_conn_t *cur;
+	OscarConnection *cur;
 
 	for (cur = sess->connlist; cur; cur = cur->next) {
 		struct chatconnpriv *ccp = (struct chatconnpriv *)cur->internal;
@@ -82,7 +82,7 @@
 	return cur;
 }
 
-faim_export int aim_chat_attachname(aim_conn_t *conn, guint16 exchange, const char *roomname, guint16 instance)
+faim_export int aim_chat_attachname(OscarConnection *conn, guint16 exchange, const char *roomname, guint16 instance)
 {
 	struct chatconnpriv *ccp;
 
@@ -104,7 +104,7 @@
 	return 0;
 }
 
-faim_internal int aim_chat_readroominfo(aim_bstream_t *bs, struct aim_chat_roominfo *outinfo)
+faim_internal int aim_chat_readroominfo(ByteStream *bs, struct aim_chat_roominfo *outinfo)
 {
 	int namelen;
 
@@ -119,9 +119,9 @@
 	return 0;
 }
 
-faim_export int aim_chat_leaveroom(aim_session_t *sess, const char *name)
+faim_export int aim_chat_leaveroom(OscarSession *sess, const char *name)
 {
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	if (!(conn = aim_chat_getconn(sess, name)))
 		return -ENOENT;
@@ -139,7 +139,7 @@
  *	- Language (English)
  *
  */
-static int infoupdate(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int infoupdate(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_userinfo_t *userinfo = NULL;
 	aim_rxcallback_t userfunc;
@@ -190,7 +190,7 @@
 	if (aim_tlv_gettlv(tlvlist, 0x0073, 1)) {
 		int curoccupant = 0;
 		aim_tlv_t *tmptlv;
-		aim_bstream_t occbs;
+		ByteStream occbs;
 
 		tmptlv = aim_tlv_gettlv(tlvlist, 0x0073, 1);
 
@@ -314,7 +314,7 @@
 }
 
 /* Subtypes 0x0003 and 0x0004 */
-static int userlistchange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int userlistchange(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_userinfo_t *userinfo = NULL;
 	aim_rxcallback_t userfunc;
@@ -347,11 +347,11 @@
  *
  * XXX convert this to use tlvchains
  */
-faim_export int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, guint16 flags, const gchar *msg, int msglen, const char *encoding, const char *language)
+faim_export int aim_chat_send_im(OscarSession *sess, OscarConnection *conn, guint16 flags, const gchar *msg, int msglen, const char *encoding, const char *language)
 {
 	int i;
-	aim_frame_t *fr;
-	aim_msgcookie_t *cookie;
+	FlapFrame *fr;
+	IcbmCookie *cookie;
 	aim_snacid_t snacid;
 	guint8 ckstr[8];
 	aim_tlvlist_t *otl = NULL, *itl = NULL;
@@ -461,7 +461,7 @@
  *       possibly others
  *
  */
-static int incomingim_ch3(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int incomingim_ch3(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0, i;
 	aim_rxcallback_t userfunc;
@@ -472,7 +472,7 @@
 	char *msg = NULL;
 	int len = 0;
 	char *encoding = NULL, *language = NULL;
-	aim_msgcookie_t *ck;
+	IcbmCookie *ck;
 
 	memset(&userinfo, 0, sizeof(aim_userinfo_t));
 
@@ -510,7 +510,7 @@
 	 */
 	if (aim_tlv_gettlv(otl, 0x0003, 1)) {
 		aim_tlv_t *userinfotlv;
-		aim_bstream_t tbs;
+		ByteStream tbs;
 
 		userinfotlv = aim_tlv_gettlv(otl, 0x0003, 1);
 
@@ -534,7 +534,7 @@
 	if (aim_tlv_gettlv(otl, 0x0005, 1)) {
 		aim_tlvlist_t *itl;
 		aim_tlv_t *msgblock;
-		aim_bstream_t tbs;
+		ByteStream tbs;
 
 		msgblock = aim_tlv_gettlv(otl, 0x0005, 1);
 		aim_bstream_init(&tbs, msgblock->value, msgblock->length);
@@ -573,7 +573,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0002)
@@ -586,7 +586,7 @@
 	return 0;
 }
 
-faim_internal int chat_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int chat_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x000e;
--- a/src/protocols/oscar/family_chatnav.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_chatnav.c	Sun Feb 12 16:02:05 2006 +0000
@@ -35,7 +35,7 @@
  * conn must be a chatnav connection!
  *
  */
-faim_export int aim_chatnav_reqrights(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_chatnav_reqrights(OscarSession *sess, OscarConnection *conn)
 {
 	return aim_genericreq_n_snacid(sess, conn, 0x000d, 0x0002);
 }
@@ -43,12 +43,12 @@
 /*
  * Subtype 0x0008
  */
-faim_export int aim_chatnav_createroom(aim_session_t *sess, aim_conn_t *conn, const char *name, guint16 exchange)
+faim_export int aim_chatnav_createroom(OscarSession *sess, OscarConnection *conn, const char *name, guint16 exchange)
 {
 	static const char ck[] = {"create"};
 	static const char lang[] = {"en"};
 	static const char charset[] = {"us-ascii"};
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 
@@ -101,7 +101,7 @@
 	return 0;
 }
 
-static int parseinfo_perms(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs, aim_snac_t *snac2)
+static int parseinfo_perms(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs, aim_snac_t *snac2)
 {
 	aim_rxcallback_t userfunc;
 	int ret = 0;
@@ -127,7 +127,7 @@
 	 * 
 	 */
 	for (curexchange = 0; ((exchangetlv = aim_tlv_gettlv(tlvlist, 0x0003, curexchange+1))); ) {
-		aim_bstream_t tbs;
+		ByteStream tbs;
 
 		aim_bstream_init(&tbs, exchangetlv->value, exchangetlv->length);
 
@@ -312,7 +312,7 @@
 	return ret;
 }
 
-static int parseinfo_create(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs, aim_snac_t *snac2)
+static int parseinfo_create(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs, aim_snac_t *snac2)
 {
 	aim_rxcallback_t userfunc;
 	aim_tlvlist_t *tlvlist, *innerlist;
@@ -323,7 +323,7 @@
 	int cklen;
 	aim_tlv_t *bigblock;
 	int ret = 0;
-	aim_bstream_t bbbs;
+	ByteStream bbbs;
 
 	tlvlist = aim_tlvlist_read(bs);
 
@@ -404,7 +404,7 @@
  * the room yields no different a response than requesting the room's info.
  *
  */
-static int parseinfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parseinfo(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_snac_t *snac2;
 	int ret = 0;
@@ -446,7 +446,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0009)
@@ -455,7 +455,7 @@
 	return 0;
 }
 
-faim_internal int chatnav_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int chatnav_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x000d;
--- a/src/protocols/oscar/family_feedbag.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_feedbag.c	Sun Feb 12 16:02:05 2006 +0000
@@ -473,7 +473,7 @@
  * @param sess The oscar session.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-static int aim_ssi_sync(aim_session_t *sess)
+static int aim_ssi_sync(OscarSession *sess)
 {
 	struct aim_ssi_item *cur1, *cur2;
 	struct aim_ssi_tmp *cur, *new;
@@ -576,7 +576,7 @@
  * @param sess The oscar session.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-static int aim_ssi_freelist(aim_session_t *sess)
+static int aim_ssi_freelist(OscarSession *sess)
 {
 	struct aim_ssi_item *cur, *del;
 	struct aim_ssi_tmp *curtmp, *deltmp;
@@ -621,7 +621,7 @@
  * @param sess The oscar session.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_deletelist(aim_session_t *sess)
+faim_export int aim_ssi_deletelist(OscarSession *sess)
 {
 	struct aim_ssi_item *cur, *del;
 
@@ -654,7 +654,7 @@
  * @param sess The oscar session.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_cleanlist(aim_session_t *sess)
+faim_export int aim_ssi_cleanlist(OscarSession *sess)
 {
 	struct aim_ssi_item *cur, *next;
 
@@ -736,7 +736,7 @@
  * @param smsnum The locally assigned SMS number, or NULL.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_addbuddy(aim_session_t *sess, const char *name, const char *group, const char *alias, const char *comment, const char *smsnum, int needauth)
+faim_export int aim_ssi_addbuddy(OscarSession *sess, const char *name, const char *group, const char *alias, const char *comment, const char *smsnum, int needauth)
 {
 	struct aim_ssi_item *parent;
 	aim_tlvlist_t *data = NULL;
@@ -788,7 +788,7 @@
  * @param name The name of the item..
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_addpermit(aim_session_t *sess, const char *name)
+faim_export int aim_ssi_addpermit(OscarSession *sess, const char *name)
 {
 
 	if (!sess || !name)
@@ -810,7 +810,7 @@
  * @param name The name of the item..
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_adddeny(aim_session_t *sess, const char *name)
+faim_export int aim_ssi_adddeny(OscarSession *sess, const char *name)
 {
 
 	if (!sess || !name)
@@ -833,7 +833,7 @@
  * @param group The group of the item, or NULL.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_delbuddy(aim_session_t *sess, const char *name, const char *group)
+faim_export int aim_ssi_delbuddy(OscarSession *sess, const char *name, const char *group)
 {
 	struct aim_ssi_item *del;
 
@@ -876,7 +876,7 @@
  * @param name The name of the item, or NULL.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_delpermit(aim_session_t *sess, const char *name)
+faim_export int aim_ssi_delpermit(OscarSession *sess, const char *name)
 {
 	struct aim_ssi_item *del;
 
@@ -903,7 +903,7 @@
  * @param name The name of the item, or NULL.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_deldeny(aim_session_t *sess, const char *name)
+faim_export int aim_ssi_deldeny(OscarSession *sess, const char *name)
 {
 	struct aim_ssi_item *del;
 
@@ -933,7 +933,7 @@
  * @param sn The name of the buddy to be moved.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_movebuddy(aim_session_t *sess, const char *oldgn, const char *newgn, const char *sn)
+faim_export int aim_ssi_movebuddy(OscarSession *sess, const char *oldgn, const char *newgn, const char *sn)
 {
 	char *alias = aim_ssi_getalias(sess->ssi.local, oldgn, sn);
 	aim_ssi_addbuddy(sess, sn, newgn, alias, NULL, NULL, aim_ssi_waitingforauth(sess->ssi.local, oldgn, sn));
@@ -952,7 +952,7 @@
  *        a buddy's comment.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_aliasbuddy(aim_session_t *sess, const char *gn, const char *sn, const char *alias)
+faim_export int aim_ssi_aliasbuddy(OscarSession *sess, const char *gn, const char *sn, const char *alias)
 {
 	struct aim_ssi_item *tmp;
 
@@ -984,7 +984,7 @@
  *        a buddy's comment.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_editcomment(aim_session_t *sess, const char *gn, const char *sn, const char *comment)
+faim_export int aim_ssi_editcomment(OscarSession *sess, const char *gn, const char *sn, const char *comment)
 {
 	struct aim_ssi_item *tmp;
 
@@ -1014,7 +1014,7 @@
  * @param newgn The new group name.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_rename_group(aim_session_t *sess, const char *oldgn, const char *newgn)
+faim_export int aim_ssi_rename_group(OscarSession *sess, const char *oldgn, const char *newgn)
 {
 	struct aim_ssi_item *group;
 
@@ -1048,7 +1048,7 @@
  *        visible.  See the AIM_FLAG_BLEH #defines in oscar.h
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_setpermdeny(aim_session_t *sess, guint8 permdeny, guint32 vismask)
+faim_export int aim_ssi_setpermdeny(OscarSession *sess, guint8 permdeny, guint32 vismask)
 {
 	struct aim_ssi_item *tmp;
 
@@ -1079,7 +1079,7 @@
  * @param iconcsumlen Length of the MD5 checksum given above.  Should be 0x10 bytes.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_seticon(aim_session_t *sess, guint8 *iconsum, guint16 iconsumlen)
+faim_export int aim_ssi_seticon(OscarSession *sess, guint8 *iconsum, guint16 iconsumlen)
 {
 	struct aim_ssi_item *tmp;
 	guint8 *csumdata;
@@ -1116,7 +1116,7 @@
  * @param sess The oscar session.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_delicon(aim_session_t *sess)
+faim_export int aim_ssi_delicon(OscarSession *sess)
 {
 	struct aim_ssi_item *tmp;
 
@@ -1142,7 +1142,7 @@
  *        0x00000400 - Allow others to see your idle time
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_ssi_setpresence(aim_session_t *sess, guint32 presence) {
+faim_export int aim_ssi_setpresence(OscarSession *sess, guint32 presence) {
 	struct aim_ssi_item *tmp;
 
 	if (!sess)
@@ -1164,9 +1164,9 @@
 /*
  * Subtype 0x0002 - Request SSI Rights.
  */
-faim_export int aim_ssi_reqrights(aim_session_t *sess)
+faim_export int aim_ssi_reqrights(OscarSession *sess)
 {
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_FEEDBAG)))
 		return -EINVAL;
@@ -1177,13 +1177,13 @@
 /*
  * Subtype 0x0003 - SSI Rights Information.
  */
-static int parserights(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parserights(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0, i;
 	aim_rxcallback_t userfunc;
 	aim_tlvlist_t *tlvlist;
 	aim_tlv_t *tlv;
-	aim_bstream_t bstream;
+	ByteStream bstream;
 	guint16 *maxitems;
 
 	/* This SNAC is made up of a bunch of TLVs */
@@ -1219,9 +1219,9 @@
  * revision number.
  * 
  */
-faim_export int aim_ssi_reqdata(aim_session_t *sess)
+faim_export int aim_ssi_reqdata(OscarSession *sess)
 {
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_FEEDBAG)))
 		return -EINVAL;
@@ -1242,10 +1242,10 @@
  * Note that the client should never increment the revision, only the server.
  * 
  */
-faim_export int aim_ssi_reqifchanged(aim_session_t *sess, time_t timestamp, guint16 numitems)
+faim_export int aim_ssi_reqifchanged(OscarSession *sess, time_t timestamp, guint16 numitems)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_FEEDBAG)))
@@ -1271,7 +1271,7 @@
 /*
  * Subtype 0x0006 - SSI Data.
  */
-static int parsedata(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parsedata(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1325,9 +1325,9 @@
  * settings into effect.
  * 
  */
-faim_export int aim_ssi_enable(aim_session_t *sess)
+faim_export int aim_ssi_enable(OscarSession *sess)
 {
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_FEEDBAG)))
 		return -EINVAL;
@@ -1343,10 +1343,10 @@
  * difference is the subtype that is set for the SNAC.
  * 
  */
-faim_export int aim_ssi_addmoddel(aim_session_t *sess)
+faim_export int aim_ssi_addmoddel(OscarSession *sess)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int snaclen;
 	struct aim_ssi_tmp *cur;
@@ -1393,7 +1393,7 @@
  * Sent by the server, for example, when someone is added to 
  * your "Recent Buddies" group.
  */
-static int parseadd(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parseadd(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1432,7 +1432,7 @@
  *
  * XXX - It would probably be good for the client to actually do something when it gets this.
  */
-static int parsemod(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parsemod(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1494,7 +1494,7 @@
  *
  * XXX - It would probably be good for the client to actually do something when it gets this.
  */
-static int parsedel(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parsedel(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1526,7 +1526,7 @@
  * Response to add, modify, or delete SNAC (sent with aim_ssi_addmoddel).
  *
  */
-static int parseack(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parseack(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1652,7 +1652,7 @@
  * posted local stamp/revision.
  *
  */
-static int parsedataunchanged(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parsedataunchanged(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1671,9 +1671,9 @@
  * Tells the server you're going to start modifying data.
  * 
  */
-faim_export int aim_ssi_modbegin(aim_session_t *sess)
+faim_export int aim_ssi_modbegin(OscarSession *sess)
 {
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_FEEDBAG)))
 		return -EINVAL;
@@ -1687,9 +1687,9 @@
  * Tells the server you're finished modifying data.
  *
  */
-faim_export int aim_ssi_modend(aim_session_t *sess)
+faim_export int aim_ssi_modend(OscarSession *sess)
 {
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_FEEDBAG)))
 		return -EINVAL;
@@ -1703,10 +1703,10 @@
  * Authorizes a contact so they can add you to their contact list.
  *
  */
-faim_export int aim_ssi_sendauth(aim_session_t *sess, char *sn, char *msg)
+faim_export int aim_ssi_sendauth(OscarSession *sess, char *sn, char *msg)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_FEEDBAG)) || !sn)
@@ -1740,7 +1740,7 @@
 /*
  * Subtype 0x0015 - Receive an authorization grant
  */
-static int receiveauthgrant(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int receiveauthgrant(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1778,10 +1778,10 @@
  * granted, denied, or dropped.
  *
  */
-faim_export int aim_ssi_sendauthrequest(aim_session_t *sess, char *sn, const char *msg)
+faim_export int aim_ssi_sendauthrequest(OscarSession *sess, char *sn, const char *msg)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_FEEDBAG)) || !sn)
@@ -1815,7 +1815,7 @@
 /*
  * Subtype 0x0019 - Receive an authorization request
  */
-static int receiveauthrequest(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int receiveauthrequest(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1856,10 +1856,10 @@
  * if reply=0x01 then grant
  *
  */
-faim_export int aim_ssi_sendauthreply(aim_session_t *sess, char *sn, guint8 reply, const char *msg)
+faim_export int aim_ssi_sendauthreply(OscarSession *sess, char *sn, guint8 reply, const char *msg)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_FEEDBAG)) || !sn)
@@ -1898,7 +1898,7 @@
  * You get this bad boy when other people respond to the authorization 
  * request that you have previously sent them.
  */
-static int receiveauthreply(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int receiveauthreply(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1936,7 +1936,7 @@
 /*
  * Subtype 0x001c - Receive a message telling you someone added you to their list.
  */
-static int receiveadded(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int receiveadded(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1957,7 +1957,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == OSCAR_SUBTYPE_FEEDBAG_RIGHTSINFO)
@@ -1986,12 +1986,12 @@
 	return 0;
 }
 
-static void ssi_shutdown(aim_session_t *sess, aim_module_t *mod)
+static void ssi_shutdown(OscarSession *sess, aim_module_t *mod)
 {
 	aim_ssi_freelist(sess);
 }
 
-faim_internal int ssi_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int ssi_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = OSCAR_FAMILY_FEEDBAG;
--- a/src/protocols/oscar/family_icbm.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_icbm.c	Sun Feb 12 16:02:05 2006 +0000
@@ -63,7 +63,7 @@
  * @param sn Null-terminated scrizeen nizame.
  * @return The number of bytes written.  It's really not useful.
  */
-static int aim_im_puticbm(aim_bstream_t *bs, const guchar *c, guint16 channel, const char *sn)
+static int aim_im_puticbm(ByteStream *bs, const guchar *c, guint16 channel, const char *sn)
 {
 	aimbs_putraw(bs, c, 8);
 	aimbs_put16(bs, channel);
@@ -157,10 +157,10 @@
  * with the rather unreasonable defaults.
  *
  */
-faim_export int aim_im_setparams(aim_session_t *sess, struct aim_icbmparameters *params)
+faim_export int aim_im_setparams(OscarSession *sess, struct aim_icbmparameters *params)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0004)))
@@ -194,9 +194,9 @@
  * Subtype 0x0004 - Request ICBM parameter information.
  *
  */
-faim_export int aim_im_reqparams(aim_session_t *sess)
+faim_export int aim_im_reqparams(OscarSession *sess)
 {
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0004)))
 		return -EINVAL;
@@ -208,7 +208,7 @@
  * Subtype 0x0005 - Receive parameter information.
  *
  */
-static int aim_im_paraminfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int aim_im_paraminfo(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_rxcallback_t userfunc;
 	struct aim_icbmparameters params;
@@ -267,10 +267,10 @@
  * XXX - check SNAC size for multipart
  *
  */
-faim_export int aim_im_sendch1_ext(aim_session_t *sess, struct aim_sendimext_args *args)
+faim_export int aim_im_sendch1_ext(OscarSession *sess, struct aim_sendimext_args *args)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	guchar cookie[8];
 	int msgtlvlen;
@@ -425,7 +425,7 @@
  * that requires an explicit message length.  Use aim_im_sendch1_ext().
  *
  */
-faim_export int aim_im_sendch1(aim_session_t *sess, const char *sn, guint16 flags, const char *msg)
+faim_export int aim_im_sendch1(OscarSession *sess, const char *sn, guint16 flags, const char *msg)
 {
 	struct aim_sendimext_args args;
 
@@ -445,18 +445,18 @@
 /*
  * Subtype 0x0006 - Send a chat invitation.
  */
-faim_export int aim_im_sendch2_chatinvite(aim_session_t *sess, const char *sn, const char *msg, guint16 exchange, const char *roomname, guint16 instance)
+faim_export int aim_im_sendch2_chatinvite(OscarSession *sess, const char *sn, const char *msg, guint16 exchange, const char *roomname, guint16 instance)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
-	aim_msgcookie_t *msgcookie;
+	IcbmCookie *msgcookie;
 	struct aim_invite_priv *priv;
 	guchar cookie[8];
 	aim_tlvlist_t *otl = NULL, *itl = NULL;
 	guint8 *hdr;
 	int hdrlen;
-	aim_bstream_t hdrbs;
+	ByteStream hdrbs;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0004)))
 		return -EINVAL;
@@ -531,10 +531,10 @@
  * This is also performance sensitive. (If you can believe it...)
  *
  */
-faim_export int aim_im_sendch2_icon(aim_session_t *sess, const char *sn, const guint8 *icon, int iconlen, time_t stamp, guint16 iconsum)
+faim_export int aim_im_sendch2_icon(OscarSession *sess, const char *sn, const guint8 *icon, int iconlen, time_t stamp, guint16 iconsum)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	guchar cookie[8];
 
@@ -610,10 +610,10 @@
  * make an interface similar to what AOL actually uses.  But I'm not using COM.
  *
  */
-faim_export int aim_im_sendch2_rtfmsg(aim_session_t *sess, struct aim_sendrtfmsg_args *args)
+faim_export int aim_im_sendch2_rtfmsg(OscarSession *sess, struct aim_sendrtfmsg_args *args)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	guchar cookie[8];
 	const char rtfcap[] = {"{97B12751-243C-4334-AD22-D6ABF73F1492}"}; /* AIM_CAPS_ICQRTF capability in string form */
@@ -692,16 +692,16 @@
  * Subtype 0x0006 - Send an "I want to directly connect to you" message
  *
  */
-faim_export int aim_im_sendch2_odcrequest(aim_session_t *sess, guchar *usercookie, gboolean usecookie, const char *sn, const guint8 *ip, guint16 port)
+faim_export int aim_im_sendch2_odcrequest(OscarSession *sess, guchar *usercookie, gboolean usecookie, const char *sn, const guint8 *ip, guint16 port)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	guchar cookie[8];
 	aim_tlvlist_t *tl = NULL, *itl = NULL;
 	int hdrlen;
 	guint8 *hdr;
-	aim_bstream_t hdrbs;
+	ByteStream hdrbs;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0004)))
 		return -EINVAL;
@@ -768,10 +768,10 @@
  * Subtype 0x0006 - Send an "I want to send you this file" message
  *
  */
-faim_export int aim_im_sendch2_sendfile_ask(aim_session_t *sess, struct aim_oft_info *oft_info)
+faim_export int aim_im_sendch2_sendfile_ask(OscarSession *sess, PeerInfo *oft_info)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl=NULL, *subtl=NULL;
 
@@ -783,7 +783,7 @@
 	{ /* Create the subTLV chain */
 		guint8 *buf;
 		int buflen;
-		aim_bstream_t bs;
+		ByteStream bs;
 		guint8 ip[4];
 		guint8 ip_comp[4]; /* The bitwise complement of the ip */
 		char *nexttoken;
@@ -885,7 +885,7 @@
 	{ /* Create the main TLV chain */
 		guint8 *buf;
 		int buflen;
-		aim_bstream_t bs;
+		ByteStream bs;
 
 		/* TLV t(0005) - Encompasses everything from above. Gee. */
 		buflen = 2+8+16+aim_tlvlist_size(&subtl);
@@ -926,10 +926,10 @@
  *
  * @param rendid Capability type (AIM_CAPS_GETFILE or AIM_CAPS_SENDFILE)
  */
-faim_export int aim_im_sendch2_sendfile_accept(aim_session_t *sess, struct aim_oft_info *oft_info)
+faim_export int aim_im_sendch2_sendfile_accept(OscarSession *sess, PeerInfo *oft_info)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0004)) || !oft_info)
@@ -959,10 +959,10 @@
  * Subtype 0x0006 - Send a "cancel this file transfer" message?
  *
  */
-faim_export int aim_im_sendch2_sendfile_cancel(aim_session_t *sess, struct aim_oft_info *oft_info)
+faim_export int aim_im_sendch2_sendfile_cancel(OscarSession *sess, PeerInfo *oft_info)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0004)) || !oft_info)
@@ -997,10 +997,10 @@
  *        state of the user, as one of the AIM_ICQ_STATE_* defines.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_im_sendch2_geticqaway(aim_session_t *sess, const char *sn, int type)
+faim_export int aim_im_sendch2_geticqaway(OscarSession *sess, const char *sn, int type)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	guchar cookie[8];
 
@@ -1100,10 +1100,10 @@
  * @param message The message you want to send, it should be null terminated.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_im_sendch4(aim_session_t *sess, const char *sn, guint16 type, const char *message)
+faim_export int aim_im_sendch4(OscarSession *sess, const char *sn, guint16 type, const char *message)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	guchar cookie[8];
 
@@ -1158,7 +1158,7 @@
 /*
  * XXX - I don't see when this would ever get called...
  */
-static int outgoingim(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int outgoingim(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1194,7 +1194,7 @@
 		icbmflags |= AIM_IMFLAGS_AWAY;
 
 	if ((msgblock = aim_tlv_gettlv(tlvlist, 0x0002, 1))) {
-		aim_bstream_t mbs;
+		ByteStream mbs;
 		int featurelen, msglen;
 
 		aim_bstream_init(&mbs, msgblock->value, msgblock->length);
@@ -1260,7 +1260,7 @@
  * know what you are doing, and/or you have something neat to do with it.
  *
  */
-faim_export int aim_mpmsg_init(aim_session_t *sess, aim_mpmsg_t *mpm)
+faim_export int aim_mpmsg_init(OscarSession *sess, aim_mpmsg_t *mpm)
 {
 
 	memset(mpm, 0, sizeof(aim_mpmsg_t));
@@ -1268,7 +1268,7 @@
 	return 0;
 }
 
-static int mpmsg_addsection(aim_session_t *sess, aim_mpmsg_t *mpm, guint16 charset, guint16 charsubset, gchar *data, guint16 datalen)
+static int mpmsg_addsection(OscarSession *sess, aim_mpmsg_t *mpm, guint16 charset, guint16 charsubset, gchar *data, guint16 datalen)
 {
 	aim_mpmsg_section_t *sec;
 
@@ -1296,7 +1296,7 @@
 	return 0;
 }
 
-faim_export int aim_mpmsg_addraw(aim_session_t *sess, aim_mpmsg_t *mpm, guint16 charset, guint16 charsubset, const gchar *data, guint16 datalen)
+faim_export int aim_mpmsg_addraw(OscarSession *sess, aim_mpmsg_t *mpm, guint16 charset, guint16 charsubset, const gchar *data, guint16 datalen)
 {
 	gchar *dup;
 
@@ -1313,7 +1313,7 @@
 }
 
 /* XXX - should provide a way of saying ISO-8859-1 specifically */
-faim_export int aim_mpmsg_addascii(aim_session_t *sess, aim_mpmsg_t *mpm, const char *ascii)
+faim_export int aim_mpmsg_addascii(OscarSession *sess, aim_mpmsg_t *mpm, const char *ascii)
 {
 	gchar *dup;
 
@@ -1328,10 +1328,10 @@
 	return 0;
 }
 
-faim_export int aim_mpmsg_addunicode(aim_session_t *sess, aim_mpmsg_t *mpm, const guint16 *unicode, guint16 unicodelen)
+faim_export int aim_mpmsg_addunicode(OscarSession *sess, aim_mpmsg_t *mpm, const guint16 *unicode, guint16 unicodelen)
 {
 	gchar *buf;
-	aim_bstream_t bs;
+	ByteStream bs;
 	int i;
 
 	if (!(buf = malloc(unicodelen * 2)))
@@ -1351,7 +1351,7 @@
 	return 0;
 }
 
-faim_export void aim_mpmsg_free(aim_session_t *sess, aim_mpmsg_t *mpm)
+faim_export void aim_mpmsg_free(OscarSession *sess, aim_mpmsg_t *mpm)
 {
 	aim_mpmsg_section_t *cur;
 
@@ -1376,7 +1376,7 @@
  * suspicious.
  *
  */
-static int incomingim_ch1_parsemsgs(aim_session_t *sess, aim_userinfo_t *userinfo, guint8 *data, int len, struct aim_incomingim_ch1_args *args)
+static int incomingim_ch1_parsemsgs(OscarSession *sess, aim_userinfo_t *userinfo, guint8 *data, int len, struct aim_incomingim_ch1_args *args)
 {
 	/* Should this be ASCII -> UNICODE -> Custom */
 	static const guint16 charsetpri[] = {
@@ -1386,7 +1386,7 @@
 	};
 	static const int charsetpricount = 3;
 	int i;
-	aim_bstream_t mbs;
+	ByteStream mbs;
 	aim_mpmsg_section_t *sec;
 
 	aim_bstream_init(&mbs, data, len);
@@ -1486,7 +1486,7 @@
 	return 0;
 }
 
-static int incomingim_ch1(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, guint16 channel, aim_userinfo_t *userinfo, aim_bstream_t *bs, guint8 *cookie)
+static int incomingim_ch1(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, guint16 channel, aim_userinfo_t *userinfo, ByteStream *bs, guint8 *cookie)
 {
 	guint16 type, length;
 	aim_rxcallback_t userfunc;
@@ -1633,7 +1633,7 @@
 	return ret;
 }
 
-static void incomingim_ch2_buddylist(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_bstream_t *servdata)
+static void incomingim_ch2_buddylist(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, ByteStream *servdata)
 {
 
 	/*
@@ -1682,7 +1682,7 @@
 	return;
 }
 
-static void incomingim_ch2_buddyicon_free(aim_session_t *sess, struct aim_incomingim_ch2_args *args)
+static void incomingim_ch2_buddyicon_free(OscarSession *sess, struct aim_incomingim_ch2_args *args)
 {
 
 	free(args->info.icon.icon);
@@ -1690,7 +1690,7 @@
 	return;
 }
 
-static void incomingim_ch2_buddyicon(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_bstream_t *servdata)
+static void incomingim_ch2_buddyicon(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, ByteStream *servdata)
 {
 
 	if (servdata) {
@@ -1705,7 +1705,7 @@
 	return;
 }
 
-static void incomingim_ch2_chat_free(aim_session_t *sess, struct aim_incomingim_ch2_args *args)
+static void incomingim_ch2_chat_free(OscarSession *sess, struct aim_incomingim_ch2_args *args)
 {
 
 	/* XXX - aim_chat_roominfo_free() */
@@ -1714,7 +1714,7 @@
 	return;
 }
 
-static void incomingim_ch2_chat(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_bstream_t *servdata)
+static void incomingim_ch2_chat(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, ByteStream *servdata)
 {
 
 	/*
@@ -1728,7 +1728,7 @@
 	return;
 }
 
-static void incomingim_ch2_icqserverrelay_free(aim_session_t *sess, struct aim_incomingim_ch2_args *args)
+static void incomingim_ch2_icqserverrelay_free(OscarSession *sess, struct aim_incomingim_ch2_args *args)
 {
 
 	free((char *)args->info.rtfmsg.rtfmsg);
@@ -1744,7 +1744,7 @@
  * Note that this is all little-endian.  Cringe.
  *
  */
-static void incomingim_ch2_icqserverrelay(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_bstream_t *servdata)
+static void incomingim_ch2_icqserverrelay(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, ByteStream *servdata)
 {
 	guint16 hdrlen, anslen, msglen;
 
@@ -1773,12 +1773,12 @@
 	return;
 }
 
-static void incomingim_ch2_sendfile_free(aim_session_t *sess, struct aim_incomingim_ch2_args *args)
+static void incomingim_ch2_sendfile_free(OscarSession *sess, struct aim_incomingim_ch2_args *args)
 {
 	free(args->info.sendfile.filename);
 }
 
-static void incomingim_ch2_sendfile(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, aim_bstream_t *servdata)
+static void incomingim_ch2_sendfile(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args, ByteStream *servdata)
 {
 
 	args->destructor = (void *)incomingim_ch2_sendfile_free;
@@ -1817,15 +1817,15 @@
 	return;
 }
 
-typedef void (*ch2_args_destructor_t)(aim_session_t *sess, struct aim_incomingim_ch2_args *args);
-
-static int incomingim_ch2(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, guint16 channel, aim_userinfo_t *userinfo, aim_tlvlist_t *tlvlist, guint8 *cookie)
+typedef void (*ch2_args_destructor_t)(OscarSession *sess, struct aim_incomingim_ch2_args *args);
+
+static int incomingim_ch2(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, guint16 channel, aim_userinfo_t *userinfo, aim_tlvlist_t *tlvlist, guint8 *cookie)
 {
 	aim_rxcallback_t userfunc;
 	aim_tlv_t *block1, *servdatatlv;
 	aim_tlvlist_t *list2;
 	struct aim_incomingim_ch2_args args;
-	aim_bstream_t bbs, sdbs, *sdbsptr = NULL;
+	ByteStream bbs, sdbs, *sdbsptr = NULL;
 	guint8 *cookie2;
 	int ret = 0;
 
@@ -2036,9 +2036,9 @@
 	return ret;
 }
 
-static int incomingim_ch4(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, guint16 channel, aim_userinfo_t *userinfo, aim_tlvlist_t *tlvlist, guint8 *cookie)
+static int incomingim_ch4(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, guint16 channel, aim_userinfo_t *userinfo, aim_tlvlist_t *tlvlist, guint8 *cookie)
 {
-	aim_bstream_t meat;
+	ByteStream meat;
 	aim_rxcallback_t userfunc;
 	aim_tlv_t *block;
 	struct aim_incomingim_ch4_args args;
@@ -2078,7 +2078,7 @@
  * I have access to.  Its not fast, its not clean.  But it works.
  *
  */
-static int incomingim(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int incomingim(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	guchar *cookie;
@@ -2177,9 +2177,9 @@
  * returns -1 on error (couldn't alloc packet), 0 on success.
  *
  */
-faim_export int aim_im_warn(aim_session_t *sess, aim_conn_t *conn, const char *sn, guint32 flags)
+faim_export int aim_im_warn(OscarSession *sess, OscarConnection *conn, const char *sn, guint32 flags)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !conn || !sn)
@@ -2201,7 +2201,7 @@
 }
 
 /* Subtype 0x000a */
-static int missedcall(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int missedcall(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -2233,10 +2233,10 @@
  *    AIM_TRANSFER_DENY_NOTACCEPTING -- "client is not accepting transfers"
  *
  */
-faim_export int aim_im_denytransfer(aim_session_t *sess, const char *sender, const guchar *cookie, guint16 code)
+faim_export int aim_im_denytransfer(OscarSession *sess, const char *sender, const guchar *cookie, guint16 code)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 
@@ -2270,7 +2270,7 @@
  * This contains the ICQ status message.  Go figure.
  *
  */
-static int clientautoresp(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int clientautoresp(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -2359,7 +2359,7 @@
  * sent.
  *
  */
-static int msgack(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int msgack(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_rxcallback_t userfunc;
 	guint16 ch;
@@ -2387,10 +2387,10 @@
  * and Gaim 0.60 and newer.
  *
  */
-faim_export int aim_im_sendmtn(aim_session_t *sess, guint16 type1, const char *sn, guint16 type2)
+faim_export int aim_im_sendmtn(OscarSession *sess, guint16 type1, const char *sn, guint16 type2)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0002)))
@@ -2442,7 +2442,7 @@
  * and Gaim 0.60 and newer.
  *
  */
-static int mtn_receive(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int mtn_receive(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -2464,7 +2464,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0005)
@@ -2485,7 +2485,7 @@
 	return 0;
 }
 
-faim_internal int msg_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int msg_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0004;
--- a/src/protocols/oscar/family_icq.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_icq.c	Sun Feb 12 16:02:05 2006 +0000
@@ -25,10 +25,10 @@
 
 #include "oscar.h"
 
-faim_export int aim_icq_reqofflinemsgs(aim_session_t *sess)
+faim_export int aim_icq_reqofflinemsgs(OscarSession *sess)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int bslen;
 
@@ -57,10 +57,10 @@
 	return 0;
 }
 
-faim_export int aim_icq_ackofflinemsgs(aim_session_t *sess)
+faim_export int aim_icq_ackofflinemsgs(OscarSession *sess)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int bslen;
 
@@ -90,10 +90,10 @@
 }
 
 faim_export int
-aim_icq_setsecurity(aim_session_t *sess, gboolean auth_required, gboolean webaware)
+aim_icq_setsecurity(OscarSession *sess, gboolean auth_required, gboolean webaware)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int bslen;
 
@@ -139,10 +139,10 @@
  *        will be truncated.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_icq_changepasswd(aim_session_t *sess, const char *passwd)
+faim_export int aim_icq_changepasswd(OscarSession *sess, const char *passwd)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int bslen, passwdlen;
 
@@ -181,10 +181,10 @@
 	return 0;
 }
 
-faim_export int aim_icq_getallinfo(aim_session_t *sess, const char *uin)
+faim_export int aim_icq_getallinfo(OscarSession *sess, const char *uin)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int bslen;
 	struct aim_icq_info *info;
@@ -226,10 +226,10 @@
 	return 0;
 }
 
-faim_export int aim_icq_getalias(aim_session_t *sess, const char *uin)
+faim_export int aim_icq_getalias(OscarSession *sess, const char *uin)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int bslen;
 	struct aim_icq_info *info;
@@ -271,10 +271,10 @@
 	return 0;
 }
 
-faim_export int aim_icq_getsimpleinfo(aim_session_t *sess, const char *uin)
+faim_export int aim_icq_getsimpleinfo(OscarSession *sess, const char *uin)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int bslen;
 
@@ -309,10 +309,10 @@
 }
 
 #if 0
-faim_export int aim_icq_sendxmlreq(aim_session_t *sess, const char *xml)
+faim_export int aim_icq_sendxmlreq(OscarSession *sess, const char *xml)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int bslen;
 
@@ -367,10 +367,10 @@
  * Yeah hi Peter, whaaaat's happening.  If there's any way to use
  * a codepage other than 1252 that would be great.  Thaaaanks.
  */
-faim_export int aim_icq_sendsms(aim_session_t *sess, const char *name, const char *msg, const char *alias)
+faim_export int aim_icq_sendsms(OscarSession *sess, const char *name, const char *msg, const char *alias)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	int bslen, xmllen;
 	char *xml;
@@ -482,12 +482,12 @@
 /**
  * Subtype 0x0003 - Response to 0x0015/0x002, contains an ICQesque packet.
  */
-static int icqresponse(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int icqresponse(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_tlvlist_t *tl;
 	aim_tlv_t *datatlv;
-	aim_bstream_t qbs;
+	ByteStream qbs;
 	guint32 ouruin;
 	guint16 cmdlen, cmd, reqid;
 
@@ -677,7 +677,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0003)
@@ -686,7 +686,7 @@
 	return 0;
 }
 
-static void icq_shutdown(aim_session_t *sess, aim_module_t *mod)
+static void icq_shutdown(OscarSession *sess, aim_module_t *mod)
 {
 	struct aim_icq_info *del;
 
@@ -699,7 +699,7 @@
 	return;
 }
 
-faim_internal int icq_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int icq_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0015;
--- a/src/protocols/oscar/family_invite.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_invite.c	Sun Feb 12 16:02:05 2006 +0000
@@ -38,7 +38,7 @@
 
 #include "oscar.h"
 
-faim_internal int invite_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int invite_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0006;
--- a/src/protocols/oscar/family_locate.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_locate.c	Sun Feb 12 16:02:05 2006 +0000
@@ -225,9 +225,9 @@
  *
  * @param userinfo Contains the new information for the buddy.
  */
-static void aim_locate_adduserinfo(aim_session_t *sess, aim_userinfo_t *userinfo) {
+static void aim_locate_adduserinfo(OscarSession *sess, aim_userinfo_t *userinfo) {
 	aim_userinfo_t *cur;
-	aim_conn_t *conn;
+	OscarConnection *conn;
 	aim_rxcallback_t userfunc;
 
 	cur = aim_locate_finduserinfo(sess, userinfo->sn);
@@ -312,7 +312,7 @@
 		userfunc(sess, NULL, cur);
 }
 
-faim_export void aim_locate_dorequest(aim_session_t *sess) {
+faim_export void aim_locate_dorequest(OscarSession *sess) {
 	struct userinfo_node *cur = sess->locate.torequest;
 
 	if (cur == NULL)
@@ -339,7 +339,7 @@
  * @return True if the request was explicit (client requested the info),
  *         false if the request was implicit (libfaim request the info).
  */
-static int aim_locate_gotuserinfo(aim_session_t *sess, const char *sn) {
+static int aim_locate_gotuserinfo(OscarSession *sess, const char *sn) {
 	struct userinfo_node *cur, *del;
 	int was_explicit = TRUE;
 
@@ -364,7 +364,7 @@
 	}
 
 	if (!was_explicit) {
-		aim_conn_t *conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE);
+		OscarConnection *conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE);
 		aim_rxcallback_t userfunc;
 
 		sess->locate.waiting_for_response = FALSE;
@@ -378,7 +378,7 @@
 	return was_explicit;
 }
 
-faim_internal void aim_locate_requestuserinfo(aim_session_t *sess, const char *sn) {
+faim_internal void aim_locate_requestuserinfo(OscarSession *sess, const char *sn) {
 	struct userinfo_node *cur;
 
 	/* Make sure we aren't already requesting info for this buddy */
@@ -399,7 +399,7 @@
 	aim_locate_dorequest(sess);
 }
 
-faim_export aim_userinfo_t *aim_locate_finduserinfo(aim_session_t *sess, const char *sn) {
+faim_export aim_userinfo_t *aim_locate_finduserinfo(OscarSession *sess, const char *sn) {
 	aim_userinfo_t *cur = NULL;
 
 	if (sn == NULL)
@@ -416,7 +416,7 @@
 	return NULL;
 }
 
-faim_internal guint32 aim_locate_getcaps(aim_session_t *sess, aim_bstream_t *bs, int len)
+faim_internal guint32 aim_locate_getcaps(OscarSession *sess, ByteStream *bs, int len)
 {
 	guint32 flags = 0;
 	int offset;
@@ -450,7 +450,7 @@
 	return flags;
 }
 
-faim_internal guint32 aim_locate_getcaps_short(aim_session_t *sess, aim_bstream_t *bs, int len)
+faim_internal guint32 aim_locate_getcaps_short(OscarSession *sess, ByteStream *bs, int len)
 {
 	guint32 flags = 0;
 	int offset;
@@ -478,7 +478,7 @@
 	return flags;
 }
 
-faim_internal int aimbs_putcaps(aim_bstream_t *bs, guint32 caps)
+faim_internal int aimbs_putcaps(ByteStream *bs, guint32 caps)
 {
 	int i;
 
@@ -498,7 +498,7 @@
 	return 0;
 }
 
-static void dumptlv(aim_session_t *sess, guint16 type, aim_bstream_t *bs, guint8 len)
+static void dumptlv(OscarSession *sess, guint16 type, ByteStream *bs, guint8 len)
 {
 	int i;
 
@@ -536,7 +536,7 @@
  * AIM is fairly regular about providing user info.  This is a generic
  * routine to extract it in its standard form.
  */
-faim_internal int aim_info_extract(aim_session_t *sess, aim_bstream_t *bs, aim_userinfo_t *outinfo)
+faim_internal int aim_info_extract(OscarSession *sess, ByteStream *bs, aim_userinfo_t *outinfo)
 {
 	int curtlv, tlvcnt;
 	guint8 snlen;
@@ -861,7 +861,7 @@
 /*
  * Inverse of aim_info_extract()
  */
-faim_internal int aim_putuserinfo(aim_bstream_t *bs, aim_userinfo_t *info)
+faim_internal int aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info)
 {
 	aim_tlvlist_t *tlvlist = NULL;
 
@@ -908,7 +908,7 @@
 /*
  * Subtype 0x0001
  */
-static int error(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int error(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -957,9 +957,9 @@
  * Request Location services rights.
  *
  */
-faim_export int aim_locate_reqrights(aim_session_t *sess)
+faim_export int aim_locate_reqrights(OscarSession *sess)
 {
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE)))
 		return -EINVAL;
@@ -976,7 +976,7 @@
  *   t(0003)  - short - unknown (value = 10)
  *   t(0004)  - short - unknown (value = 2048) [ICQ only?]
  */
-static int rights(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int rights(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_tlvlist_t *tlvlist;
 	aim_rxcallback_t userfunc;
@@ -1016,12 +1016,12 @@
  * obvious equivalent).
  *
  */
-faim_export int aim_locate_setprofile(aim_session_t *sess,
+faim_export int aim_locate_setprofile(OscarSession *sess,
 				  const char *profile_encoding, const gchar *profile, const int profile_len,
 				  const char *awaymsg_encoding, const gchar *awaymsg, const int awaymsg_len)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 	char *encoding;
@@ -1089,10 +1089,10 @@
 /*
  * Subtype 0x0004 - Set your client's capabilities.
  */
-faim_export int aim_locate_setcaps(aim_session_t *sess, guint32 caps)
+faim_export int aim_locate_setcaps(OscarSession *sess, guint32 caps)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 
@@ -1124,10 +1124,10 @@
  *        0x0003 - Away message
  *        0x0004 - Capabilities
  */
-faim_export int aim_locate_getinfo(aim_session_t *sess, const char *sn, guint16 infotype)
+faim_export int aim_locate_getinfo(OscarSession *sess, const char *sn, guint16 infotype)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE)) || !sn)
@@ -1149,7 +1149,7 @@
 }
 
 /* Subtype 0x0006 */
-static int userinfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int userinfo(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1180,7 +1180,7 @@
 
 	/* Caps will be 5 */
 	if ((tlv = aim_tlv_gettlv(tlvlist, 0x0005, 1))) {
-		aim_bstream_t cbs;
+		ByteStream cbs;
 		aim_bstream_init(&cbs, tlv->value, tlv->length);
 		userinfo->capabilities = aim_locate_getcaps(sess, &cbs, tlv->length);
 		userinfo->present = AIM_USERINFO_PRESENT_CAPABILITIES;
@@ -1212,10 +1212,10 @@
  * privacy: 1 to allow searching, 0 to disallow.
  *
  */
-faim_export int aim_locate_setdirinfo(aim_session_t *sess, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, guint16 privacy)
+faim_export int aim_locate_setdirinfo(OscarSession *sess, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, guint16 privacy)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 
@@ -1263,10 +1263,10 @@
 /*
  * Subtype 0x000b - Huh? What is this?
  */
-faim_export int aim_locate_000b(aim_session_t *sess, const char *sn)
+faim_export int aim_locate_000b(OscarSession *sess, const char *sn)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 		return -EINVAL;
@@ -1294,10 +1294,10 @@
  * XXX pass these in better
  *
  */
-faim_export int aim_locate_setinterests(aim_session_t *sess, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, guint16 privacy)
+faim_export int aim_locate_setinterests(OscarSession *sess, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, guint16 privacy)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 
@@ -1344,10 +1344,10 @@
  *        0x00000008 - Certification.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_locate_getinfoshort(aim_session_t *sess, const char *sn, guint32 flags)
+faim_export int aim_locate_getinfoshort(OscarSession *sess, const char *sn, guint32 flags)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE)) || !sn)
@@ -1368,7 +1368,7 @@
 	return 0;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0001)
@@ -1381,7 +1381,7 @@
 	return 0;
 }
 
-static void locate_shutdown(aim_session_t *sess, aim_module_t *mod)
+static void locate_shutdown(OscarSession *sess, aim_module_t *mod)
 {
 	aim_userinfo_t *del;
 
@@ -1393,7 +1393,7 @@
 	}
 }
 
-faim_internal int locate_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int locate_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = OSCAR_FAMILY_LOCATE;
--- a/src/protocols/oscar/family_odir.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_odir.c	Sun Feb 12 16:02:05 2006 +0000
@@ -38,10 +38,10 @@
  * @param email The email address you want to search for.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_odir_email(aim_session_t *sess, const char *region, const char *email)
+faim_export int aim_odir_email(OscarSession *sess, const char *region, const char *email)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 
@@ -87,10 +87,10 @@
  * @param address The street address where the person you want to seach for resides.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_odir_name(aim_session_t *sess, const char *region, const char *first, const char *middle, const char *last, const char *maiden, const char *nick, const char *city, const char *state, const char *country, const char *zip, const char *address)
+faim_export int aim_odir_name(OscarSession *sess, const char *region, const char *first, const char *middle, const char *last, const char *maiden, const char *nick, const char *city, const char *state, const char *country, const char *zip, const char *address)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 
@@ -142,10 +142,10 @@
  * @param interest1 An interest you want to search for.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_odir_interest(aim_session_t *sess, const char *region, const char *interest)
+faim_export int aim_odir_interest(OscarSession *sess, const char *region, const char *interest)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 
@@ -176,7 +176,7 @@
  * Subtype 0x0003 - Receive Reply From a User Search
  *
  */
-static int parseresults(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parseresults(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -240,7 +240,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0003)
@@ -249,7 +249,7 @@
 	return 0;
 }
 
-faim_internal int odir_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int odir_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x000f;
--- a/src/protocols/oscar/family_oservice.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_oservice.c	Sun Feb 12 16:02:05 2006 +0000
@@ -28,11 +28,11 @@
 #include "cipher.h"
 
 /* Subtype 0x0002 - Client Online */
-faim_export int aim_clientready(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_clientready(OscarSession *sess, OscarConnection *conn)
 {
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
 	struct snacgroup *sg;
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!ins)
@@ -79,7 +79,7 @@
  * shortly after the rate information is acknowledged.
  *
  */
-static int hostonline(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int hostonline(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	guint16 *families;
 	int famcount;
@@ -110,7 +110,7 @@
 }
 
 /* Subtype 0x0004 - Service request */
-faim_export int aim_reqservice(aim_session_t *sess, aim_conn_t *conn, guint16 serviceid)
+faim_export int aim_reqservice(OscarSession *sess, OscarConnection *conn, guint16 serviceid)
 {
 	return aim_genericreq_s(sess, conn, 0x0001, 0x0004, &serviceid);
 }
@@ -121,9 +121,9 @@
  * family 0x000e, with a little added on to specify the exchange and room 
  * name.
  */
-faim_export int aim_chat_join(aim_session_t *sess, aim_conn_t *conn, guint16 exchange, const char *roomname, guint16 instance)
+faim_export int aim_chat_join(OscarSession *sess, OscarConnection *conn, guint16 exchange, const char *roomname, guint16 instance)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 	struct chatsnacinfo csi;
@@ -157,7 +157,7 @@
 }
 
 /* Subtype 0x0005 - Redirect */
-static int redirect(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int redirect(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	struct aim_redirect_data redir;
 	aim_rxcallback_t userfunc;
@@ -208,7 +208,7 @@
 }
 
 /* Subtype 0x0006 - Request Rate Information. */
-faim_internal int aim_reqrates(aim_session_t *sess, aim_conn_t *conn)
+faim_internal int aim_reqrates(OscarSession *sess, OscarConnection *conn)
 {
 	return aim_genericreq_n_snacid(sess, conn, 0x0001, 0x0006);
 }
@@ -318,7 +318,7 @@
 }
 
 /* Subtype 0x0007 - Rate Parameters */
-static int rateresp(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int rateresp(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)rx->conn->inside;
 	guint16 numclasses, i;
@@ -405,10 +405,10 @@
 }
 
 /* Subtype 0x0008 - Add Rate Parameter */
-faim_internal int aim_rates_addparam(aim_session_t *sess, aim_conn_t *conn)
+faim_internal int aim_rates_addparam(OscarSession *sess, OscarConnection *conn)
 {
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	struct rateclass *rc;
 
@@ -427,10 +427,10 @@
 }
 
 /* Subtype 0x0009 - Delete Rate Parameter */
-faim_internal int aim_rates_delparam(aim_session_t *sess, aim_conn_t *conn)
+faim_internal int aim_rates_delparam(OscarSession *sess, OscarConnection *conn)
 {
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	struct rateclass *rc;
 
@@ -449,7 +449,7 @@
 }
 
 /* Subtype 0x000a - Rate Change */
-static int ratechange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int ratechange(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -487,7 +487,7 @@
  */
 
 /* Subtype 0x000b - Service Pause */
-static int serverpause(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int serverpause(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -509,9 +509,9 @@
  * libfaim can cause.
  *
  */
-faim_export int aim_sendpauseack(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_sendpauseack(OscarSession *sess, OscarConnection *conn)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
 	struct snacgroup *sg;
@@ -536,7 +536,7 @@
 }
 
 /* Subtype 0x000d - Service Resume */
-static int serverresume(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int serverresume(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -548,13 +548,13 @@
 }
 
 /* Subtype 0x000e - Request self-info */
-faim_export int aim_reqpersonalinfo(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_reqpersonalinfo(OscarSession *sess, OscarConnection *conn)
 {
 	return aim_genericreq_n_snacid(sess, conn, 0x0001, 0x000e);
 }
 
 /* Subtype 0x000f - Self User Info */
-static int selfinfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int selfinfo(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -571,7 +571,7 @@
 }
 
 /* Subtype 0x0010 - Evil Notification */
-static int evilnotify(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int evilnotify(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -602,9 +602,9 @@
  * call it again with zero when you're back.
  *
  */
-faim_export int aim_srv_setidle(aim_session_t *sess, guint32 idletime)
+faim_export int aim_srv_setidle(OscarSession *sess, guint32 idletime)
 {
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_BOS)))
 		return -EINVAL;
@@ -620,7 +620,7 @@
  * optionally a list of the SNAC groups being migrated.
  *
  */
-static int migrate(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int migrate(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_rxcallback_t userfunc;
 	int ret = 0;
@@ -666,7 +666,7 @@
 }
 
 /* Subtype 0x0013 - Message of the Day */
-static int motd(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int motd(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_rxcallback_t userfunc;
 	char *msg = NULL;
@@ -713,7 +713,7 @@
  *  Bit 2:  Allows other AIM users to see how long you've been a member.
  *
  */
-faim_export int aim_bos_setprivacyflags(aim_session_t *sess, aim_conn_t *conn, guint32 flags)
+faim_export int aim_bos_setprivacyflags(OscarSession *sess, OscarConnection *conn, guint32 flags)
 {
 	return aim_genericreq_l(sess, conn, 0x0001, 0x0014, &flags);
 }
@@ -727,7 +727,7 @@
  * Wha?  No?  Since when?  I think WinAIM sends an empty channel 3 
  * SNAC as a no-op...
  */
-faim_export int aim_nop(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_nop(OscarSession *sess, OscarConnection *conn)
 {
 	return aim_genericreq_n(sess, conn, 0x0001, 0x0016);
 }
@@ -745,11 +745,11 @@
  * the rate information based on what version of group 1 we advertise here.
  *
  */
-faim_internal int aim_setversions(aim_session_t *sess, aim_conn_t *conn)
+faim_internal int aim_setversions(OscarSession *sess, OscarConnection *conn)
 {
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
 	struct snacgroup *sg;
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!ins)
@@ -781,7 +781,7 @@
 }
 
 /* Subtype 0x0018 - Host versions */
-static int hostversions(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int hostversions(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int vercount;
 	guint8 *versions;
@@ -814,10 +814,10 @@
  * These are the same TLVs seen in user info.  You can
  * also set 0x0008 and 0x000c.
  */
-faim_export int aim_setextstatus(aim_session_t *sess, guint32 status)
+faim_export int aim_setextstatus(OscarSession *sess, guint32 status)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 	aim_tlvlist_t *tl = NULL;
 	guint32 data;
@@ -856,10 +856,10 @@
  * These are the same TLVs seen in user info.  You can
  * also set 0x0008 and 0x000c.
  */
-faim_export int aim_srv_setstatusmsg(aim_session_t *sess, const char *msg)
+faim_export int aim_srv_setstatusmsg(OscarSession *sess, const char *msg)
 {
-	aim_conn_t *conn;
-	aim_frame_t *fr;
+	OscarConnection *conn;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0004)))
@@ -938,7 +938,7 @@
  *
  */
 /* Subtype 0x001f - Client verification */
-static int memrequest(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int memrequest(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -964,9 +964,9 @@
 }
 
 /* Subtype 0x0020 - Client verification reply */
-faim_export int aim_sendmemblock(aim_session_t *sess, aim_conn_t *conn, guint32 offset, guint32 len, const guint8 *buf, guint8 flag)
+faim_export int aim_sendmemblock(OscarSession *sess, OscarConnection *conn, guint32 offset, guint32 len, const guint8 *buf, guint8 flag)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !conn)
@@ -1064,7 +1064,7 @@
  * status messages?  It's also used to tell the client whether or not it
  * needs to upload an SSI buddy icon... who engineers this stuff, anyway?
  */
-static int aim_parse_extstatus(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int aim_parse_extstatus(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -1096,7 +1096,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0003)
@@ -1129,7 +1129,7 @@
 	return 0;
 }
 
-faim_internal int service_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int service_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0001;
--- a/src/protocols/oscar/family_popup.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_popup.c	Sun Feb 12 16:02:05 2006 +0000
@@ -33,7 +33,7 @@
  * The message is probably HTML.
  *
  */
-static int parsepopup(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int parsepopup(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	aim_rxcallback_t userfunc;
 	aim_tlvlist_t *tl;
@@ -59,7 +59,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0002)
@@ -68,7 +68,7 @@
 	return 0;
 }
 
-faim_internal int popups_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int popups_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x0008;
--- a/src/protocols/oscar/family_stats.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_stats.c	Sun Feb 12 16:02:05 2006 +0000
@@ -25,7 +25,7 @@
 
 #include <oscar.h>
 
-static int reportinterval(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int reportinterval(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -39,7 +39,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0002)
@@ -48,7 +48,7 @@
 	return 0;
 }
 
-faim_internal int stats_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int stats_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x000b;
--- a/src/protocols/oscar/family_translate.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_translate.c	Sun Feb 12 16:02:05 2006 +0000
@@ -31,7 +31,7 @@
 
 #include "oscar.h"
 
-faim_internal int translate_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int translate_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x000c;
--- a/src/protocols/oscar/family_userlookup.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/family_userlookup.c	Sun Feb 12 16:02:05 2006 +0000
@@ -32,7 +32,7 @@
  *
  * XXX can this be integrated with the rest of the error handling?
  */
-static int error(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int error(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	aim_rxcallback_t userfunc;
@@ -59,9 +59,9 @@
  * Subtype 0x0002
  *
  */
-faim_export int aim_search_address(aim_session_t *sess, aim_conn_t *conn, const char *address)
+faim_export int aim_search_address(OscarSession *sess, OscarConnection *conn, const char *address)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!sess || !conn || !address)
@@ -84,7 +84,7 @@
  * Subtype 0x0003
  *
  */
-static int reply(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int reply(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int j = 0, m, ret = 0;
 	aim_tlvlist_t *tlvlist;
@@ -127,7 +127,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0001)
@@ -138,7 +138,7 @@
 	return 0;
 }
 
-faim_internal int search_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int search_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0x000a;
--- a/src/protocols/oscar/misc.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/misc.c	Sun Feb 12 16:02:05 2006 +0000
@@ -39,9 +39,9 @@
  * back to the single.  I don't see any advantage to doing it either way.
  *
  */
-faim_internal int aim_genericreq_n(aim_session_t *sess, aim_conn_t *conn, guint16 family, guint16 subtype)
+faim_internal int aim_genericreq_n(OscarSession *sess, OscarConnection *conn, guint16 family, guint16 subtype)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid = 0x00000000;
 
 	if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10)))
@@ -54,9 +54,9 @@
 	return 0;
 }
 
-faim_internal int aim_genericreq_n_snacid(aim_session_t *sess, aim_conn_t *conn, guint16 family, guint16 subtype)
+faim_internal int aim_genericreq_n_snacid(OscarSession *sess, OscarConnection *conn, guint16 family, guint16 subtype)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10)))
@@ -70,9 +70,9 @@
 	return 0;
 }
 
-faim_internal int aim_genericreq_l(aim_session_t *sess, aim_conn_t *conn, guint16 family, guint16 subtype, guint32 *longdata)
+faim_internal int aim_genericreq_l(OscarSession *sess, OscarConnection *conn, guint16 family, guint16 subtype, guint32 *longdata)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!longdata)
@@ -91,9 +91,9 @@
 	return 0;
 }
 
-faim_internal int aim_genericreq_s(aim_session_t *sess, aim_conn_t *conn, guint16 family, guint16 subtype, guint16 *shortdata)
+faim_internal int aim_genericreq_s(OscarSession *sess, OscarConnection *conn, guint16 family, guint16 subtype, guint16 *shortdata)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	aim_snacid_t snacid;
 
 	if (!shortdata)
@@ -116,7 +116,7 @@
  * Should be generic enough to handle the errors for all groups.
  *
  */
-static int generror(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int generror(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 	int ret = 0;
 	int error = 0;
@@ -138,7 +138,7 @@
 	return ret;
 }
 
-static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
+static int snachandler(OscarSession *sess, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs)
 {
 
 	if (snac->subtype == 0x0001)
@@ -153,7 +153,7 @@
 	return 0;
 }
 
-faim_internal int misc_modfirst(aim_session_t *sess, aim_module_t *mod)
+faim_internal int misc_modfirst(OscarSession *sess, aim_module_t *mod)
 {
 
 	mod->family = 0xffff;
--- a/src/protocols/oscar/msgcookie.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/msgcookie.c	Sun Feb 12 16:02:05 2006 +0000
@@ -45,9 +45,9 @@
  * @return returns -1 on error, 0 on append, 1 on update.  the cookie you pass
  *         in may be free'd, so don't count on its value after calling this!
  */
-faim_internal int aim_cachecookie(aim_session_t *sess, aim_msgcookie_t *cookie)
+faim_internal int aim_cachecookie(OscarSession *sess, IcbmCookie *cookie)
 {
-	aim_msgcookie_t *newcook;
+	IcbmCookie *newcook;
 
 	if (!sess || !cookie)
 		return -EINVAL;
@@ -78,9 +78,9 @@
  * @param type cookie type to look for
  * @return if found, returns the struct; if none found (or on error), returns NULL:
  */
-faim_internal aim_msgcookie_t *aim_uncachecookie(aim_session_t *sess, guint8 *cookie, int type)
+faim_internal IcbmCookie *aim_uncachecookie(OscarSession *sess, guint8 *cookie, int type)
 {
-	aim_msgcookie_t *cur, **prev;
+	IcbmCookie *cur, **prev;
 
 	if (!cookie || !sess->msgcookies)
 		return NULL;
@@ -98,7 +98,7 @@
 }
 
 /**
- * aim_mkcookie - generate an aim_msgcookie_t *struct from a cookie string, a type, and a data pointer.
+ * aim_mkcookie - generate an IcbmCookie *struct from a cookie string, a type, and a data pointer.
  *
  * @param c pointer to the cookie string array
  * @param type cookie type to use
@@ -106,14 +106,14 @@
  * @return returns NULL on error, a pointer to the newly-allocated
  *         cookie on success.
  */
-faim_internal aim_msgcookie_t *aim_mkcookie(guint8 *c, int type, void *data)
+faim_internal IcbmCookie *aim_mkcookie(guint8 *c, int type, void *data)
 {
-	aim_msgcookie_t *cookie;
+	IcbmCookie *cookie;
 
 	if (!c)
 		return NULL;
 
-	if (!(cookie = calloc(1, sizeof(aim_msgcookie_t))))
+	if (!(cookie = calloc(1, sizeof(IcbmCookie))))
 		return NULL;
 
 	cookie->data = data;
@@ -133,9 +133,9 @@
  *         on success; returns NULL on error/not found
  */
 
-faim_internal aim_msgcookie_t *aim_checkcookie(aim_session_t *sess, const guint8 *cookie, int type)
+faim_internal IcbmCookie *aim_checkcookie(OscarSession *sess, const guint8 *cookie, int type)
 {
-	aim_msgcookie_t *cur;
+	IcbmCookie *cur;
 
 	for (cur = sess->msgcookies; cur; cur = cur->next) {
 		if ((cur->type == type) &&
@@ -147,7 +147,7 @@
 }
 
 /**
- * aim_cookie_free - free an aim_msgcookie_t struct
+ * aim_cookie_free - free an IcbmCookie struct
  *
  * this function removes the cookie *cookie from the list of cookies
  * in sess, and then frees all memory associated with it. including
@@ -159,9 +159,9 @@
  * @return returns -1 on error, 0 on success.
  *
  */
-faim_internal int aim_cookie_free(aim_session_t *sess, aim_msgcookie_t *cookie)
+faim_internal int aim_cookie_free(OscarSession *sess, IcbmCookie *cookie)
 {
-	aim_msgcookie_t *cur, **prev;
+	IcbmCookie *cur, **prev;
 
 	if (!sess || !cookie)
 		return -EINVAL;
--- a/src/protocols/oscar/oscar.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/oscar.c	Sun Feb 12 16:02:05 2006 +0000
@@ -85,8 +85,8 @@
 
 typedef struct _OscarData OscarData;
 struct _OscarData {
-	aim_session_t *sess;
-	aim_conn_t *conn;
+	OscarSession *sess;
+	OscarConnection *conn;
 
 	guint cnpa;
 	guint paspa;
@@ -142,7 +142,7 @@
 	char *show; /* AOL did something funny to us */
 	guint16 exchange;
 	guint16 instance;
-	aim_conn_t *conn;
+	OscarConnection *conn;
 	int inpa;
 	int id;
 	GaimConnection *gc; /* i hate this. */
@@ -155,7 +155,7 @@
 	GaimConnection *gc;
 	char name[80];
 	int watcher;
-	aim_conn_t *conn;
+	OscarConnection *conn;
 	gboolean connected;
 	gboolean gpc_pend;
 	gboolean killme;
@@ -229,79 +229,79 @@
 static int msgerrreasonlen = 25;
 
 /* All the libfaim->gaim callback functions */
-static int gaim_parse_auth_resp  (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_login      (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_auth_securid_request(aim_session_t *, aim_frame_t *, ...);
-static int gaim_handle_redirect  (aim_session_t *, aim_frame_t *, ...);
-static int gaim_info_change      (aim_session_t *, aim_frame_t *, ...);
-static int gaim_account_confirm  (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_oncoming   (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_offgoing   (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_incoming_im(aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_misses     (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_clientauto (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_userinfo   (aim_session_t *, aim_frame_t *, ...);
-static int gaim_reqinfo_timeout  (aim_session_t *, aim_frame_t *, ...);
-static int gaim_got_infoblock    (aim_session_t *sess, aim_frame_t *fr, ...);
-static int gaim_parse_motd       (aim_session_t *, aim_frame_t *, ...);
-static int gaim_chatnav_info     (aim_session_t *, aim_frame_t *, ...);
-static int gaim_conv_chat_join        (aim_session_t *, aim_frame_t *, ...);
-static int gaim_conv_chat_leave       (aim_session_t *, aim_frame_t *, ...);
-static int gaim_conv_chat_info_update (aim_session_t *, aim_frame_t *, ...);
-static int gaim_conv_chat_incoming_msg(aim_session_t *, aim_frame_t *, ...);
-static int gaim_email_parseupdate(aim_session_t *, aim_frame_t *, ...);
-static int gaim_icon_error       (aim_session_t *, aim_frame_t *, ...);
-static int gaim_icon_parseicon   (aim_session_t *, aim_frame_t *, ...);
-static int oscar_icon_req        (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_msgack     (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_ratechange (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_evilnotify (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_searcherror(aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_searchreply(aim_session_t *, aim_frame_t *, ...);
-static int gaim_bosrights        (aim_session_t *, aim_frame_t *, ...);
-static int gaim_connerr          (aim_session_t *, aim_frame_t *, ...);
-static int conninitdone_admin    (aim_session_t *, aim_frame_t *, ...);
-static int conninitdone_bos      (aim_session_t *, aim_frame_t *, ...);
-static int conninitdone_chatnav  (aim_session_t *, aim_frame_t *, ...);
-static int conninitdone_chat     (aim_session_t *, aim_frame_t *, ...);
-static int conninitdone_email    (aim_session_t *, aim_frame_t *, ...);
-static int conninitdone_icon     (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_msgerr     (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_mtn        (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_locaterights(aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_buddyrights(aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_locerr     (aim_session_t *, aim_frame_t *, ...);
-static int gaim_icbm_param_info  (aim_session_t *, aim_frame_t *, ...);
-static int gaim_parse_genericerr (aim_session_t *, aim_frame_t *, ...);
-static int gaim_memrequest       (aim_session_t *, aim_frame_t *, ...);
-static int gaim_selfinfo         (aim_session_t *, aim_frame_t *, ...);
-static int gaim_offlinemsg       (aim_session_t *, aim_frame_t *, ...);
-static int gaim_offlinemsgdone   (aim_session_t *, aim_frame_t *, ...);
-static int gaim_icqalias         (aim_session_t *, aim_frame_t *, ...);
-static int gaim_icqinfo          (aim_session_t *, aim_frame_t *, ...);
-static int gaim_popup            (aim_session_t *, aim_frame_t *, ...);
-
-static int gaim_ssi_parseerr     (aim_session_t *, aim_frame_t *, ...);
-static int gaim_ssi_parserights  (aim_session_t *, aim_frame_t *, ...);
-static int gaim_ssi_parselist    (aim_session_t *, aim_frame_t *, ...);
-static int gaim_ssi_parseack     (aim_session_t *, aim_frame_t *, ...);
-static int gaim_ssi_parseadd     (aim_session_t *, aim_frame_t *, ...);
-static int gaim_ssi_authgiven    (aim_session_t *, aim_frame_t *, ...);
-static int gaim_ssi_authrequest  (aim_session_t *, aim_frame_t *, ...);
-static int gaim_ssi_authreply    (aim_session_t *, aim_frame_t *, ...);
-static int gaim_ssi_gotadded     (aim_session_t *, aim_frame_t *, ...);
+static int gaim_parse_auth_resp  (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_login      (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_auth_securid_request(OscarSession *, FlapFrame *, ...);
+static int gaim_handle_redirect  (OscarSession *, FlapFrame *, ...);
+static int gaim_info_change      (OscarSession *, FlapFrame *, ...);
+static int gaim_account_confirm  (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_oncoming   (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_offgoing   (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_incoming_im(OscarSession *, FlapFrame *, ...);
+static int gaim_parse_misses     (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_clientauto (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_userinfo   (OscarSession *, FlapFrame *, ...);
+static int gaim_reqinfo_timeout  (OscarSession *, FlapFrame *, ...);
+static int gaim_got_infoblock    (OscarSession *sess, FlapFrame *fr, ...);
+static int gaim_parse_motd       (OscarSession *, FlapFrame *, ...);
+static int gaim_chatnav_info     (OscarSession *, FlapFrame *, ...);
+static int gaim_conv_chat_join        (OscarSession *, FlapFrame *, ...);
+static int gaim_conv_chat_leave       (OscarSession *, FlapFrame *, ...);
+static int gaim_conv_chat_info_update (OscarSession *, FlapFrame *, ...);
+static int gaim_conv_chat_incoming_msg(OscarSession *, FlapFrame *, ...);
+static int gaim_email_parseupdate(OscarSession *, FlapFrame *, ...);
+static int gaim_icon_error       (OscarSession *, FlapFrame *, ...);
+static int gaim_icon_parseicon   (OscarSession *, FlapFrame *, ...);
+static int oscar_icon_req        (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_msgack     (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_ratechange (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_evilnotify (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_searcherror(OscarSession *, FlapFrame *, ...);
+static int gaim_parse_searchreply(OscarSession *, FlapFrame *, ...);
+static int gaim_bosrights        (OscarSession *, FlapFrame *, ...);
+static int gaim_connerr          (OscarSession *, FlapFrame *, ...);
+static int conninitdone_admin    (OscarSession *, FlapFrame *, ...);
+static int conninitdone_bos      (OscarSession *, FlapFrame *, ...);
+static int conninitdone_chatnav  (OscarSession *, FlapFrame *, ...);
+static int conninitdone_chat     (OscarSession *, FlapFrame *, ...);
+static int conninitdone_email    (OscarSession *, FlapFrame *, ...);
+static int conninitdone_icon     (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_msgerr     (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_mtn        (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_locaterights(OscarSession *, FlapFrame *, ...);
+static int gaim_parse_buddyrights(OscarSession *, FlapFrame *, ...);
+static int gaim_parse_locerr     (OscarSession *, FlapFrame *, ...);
+static int gaim_icbm_param_info  (OscarSession *, FlapFrame *, ...);
+static int gaim_parse_genericerr (OscarSession *, FlapFrame *, ...);
+static int gaim_memrequest       (OscarSession *, FlapFrame *, ...);
+static int gaim_selfinfo         (OscarSession *, FlapFrame *, ...);
+static int gaim_offlinemsg       (OscarSession *, FlapFrame *, ...);
+static int gaim_offlinemsgdone   (OscarSession *, FlapFrame *, ...);
+static int gaim_icqalias         (OscarSession *, FlapFrame *, ...);
+static int gaim_icqinfo          (OscarSession *, FlapFrame *, ...);
+static int gaim_popup            (OscarSession *, FlapFrame *, ...);
+
+static int gaim_ssi_parseerr     (OscarSession *, FlapFrame *, ...);
+static int gaim_ssi_parserights  (OscarSession *, FlapFrame *, ...);
+static int gaim_ssi_parselist    (OscarSession *, FlapFrame *, ...);
+static int gaim_ssi_parseack     (OscarSession *, FlapFrame *, ...);
+static int gaim_ssi_parseadd     (OscarSession *, FlapFrame *, ...);
+static int gaim_ssi_authgiven    (OscarSession *, FlapFrame *, ...);
+static int gaim_ssi_authrequest  (OscarSession *, FlapFrame *, ...);
+static int gaim_ssi_authreply    (OscarSession *, FlapFrame *, ...);
+static int gaim_ssi_gotadded     (OscarSession *, FlapFrame *, ...);
 
 /* for DirectIM/image transfer */
-static int gaim_odc_initiate     (aim_session_t *, aim_frame_t *, ...);
-static int gaim_odc_incoming     (aim_session_t *, aim_frame_t *, ...);
-static int gaim_odc_typing       (aim_session_t *, aim_frame_t *, ...);
-static int gaim_odc_update_ui    (aim_session_t *, aim_frame_t *, ...);
+static int gaim_odc_initiate     (OscarSession *, FlapFrame *, ...);
+static int gaim_odc_incoming     (OscarSession *, FlapFrame *, ...);
+static int gaim_odc_typing       (OscarSession *, FlapFrame *, ...);
+static int gaim_odc_update_ui    (OscarSession *, FlapFrame *, ...);
 
 /* for file transfer */
-static int oscar_sendfile_estblsh(aim_session_t *, aim_frame_t *, ...);
-static int oscar_sendfile_prompt (aim_session_t *, aim_frame_t *, ...);
-static int oscar_sendfile_ack    (aim_session_t *, aim_frame_t *, ...);
-static int oscar_sendfile_done   (aim_session_t *, aim_frame_t *, ...);
+static int oscar_sendfile_estblsh(OscarSession *, FlapFrame *, ...);
+static int oscar_sendfile_prompt (OscarSession *, FlapFrame *, ...);
+static int oscar_sendfile_ack    (OscarSession *, FlapFrame *, ...);
+static int oscar_sendfile_done   (OscarSession *, FlapFrame *, ...);
 
 static gboolean gaim_icon_timerfunc(gpointer data);
 static void oscar_callback(gpointer data, gint source, GaimInputCondition condition);
@@ -871,7 +871,7 @@
 }
 
 static struct chat_connection *
-find_oscar_chat_by_conn(GaimConnection *gc, aim_conn_t *conn)
+find_oscar_chat_by_conn(GaimConnection *gc, OscarConnection *conn)
 {
 	OscarData *od = (OscarData *)gc->proto_data;
 	GSList *cur;
@@ -988,7 +988,7 @@
 }
 
 /* oops i made two of these. this one just calls the other one. */
-static void gaim_odc_disconnect(aim_session_t *sess, aim_conn_t *conn)
+static void gaim_odc_disconnect(OscarSession *sess, OscarConnection *conn)
 {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = (OscarData *)gc->proto_data;
@@ -1121,9 +1121,9 @@
 	}
 
 	aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT,
-						OFT_TYPE_DIRECTIMINCOMING, gaim_odc_incoming, 0);
+						PEER_TYPE_DIRECTIMINCOMING, gaim_odc_incoming, 0);
 	aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT,
-						OFT_TYPE_DIRECTIMTYPING, gaim_odc_typing, 0);
+						PEER_TYPE_DIRECTIMTYPING, gaim_odc_typing, 0);
 	aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_SPECIAL,
 						AIM_CB_SPECIAL_IMAGETRANSFER, gaim_odc_update_ui, 0);
 
@@ -1161,7 +1161,7 @@
 /*
  * We have just established a socket with the other dude, so set up some handlers.
  */
-static int gaim_odc_initiate(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_odc_initiate(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = (OscarData *)gc->proto_data;
 	GaimConversation *conv;
@@ -1169,11 +1169,11 @@
 	char buf[256];
 	char *sn;
 	va_list ap;
-	aim_conn_t *newconn, *listenerconn;
+	OscarConnection *newconn, *listenerconn;
 
 	va_start(ap, fr);
-	newconn = va_arg(ap, aim_conn_t *);
-	listenerconn = va_arg(ap, aim_conn_t *);
+	newconn = va_arg(ap, OscarConnection *);
+	listenerconn = va_arg(ap, OscarConnection *);
 	va_end(ap);
 
 	aim_conn_close(listenerconn);
@@ -1193,8 +1193,8 @@
 	g_free(sn);
 	gaim_conversation_write(conv, NULL, buf, GAIM_MESSAGE_SYSTEM, time(NULL));
 
-	aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, OFT_TYPE_DIRECTIMINCOMING, gaim_odc_incoming, 0);
-	aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, OFT_TYPE_DIRECTIMTYPING, gaim_odc_typing, 0);
+	aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, PEER_TYPE_DIRECTIMINCOMING, gaim_odc_incoming, 0);
+	aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, PEER_TYPE_DIRECTIMTYPING, gaim_odc_typing, 0);
 	aim_conn_addhandler(sess, newconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_IMAGETRANSFER, gaim_odc_update_ui, 0);
 
 	return 1;
@@ -1205,7 +1205,7 @@
  * update a progress bar, or to eat lots of dry cat food.  Wet cat food is
  * nasty, you sicko.
  */
-static int gaim_odc_update_ui(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_odc_update_ui(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	char *sn;
 	double percent;
@@ -1261,7 +1261,7 @@
  *     <DATA ID="2" SIZE="65978">datadatadatadata</DATA>
  * </BINARY>
  */
-static int gaim_odc_incoming(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_odc_incoming(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	GaimMessageFlags imflags = 0;
 	gchar *utf8;
@@ -1395,7 +1395,7 @@
 	return 1;
 }
 
-static int gaim_odc_typing(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_odc_typing(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	char *sn;
 	int typing;
@@ -1418,7 +1418,7 @@
 	return 1;
 }
 
-static int gaim_odc_send_im(aim_session_t *sess, aim_conn_t *conn, const char *message, GaimMessageFlags imflags) {
+static int gaim_odc_send_im(OscarSession *sess, OscarConnection *conn, const char *message, GaimMessageFlags imflags) {
 	char *buf;
 	size_t len;
 	int ret;
@@ -1540,7 +1540,7 @@
 		od->direct_ims = g_slist_append(od->direct_ims, dim);
 		dim->watcher = gaim_input_add(dim->conn->fd, GAIM_INPUT_READ,
 						oscar_callback, dim->conn);
-		aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT, OFT_TYPE_DIRECTIM_ESTABLISHED,
+		aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT, PEER_TYPE_DIRECTIM_ESTABLISHED,
 					gaim_odc_initiate, 0);
 
 		conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, dim->gc->account, dim->name);
@@ -1652,12 +1652,12 @@
 static void
 oscar_callback(gpointer data, gint source, GaimInputCondition condition)
 {
-	aim_conn_t *conn;
-	aim_session_t *sess;
+	OscarConnection *conn;
+	OscarSession *sess;
 	GaimConnection *gc;
 	OscarData *od;
 
-	conn = (aim_conn_t *)data;
+	conn = (OscarConnection *)data;
 	sess = aim_conn_getsess(conn);
 	gc = sess ? sess->aux_data : NULL;
 
@@ -1786,8 +1786,8 @@
 {
 	GaimConnection *gc = data;
 	OscarData *od;
-	aim_session_t *sess;
-	aim_conn_t *conn;
+	OscarSession *sess;
+	OscarConnection *conn;
 
 	if (!g_list_find(gaim_connections_get_all(), gc)) {
 		close(source);
@@ -1820,8 +1820,8 @@
 static void
 oscar_login(GaimAccount *account)
 {
-	aim_session_t *sess;
-	aim_conn_t *conn;
+	OscarSession *sess;
+	OscarConnection *conn;
 	GaimConnection *gc = gaim_account_get_connection(account);
 	OscarData *od = gc->proto_data = g_new0(OscarData, 1);
 
@@ -1842,7 +1842,7 @@
 	}
 	od->buddyinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, oscar_free_buddyinfo);
 
-	sess = g_new0(aim_session_t, 1);
+	sess = g_new0(OscarSession, 1);
 	aim_session_init(sess, TRUE);
 	/*
 	 * We need an immediate queue because we don't use a while-loop
@@ -1948,8 +1948,8 @@
 static void oscar_bos_connect(gpointer data, gint source, GaimInputCondition cond) {
 	GaimConnection *gc = data;
 	OscarData *od;
-	aim_session_t *sess;
-	aim_conn_t *bosconn;
+	OscarSession *sess;
+	OscarConnection *bosconn;
 
 	if (!g_list_find(gaim_connections_get_all(), gc)) {
 		close(source);
@@ -1988,10 +1988,10 @@
  *  -User chooses a file and oscar_xfer_init is called.  It establishes a
  *   listening socket, then asks the remote user to connect to us (and
  *   gives them the file name, port, IP, etc.)
- *  -They connect to us and we send them an OFT_TYPE_PROMPT (this happens
+ *  -They connect to us and we send them an PEER_TYPE_PROMPT (this happens
  *   in oscar_sendfile_estblsh)
- *  -They send us an OFT_TYPE_ACK and then we start sending data
- *  -When we finish, they send us an OFT_TYPE_DONE and they close the
+ *  -They send us an PEER_TYPE_ACK and then we start sending data
+ *  -When we finish, they send us an PEER_TYPE_DONE and they close the
  *   connection.
  *  -We get drunk because file transfer kicks ass.
  *
@@ -2000,10 +2000,10 @@
  *  -Gaim user selects file to name and location to save file to and
  *   oscar_xfer_init is called
  *  -It connects to the remote user using the IP they gave us earlier
- *  -After connecting, they send us an OFT_TYPE_PROMPT.  In reply, we send
- *   them an OFT_TYPE_ACK.
+ *  -After connecting, they send us an PEER_TYPE_PROMPT.  In reply, we send
+ *   them an PEER_TYPE_ACK.
  *  -They begin to send us lots of raw data.
- *  -When they finish sending data we send an OFT_TYPE_DONE and then close
+ *  -When they finish sending data we send an PEER_TYPE_DONE and then close
  *   the connection.
  *
  * Update August 2005:
@@ -2023,7 +2023,7 @@
 static GaimXfer *oscar_find_xfer_by_cookie(GSList *fts, const guint8 *ck)
 {
 	GaimXfer *xfer;
-	struct aim_oft_info *oft_info;
+	PeerInfo *oft_info;
 
 	while (fts) {
 		xfer = fts->data;
@@ -2038,10 +2038,10 @@
 	return NULL;
 }
 
-static GaimXfer *oscar_find_xfer_by_conn(GSList *fts, aim_conn_t *conn)
+static GaimXfer *oscar_find_xfer_by_conn(GSList *fts, OscarConnection *conn)
 {
 	GaimXfer *xfer;
-	struct aim_oft_info *oft_info;
+	PeerInfo *oft_info;
 
 	while (fts) {
 		xfer = fts->data;
@@ -2063,7 +2063,7 @@
  */
 static void oscar_xfer_end(GaimXfer *xfer)
 {
-	struct aim_oft_info *oft_info = xfer->data;
+	PeerInfo *oft_info = xfer->data;
 	GaimConnection *gc = oft_info->sess->aux_data;
 	OscarData *od = gc->proto_data;
 
@@ -2071,7 +2071,7 @@
 
 	if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE) {
 		oft_info->fh.nrecvd = gaim_xfer_get_bytes_sent(xfer);
-		aim_oft_sendheader(oft_info->sess, OFT_TYPE_DONE, oft_info);
+		aim_oft_sendheader(oft_info->sess, PEER_TYPE_DONE, oft_info);
 	}
 
 	aim_conn_kill(oft_info->sess, &oft_info->conn);
@@ -2095,7 +2095,7 @@
 static gboolean oscar_xfer_ip_timeout(gpointer data) {
 	GaimXfer *xfer;
 	GaimAccount *account;
-	struct aim_oft_info *oft_info;
+	PeerInfo *oft_info;
 	char *msg = NULL;
 
 	gaim_debug_info("oscar","AAA - in oscar_xfer_ip_timeout\n");
@@ -2103,7 +2103,7 @@
 	xfer = (GaimXfer*) data;
 	account = gaim_xfer_get_account(xfer);
 	if(xfer->data) {
-		oft_info = (struct aim_oft_info*) xfer->data;
+		oft_info = (PeerInfo*) xfer->data;
 
 		/* Check to see if the clientip has produced any results */
 		if(!oft_info->success) {
@@ -2210,8 +2210,8 @@
  */
 static void oscar_xfer_init_recv(GaimXfer *xfer)
 {
-	struct aim_oft_info *oft_info;
-	struct aim_rv_proxy_info *proxy_info;
+	PeerInfo *oft_info;
+	PeerProxyInfo *proxy_info;
 	GaimConnection *gc;
 	OscarData *od;
 	GaimInputFunction nextstop_cb;
@@ -2270,7 +2270,7 @@
 
 	if (oft_info->conn) {
 		oft_info->conn->subtype = AIM_CONN_SUBTYPE_OFT_SENDFILE;
-		aim_conn_addhandler(od->sess, oft_info->conn, AIM_CB_FAM_OFT, OFT_TYPE_PROMPT,
+		aim_conn_addhandler(od->sess, oft_info->conn, AIM_CB_FAM_OFT, PEER_TYPE_PROMPT,
 			oscar_sendfile_prompt, 0);
 		rc = gaim_proxy_connect(gaim_connection_get_account(gc),
 					xfer->remote_ip, xfer->remote_port, nextstop_cb, xfer);
@@ -2292,7 +2292,7 @@
  */
 static void oscar_xfer_cancel_recv(GaimXfer *xfer)
 {
-	struct aim_oft_info *oft_info = xfer->data;
+	PeerInfo *oft_info = xfer->data;
 	GaimConnection *gc = oft_info->sess->aux_data;
 	OscarData *od = gc->proto_data;
 
@@ -2312,7 +2312,7 @@
  */
 static void oscar_xfer_ack_recv(GaimXfer *xfer, const guchar *buffer, size_t size)
 {
-	struct aim_oft_info *oft_info = xfer->data;
+	PeerInfo *oft_info = xfer->data;
 
 	/* Update our rolling checksum.  Like Walmart, yo. */
 	oft_info->fh.recvcsum = aim_oft_checksum_chunk(buffer, size, oft_info->fh.recvcsum);
@@ -2327,8 +2327,8 @@
  * BBB
  */
 static void oscar_xfer_proxylogin_ready(GaimXfer *xfer, gint fd) {
-	struct aim_oft_info *oft_info;
-	struct aim_rv_proxy_info *proxy_info;
+	PeerInfo *oft_info;
+	PeerProxyInfo *proxy_info;
 
 	/* XXX:NBIO remove when nonblocking I/O implemented for oscar */
 	fcntl(fd, F_SETFL, 0);
@@ -2360,15 +2360,15 @@
 		}
 
 		/* The following is taken from oscar_sendfile_estblsh */
-		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, OFT_TYPE_ACK,
+		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, PEER_TYPE_ACK,
 			oscar_sendfile_ack, 0);
-		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, OFT_TYPE_DONE,
+		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, PEER_TYPE_DONE,
 			oscar_sendfile_done, 0);
 		xfer->watcher = gaim_input_add(oft_info->conn->fd, GAIM_INPUT_READ, oscar_callback,
 			oft_info->conn);
 
 		/* Inform the other user that we are connected and ready to transfer */
-		aim_oft_sendheader(oft_info->sess, OFT_TYPE_PROMPT, oft_info);
+		aim_oft_sendheader(oft_info->sess, PEER_TYPE_PROMPT, oft_info);
 	} else if(oft_info->send_or_recv == AIM_XFER_RECV) {
 		oscar_sendfile_connected(xfer, fd, GAIM_INPUT_READ);
 	} else {
@@ -2382,8 +2382,8 @@
  * BBB
  */
 static void oscar_xfer_proxylogin_ack(GaimXfer *xfer) {
-	struct aim_oft_info *oft_info;
-	struct aim_rv_proxy_info *proxy_info;
+	PeerInfo *oft_info;
+	PeerProxyInfo *proxy_info;
 
 	gaim_debug_info("oscar","AAA - in oscar_xfer_proxylogin_ack\n");
 	if (!(oft_info = xfer->data)) {
@@ -2429,7 +2429,7 @@
  */
 static void oscar_xfer_proxylogin_cb(gpointer data, gint source, GaimInputCondition condition) {
 	GaimXfer *xfer;
-	struct aim_oft_info *oft_info;
+	PeerInfo *oft_info;
 
 	gaim_debug_info("oscar","AAA - in oscar_xfer_proxylogin_cb\n");
 	if (!(xfer = data)) {
@@ -2481,8 +2481,8 @@
 static void oscar_xfer_proxylogin(gpointer data, gint source, GaimInputCondition condition)
 {
 	GaimXfer *xfer;
-	struct aim_oft_info *oft_info;
-	struct aim_rv_proxy_info *proxy_info;
+	PeerInfo *oft_info;
+	PeerProxyInfo *proxy_info;
 	int err;
 
 	gaim_debug_info("oscar","AAA - in oscar_xfer_proxylogin\n");
@@ -2580,7 +2580,7 @@
  */
 static void oscar_send_file_request(GaimXfer *xfer)
 {
-	struct aim_oft_info *oft_info = xfer->data;
+	PeerInfo *oft_info = xfer->data;
 	GaimConnection *gc = oft_info->sess->aux_data;
 	OscarData *od = gc->proto_data;
 
@@ -2602,7 +2602,7 @@
 
 		aim_im_sendch2_sendfile_ask(od->sess, oft_info);
 		aim_conn_addhandler(od->sess, oft_info->conn, AIM_CB_FAM_OFT,
-			OFT_TYPE_ESTABLISHED, oscar_sendfile_estblsh, 0);
+			PEER_TYPE_ESTABLISHED, oscar_sendfile_estblsh, 0);
 	} else {
 		gaim_xfer_error(GAIM_XFER_SEND, gaim_xfer_get_account(xfer), xfer->who,
 						_("Unable to establish listener socket or no AOL proxy connection present."));
@@ -2613,7 +2613,7 @@
 static void
 oscar_xfer_init_listen_cb(int listenfd, gpointer data) {
 	GaimXfer *xfer = data;
-	struct aim_oft_info *oft_info;
+	PeerInfo *oft_info;
 	GaimConnection *gc;
 	OscarData *od;
 
@@ -2675,7 +2675,7 @@
  */
 static void oscar_xfer_cancel_send(GaimXfer *xfer)
 {
-	struct aim_oft_info *oft_info = xfer->data;
+	PeerInfo *oft_info = xfer->data;
 	GaimConnection *gc = oft_info->sess->aux_data;
 	OscarData *od = gc->proto_data;
 
@@ -2699,7 +2699,7 @@
  */
 static void oscar_xfer_ack_send(GaimXfer *xfer, const guchar *buffer, size_t size)
 {
-	struct aim_oft_info *oft_info = xfer->data;
+	PeerInfo *oft_info = xfer->data;
 
 	/* I'm not sure I like how we do this. --marv
 	 * I do.  AIM file transfers aren't really meant to be thought
@@ -2755,7 +2755,7 @@
 oscar_new_xfer(GaimConnection *gc, const char *who) {
 	OscarData *od;
 	GaimXfer *xfer;
-	struct aim_oft_info *oft_info;
+	PeerInfo *oft_info;
 	const char *ip;
 	gboolean use_rv_proxy;
 
@@ -2818,11 +2818,11 @@
 		gaim_xfer_request(xfer);
 }
 
-static int gaim_parse_auth_resp(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_auth_resp(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 	GaimAccount *account = gc->account;
-	aim_conn_t *bosconn;
+	OscarConnection *bosconn;
 	char *host; int port;
 	int i, rc;
 	va_list ap;
@@ -2972,7 +2972,7 @@
 {
 	GaimConnection *gc = user_data;
 	OscarData *od = gc->proto_data;
-	aim_session_t *sess = od->sess;
+	OscarSession *sess = od->sess;
 
 	aim_auth_securid_send(sess, msg);
 }
@@ -2990,7 +2990,7 @@
 }
 
 static int
-gaim_parse_auth_securid_request(aim_session_t *sess, aim_frame_t *fr, ...)
+gaim_parse_auth_securid_request(OscarSession *sess, FlapFrame *fr, ...)
 {
 	GaimConnection *gc = sess->aux_data;
 	GaimAccount *account = gaim_connection_get_account(gc);
@@ -3017,7 +3017,7 @@
 	unsigned long len;
 	char *modname;
 	int fd;
-	aim_conn_t *conn;
+	OscarConnection *conn;
 	unsigned int inpa;
 };
 
@@ -3098,7 +3098,7 @@
 /* size of icbmui.ocm, the largest module in AIM 3.5 */
 #define AIM_MAX_FILE_SIZE 98304
 
-int gaim_memrequest(aim_session_t *sess, aim_frame_t *fr, ...) {
+int gaim_memrequest(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	struct pieceofcrap *pos;
 	guint32 offset, len;
@@ -3171,10 +3171,10 @@
 	return 1;
 }
 
-static int gaim_parse_login(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_login(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	GaimAccount *account = gaim_connection_get_account(gc);
-	struct client_info_s info = CLIENTINFO_GAIM;
+	ClientInfo info = CLIENTINFO_GAIM;
 	va_list ap;
 	char *key;
 
@@ -3191,7 +3191,7 @@
 	return 1;
 }
 
-static int conninitdone_chat(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int conninitdone_chat(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	struct chat_connection *chatcon;
 	static int id = 1;
@@ -3211,7 +3211,7 @@
 	return 1;
 }
 
-static int conninitdone_chatnav(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int conninitdone_chatnav(OscarSession *sess, FlapFrame *fr, ...) {
 
 	aim_conn_addhandler(sess, fr->conn, 0x000d, 0x0001, gaim_parse_genericerr, 0);
 	aim_conn_addhandler(sess, fr->conn, OSCAR_FAMILY_CHATNAV, OSCAR_SUBTYPE_CHATNAV_INFO, gaim_chatnav_info, 0);
@@ -3223,7 +3223,7 @@
 	return 1;
 }
 
-static int conninitdone_email(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int conninitdone_email(OscarSession *sess, FlapFrame *fr, ...) {
 
 	aim_conn_addhandler(sess, fr->conn, 0x0018, 0x0001, gaim_parse_genericerr, 0);
 	aim_conn_addhandler(sess, fr->conn, OSCAR_FAMILY_ALERT, OSCAR_SUBTYPE_ALERT_MAILSTATUS, gaim_email_parseupdate, 0);
@@ -3235,7 +3235,7 @@
 	return 1;
 }
 
-static int conninitdone_icon(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int conninitdone_icon(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 
@@ -3257,8 +3257,8 @@
 static void oscar_chatnav_connect(gpointer data, gint source, GaimInputCondition cond) {
 	GaimConnection *gc = data;
 	OscarData *od;
-	aim_session_t *sess;
-	aim_conn_t *tstconn;
+	OscarSession *sess;
+	OscarConnection *tstconn;
 
 	if (!g_list_find(gaim_connections_get_all(), gc)) {
 		close(source);
@@ -3288,8 +3288,8 @@
 {
 	GaimConnection *gc = data;
 	OscarData *od;
-	aim_session_t *sess;
-	aim_conn_t *tstconn;
+	OscarSession *sess;
+	OscarConnection *tstconn;
 
 	if (!g_list_find(gaim_connections_get_all(), gc)) {
 		close(source);
@@ -3320,8 +3320,8 @@
 	struct chat_connection *ccon = data;
 	GaimConnection *gc = ccon->gc;
 	OscarData *od;
-	aim_session_t *sess;
-	aim_conn_t *tstconn;
+	OscarSession *sess;
+	OscarConnection *tstconn;
 
 	if (!g_list_find(gaim_connections_get_all(), gc)) {
 		close(source);
@@ -3355,8 +3355,8 @@
 static void oscar_email_connect(gpointer data, gint source, GaimInputCondition cond) {
 	GaimConnection *gc = data;
 	OscarData *od;
-	aim_session_t *sess;
-	aim_conn_t *tstconn;
+	OscarSession *sess;
+	OscarConnection *tstconn;
 
 	if (!g_list_find(gaim_connections_get_all(), gc)) {
 		close(source);
@@ -3385,8 +3385,8 @@
 static void oscar_icon_connect(gpointer data, gint source, GaimInputCondition cond) {
 	GaimConnection *gc = data;
 	OscarData *od;
-	aim_session_t *sess;
-	aim_conn_t *tstconn;
+	OscarSession *sess;
+	OscarConnection *tstconn;
 
 	if (!g_list_find(gaim_connections_get_all(), gc)) {
 		close(source);
@@ -3413,10 +3413,10 @@
 }
 
 /* Hrmph. I don't know how to make this look better. --mid */
-static int gaim_handle_redirect(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_handle_redirect(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	GaimAccount *account = gaim_connection_get_account(gc);
-	aim_conn_t *tstconn;
+	OscarConnection *tstconn;
 	int i;
 	char *host;
 	int port;
@@ -3575,7 +3575,7 @@
 	return 1;
 }
 
-static int gaim_parse_oncoming(aim_session_t *sess, aim_frame_t *fr, ...)
+static int gaim_parse_oncoming(OscarSession *sess, FlapFrame *fr, ...)
 {
 	GaimConnection *gc;
 	GaimAccount *account;
@@ -3743,7 +3743,7 @@
 		aim_locate_setcaps(od->sess, caps_aim | AIM_CAPS_SECUREIM);
 }
 
-static int gaim_parse_offgoing(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_offgoing(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 	GaimAccount *account = gaim_connection_get_account(gc);
@@ -3766,21 +3766,21 @@
  * This is called after a remote AIM user has connected to us.
  * If not using a rendezvous proxy, then we want to do some
  * voodoo with the socket file descriptors. Then we always
- * add a callback or two, and then send the OFT_TYPE_PROMPT.
+ * add a callback or two, and then send the PEER_TYPE_PROMPT.
  */
-static int oscar_sendfile_estblsh(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int oscar_sendfile_estblsh(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = (OscarData *)gc->proto_data;
 	GaimXfer *xfer;
-	struct aim_oft_info *oft_info;
+	PeerInfo *oft_info;
 	va_list ap;
-	aim_conn_t *conn, *listenerconn;
+	OscarConnection *conn, *listenerconn;
 
 	gaim_debug_info("oscar", "AAA - in oscar_sendfile_estblsh\n");
 
 	va_start(ap, fr);
-	conn = va_arg(ap, aim_conn_t *);
-	listenerconn = va_arg(ap, aim_conn_t *);
+	conn = va_arg(ap, OscarConnection *);
+	listenerconn = va_arg(ap, OscarConnection *);
 	va_end(ap);
 
 	/* Finding by conn will work for proxied connections only
@@ -3813,13 +3813,13 @@
 	xfer->watcher = gaim_input_add(oft_info->conn->fd, GAIM_INPUT_READ, oscar_callback, oft_info->conn);
 
 	if(oft_info->send_or_recv == AIM_XFER_SEND) {
-		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, OFT_TYPE_ACK,
+		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, PEER_TYPE_ACK,
 			oscar_sendfile_ack, 0);
-		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, OFT_TYPE_DONE,
+		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, PEER_TYPE_DONE,
 			oscar_sendfile_done, 0);
 
 		/* Inform the other user that we are connected and ready to transfer */
-		aim_oft_sendheader(sess, OFT_TYPE_PROMPT, oft_info);
+		aim_oft_sendheader(sess, PEER_TYPE_PROMPT, oft_info);
 	}
 
 	/* For a file send, we'll hopefully end up in oscar_sendfile_ack next
@@ -3836,7 +3836,7 @@
  */
 static void oscar_sendfile_connected(gpointer data, gint source, GaimInputCondition condition) {
 	GaimXfer *xfer;
-	struct aim_oft_info *oft_info;
+	PeerInfo *oft_info;
 
 	gaim_debug_info("oscar", "AAA - in oscar_sendfile_connected\n");
 	if (!(xfer = data))
@@ -3875,13 +3875,13 @@
 	/* Don't wait around if this is a redirected send */
 	if(oft_info->send_or_recv == AIM_XFER_SEND) {
 		/* We should only get here if this is a redirected file send */
-		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, OFT_TYPE_ACK,
+		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, PEER_TYPE_ACK,
 			oscar_sendfile_ack, 0);
-		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, OFT_TYPE_DONE,
+		aim_conn_addhandler(oft_info->sess, oft_info->conn, AIM_CB_FAM_OFT, PEER_TYPE_DONE,
 			oscar_sendfile_done, 0);
 
 		/* Inform the other user that we are ready to transfer */
-		aim_oft_sendheader(oft_info->sess, OFT_TYPE_PROMPT, oft_info);
+		aim_oft_sendheader(oft_info->sess, PEER_TYPE_PROMPT, oft_info);
 	}
 }
 
@@ -3891,22 +3891,22 @@
  * You should send them the exact same info except use the real cookie.  We also
  * get like totally ready to like, receive the file, kay?
  */
-static int oscar_sendfile_prompt(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int oscar_sendfile_prompt(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 	GaimXfer *xfer;
-	struct aim_oft_info *oft_info;
+	PeerInfo *oft_info;
 	va_list ap;
-	aim_conn_t *conn;
+	OscarConnection *conn;
 	guint8 *cookie;
-	struct aim_fileheader_t *fh;
+	PeerFrame *fh;
 
 	gaim_debug_info("oscar", "AAA - in oscar_sendfile_prompt\n");
 
 	va_start(ap, fr);
-	conn = va_arg(ap, aim_conn_t *);
+	conn = va_arg(ap, OscarConnection *);
 	cookie = va_arg(ap, guint8 *);
-	fh = va_arg(ap, struct aim_fileheader_t *);
+	fh = va_arg(ap, PeerFrame *);
 	va_end(ap);
 
 	if (!(xfer = oscar_find_xfer_by_conn(od->file_transfers, conn)))
@@ -3926,7 +3926,7 @@
 	memcpy(&oft_info->fh.bcookie, oft_info->cookie, 8);
 
 	/* XXX - convert the name from UTF-8 to UCS-2 if necessary, and pass the encoding to the call below */
-	aim_oft_sendheader(oft_info->sess, OFT_TYPE_ACK, oft_info);
+	aim_oft_sendheader(oft_info->sess, PEER_TYPE_ACK, oft_info);
 	gaim_xfer_start(xfer, xfer->fd, NULL, 0);
 
 	return 0;
@@ -3936,20 +3936,20 @@
  * We are sending a file to someone else.  They have just acknowledged our
  * prompt, so we want to start sending data like there's no tomorrow.
  */
-static int oscar_sendfile_ack(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int oscar_sendfile_ack(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 	GaimXfer *xfer;
 	va_list ap;
-	aim_conn_t *conn;
+	OscarConnection *conn;
 	guint8 *cookie;
-	struct aim_fileheader_t *fh;
+	PeerFrame *fh;
 
 	gaim_debug_info("oscar", "AAA - in oscar_sendfile_ack\n");
 	va_start(ap, fr);
-	conn = va_arg(ap, aim_conn_t *);
+	conn = va_arg(ap, OscarConnection *);
 	cookie = va_arg(ap, guint8 *);
-	fh = va_arg(ap, struct aim_fileheader_t *);
+	fh = va_arg(ap, PeerFrame *);
 	va_end(ap);
 
 	if (!(xfer = oscar_find_xfer_by_cookie(od->file_transfers, cookie)))
@@ -3968,21 +3968,21 @@
  * We just sent a file to someone.  They said they got it and everything,
  * so we can close our direct connection and what not.
  */
-static int oscar_sendfile_done(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int oscar_sendfile_done(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 	GaimXfer *xfer;
 	va_list ap;
-	aim_conn_t *conn;
+	OscarConnection *conn;
 	guint8 *cookie;
-	struct aim_fileheader_t *fh;
-	struct aim_oft_info *oft_info;
+	PeerFrame *fh;
+	PeerInfo *oft_info;
 
 	gaim_debug_info("oscar", "AAA - in oscar_sendfile_done\n");
 	va_start(ap, fr);
-	conn = va_arg(ap, aim_conn_t *);
+	conn = va_arg(ap, OscarConnection *);
 	cookie = va_arg(ap, guint8 *);
-	fh = va_arg(ap, struct aim_fileheader_t *);
+	fh = va_arg(ap, PeerFrame *);
 	va_end(ap);
 
 	if (!(xfer = oscar_find_xfer_by_conn(od->file_transfers, conn))) {
@@ -4002,7 +4002,7 @@
 	return 0;
 }
 
-static int incomingim_chan1(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) {
+static int incomingim_chan1(OscarSession *sess, OscarConnection *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 	GaimAccount *account = gaim_connection_get_account(gc);
@@ -4140,7 +4140,7 @@
 	return 1;
 }
 
-static int incomingim_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args) {
+static int incomingim_chan2(OscarSession *sess, OscarConnection *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args) {
 	GaimConnection *gc;
 	GaimAccount *account;
 	OscarData *od;
@@ -4203,8 +4203,8 @@
 			&& (args->info.sendfile.reqnum == 0x0001)) {
 			/* Someone wants to send a file (or files) to us */
 			GaimXfer *xfer;
-			struct aim_oft_info *oft_info;
-			struct aim_rv_proxy_info *proxy_info = NULL;
+			PeerInfo *oft_info;
+			PeerProxyInfo *proxy_info = NULL;
 			gboolean use_rv_proxy;
 			int proxy_stage;
 			int xfer_method;
@@ -4322,7 +4322,7 @@
 			/* We have asked to send a file to someone else, but they sent us a reply request
 			 * asking us to use an alternative method of connecting */
 			GaimXfer *xfer;
-			struct aim_oft_info *oft_info;
+			PeerInfo *oft_info;
 
 			if ((xfer = oscar_find_xfer_by_cookie(od->file_transfers, args->cookie))) {
 				oft_info = xfer->data;
@@ -4394,7 +4394,7 @@
 			 * proxy. They did the initial proxy login and have sent us the info in a
 			 * third file transfer request. */
 			GaimXfer *xfer;
-			struct aim_oft_info *oft_info;
+			PeerInfo *oft_info;
 
 			if ((xfer = oscar_find_xfer_by_cookie(od->file_transfers, args->cookie))) {
 				oft_info = xfer->data;
@@ -4642,7 +4642,7 @@
 	oscar_free_name_data(data);
 }
 
-static int incomingim_chan4(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch4_args *args, time_t t) {
+static int incomingim_chan4(OscarSession *sess, OscarConnection *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch4_args *args, time_t t) {
 	GaimConnection *gc = sess->aux_data;
 	GaimAccount *account = gaim_connection_get_account(gc);
 	gchar **msg1, **msg2;
@@ -4840,7 +4840,7 @@
 	return 1;
 }
 
-static int gaim_parse_incoming_im(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_incoming_im(OscarSession *sess, FlapFrame *fr, ...) {
 	guint16 channel;
 	int ret = 0;
 	aim_userinfo_t *userinfo;
@@ -4881,7 +4881,7 @@
 	return ret;
 }
 
-static int gaim_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_misses(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	GaimAccount *account = gaim_connection_get_account(gc);
 	char *buf;
@@ -4960,7 +4960,7 @@
 	return 1;
 }
 
-static int gaim_parse_clientauto_ch2(aim_session_t *sess, const char *who, guint16 reason, const guchar *cookie) {
+static int gaim_parse_clientauto_ch2(OscarSession *sess, const char *who, guint16 reason, const guchar *cookie) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 
@@ -4992,7 +4992,7 @@
 	return 0;
 }
 
-static int gaim_parse_clientauto_ch4(aim_session_t *sess, char *who, guint16 reason, guint32 state, char *msg) {
+static int gaim_parse_clientauto_ch4(OscarSession *sess, char *who, guint16 reason, guint32 state, char *msg) {
 	GaimConnection *gc = sess->aux_data;
 
 	switch(reason) {
@@ -5024,7 +5024,7 @@
 	return 0;
 }
 
-static int gaim_parse_clientauto(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_clientauto(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	guint16 chan, reason;
 	char *who;
@@ -5052,7 +5052,7 @@
 	return 1;
 }
 
-static int gaim_parse_genericerr(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_genericerr(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	guint16 reason;
 	char *m;
@@ -5073,7 +5073,7 @@
 	return 1;
 }
 
-static int gaim_parse_msgerr(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_msgerr(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 #if 0
 	OscarData *od = gc->proto_data;
@@ -5114,7 +5114,7 @@
 	return 1;
 }
 
-static int gaim_parse_mtn(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_mtn(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	va_list ap;
 	guint16 type1, type2;
@@ -5151,7 +5151,7 @@
  * We get this error when there was an error in the locate family.  This 
  * happens when you request info of someone who is offline.
  */
-static int gaim_parse_locerr(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_locerr(OscarSession *sess, FlapFrame *fr, ...) {
 	gchar *buf;
 	va_list ap;
 	guint16 reason;
@@ -5176,7 +5176,7 @@
 	return 1;
 }
 
-static int gaim_parse_userinfo(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_userinfo(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	GaimAccount *account = gaim_connection_get_account(gc);
 	OscarData *od = gc->proto_data;
@@ -5258,7 +5258,7 @@
 	return 1;
 }
 
-static int gaim_got_infoblock(aim_session_t *sess, aim_frame_t *fr, ...)
+static int gaim_got_infoblock(OscarSession *sess, FlapFrame *fr, ...)
 {
 	GaimConnection *gc = sess->aux_data;
 	GaimBuddy *b;
@@ -5299,7 +5299,7 @@
 
 static gboolean gaim_reqinfo_timeout_cb(void *data)
 {
-	aim_session_t *sess = data;
+	OscarSession *sess = data;
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = (OscarData *)gc->proto_data;
 
@@ -5309,7 +5309,7 @@
 	return FALSE;
 }
 
-static int gaim_reqinfo_timeout(aim_session_t *sess, aim_frame_t *fr, ...)
+static int gaim_reqinfo_timeout(OscarSession *sess, FlapFrame *fr, ...)
 {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = (OscarData *)gc->proto_data;
@@ -5325,7 +5325,7 @@
 	return 1;
 }
 
-static int gaim_parse_motd(aim_session_t *sess, aim_frame_t *fr, ...)
+static int gaim_parse_motd(OscarSession *sess, FlapFrame *fr, ...)
 {
 	char *msg;
 	guint16 id;
@@ -5345,7 +5345,7 @@
 	return 1;
 }
 
-static int gaim_chatnav_info(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_chatnav_info(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	guint16 type;
 	GaimConnection *gc = sess->aux_data;
@@ -5424,7 +5424,7 @@
 	return 1;
 }
 
-static int gaim_conv_chat_join(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_conv_chat_join(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	int count, i;
 	aim_userinfo_t *info;
@@ -5447,7 +5447,7 @@
 	return 1;
 }
 
-static int gaim_conv_chat_leave(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_conv_chat_leave(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	int count, i;
 	aim_userinfo_t *info;
@@ -5470,7 +5470,7 @@
 	return 1;
 }
 
-static int gaim_conv_chat_info_update(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_conv_chat_info_update(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	aim_userinfo_t *userinfo;
 	struct aim_chat_roominfo *roominfo;
@@ -5506,7 +5506,7 @@
 	return 1;
 }
 
-static int gaim_conv_chat_incoming_msg(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_conv_chat_incoming_msg(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	struct chat_connection *ccon = find_oscar_chat_by_conn(gc, fr->conn);
 	gchar *utf8;
@@ -5533,7 +5533,7 @@
 	return 1;
 }
 
-static int gaim_email_parseupdate(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_email_parseupdate(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	GaimConnection *gc = sess->aux_data;
 	struct aim_emailinfo *emailinfo;
@@ -5562,7 +5562,7 @@
 	return 1;
 }
 
-static int gaim_icon_error(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_icon_error(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 	char *sn;
@@ -5580,7 +5580,7 @@
 	return 1;
 }
 
-static int gaim_icon_parseicon(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_icon_parseicon(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 	GSList *cur;
@@ -5636,7 +5636,7 @@
 	GaimConnection *gc = data;
 	OscarData *od = gc->proto_data;
 	aim_userinfo_t *userinfo;
-	aim_conn_t *conn;
+	OscarConnection *conn;
 
 	conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_ICON);
 	if (!conn) {
@@ -5696,7 +5696,7 @@
 /*
  * Recieved in response to an IM sent with the AIM_IMFLAGS_ACK option.
  */
-static int gaim_parse_msgack(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_msgack(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	guint16 type;
 	char *sn;
@@ -5711,7 +5711,7 @@
 	return 1;
 }
 
-static int gaim_parse_ratechange(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_ratechange(OscarSession *sess, FlapFrame *fr, ...) {
 	static const char *codes[5] = {
 		"invalid",
 		"change",
@@ -5764,7 +5764,7 @@
 	return 1;
 }
 
-static int gaim_parse_evilnotify(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_evilnotify(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	guint16 newevil;
 	aim_userinfo_t *userinfo;
@@ -5781,7 +5781,7 @@
 	return 1;
 }
 
-static int gaim_selfinfo(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_selfinfo(OscarSession *sess, FlapFrame *fr, ...) {
 	int warning_level;
 	va_list ap;
 	aim_userinfo_t *info;
@@ -5806,7 +5806,7 @@
 	return 1;
 }
 
-static int gaim_connerr(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_connerr(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 	va_list ap;
@@ -5853,7 +5853,7 @@
 	return 1;
 }
 
-static int conninitdone_bos(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int conninitdone_bos(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 
@@ -5876,7 +5876,7 @@
 	return 1;
 }
 
-static int conninitdone_admin(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int conninitdone_admin(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 
@@ -5924,7 +5924,7 @@
 	return 1;
 }
 
-static int gaim_icbm_param_info(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_icbm_param_info(OscarSession *sess, FlapFrame *fr, ...) {
 	struct aim_icbmparameters *params;
 	va_list ap;
 
@@ -5950,7 +5950,7 @@
 	return 1;
 }
 
-static int gaim_parse_locaterights(aim_session_t *sess, aim_frame_t *fr, ...)
+static int gaim_parse_locaterights(OscarSession *sess, FlapFrame *fr, ...)
 {
 	GaimConnection *gc = sess->aux_data;
 	GaimAccount *account = gaim_connection_get_account(gc);
@@ -5977,7 +5977,7 @@
 	return 1;
 }
 
-static int gaim_parse_buddyrights(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_buddyrights(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	guint16 maxbuddies, maxwatchers;
 	GaimConnection *gc = sess->aux_data;
@@ -5997,7 +5997,7 @@
 	return 1;
 }
 
-static int gaim_bosrights(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_bosrights(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc;
 	OscarData *od;
 	GaimAccount *account;
@@ -6055,7 +6055,7 @@
 	return 1;
 }
 
-static int gaim_offlinemsg(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_offlinemsg(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	struct aim_icq_offlinemsg *msg;
 	struct aim_incomingim_ch4_args args;
@@ -6078,13 +6078,13 @@
 	return 1;
 }
 
-static int gaim_offlinemsgdone(aim_session_t *sess, aim_frame_t *fr, ...)
+static int gaim_offlinemsgdone(OscarSession *sess, FlapFrame *fr, ...)
 {
 	aim_icq_ackofflinemsgs(sess);
 	return 1;
 }
 
-static int gaim_icqinfo(aim_session_t *sess, aim_frame_t *fr, ...)
+static int gaim_icqinfo(OscarSession *sess, FlapFrame *fr, ...)
 {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = (OscarData *)gc->proto_data;
@@ -6199,7 +6199,7 @@
 	return 1;
 }
 
-static int gaim_icqalias(aim_session_t *sess, aim_frame_t *fr, ...)
+static int gaim_icqalias(OscarSession *sess, FlapFrame *fr, ...)
 {
 	GaimConnection *gc = sess->aux_data;
 	GaimAccount *account = gaim_connection_get_account(gc);
@@ -6224,7 +6224,7 @@
 	return 1;
 }
 
-static int gaim_popup(aim_session_t *sess, aim_frame_t *fr, ...)
+static int gaim_popup(OscarSession *sess, FlapFrame *fr, ...)
 {
 	GaimConnection *gc = sess->aux_data;
 	gchar *text;
@@ -6253,7 +6253,7 @@
 								 g_list_nth_data(row, 0), NULL, NULL);
 }
 
-static int gaim_parse_searchreply(aim_session_t *sess, aim_frame_t *fr, ...)
+static int gaim_parse_searchreply(OscarSession *sess, FlapFrame *fr, ...)
 {
 	GaimConnection *gc = sess->aux_data;
 	GaimNotifySearchResults *results;
@@ -6303,7 +6303,7 @@
 	return 1;
 }
 
-static int gaim_parse_searcherror(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_parse_searcherror(OscarSession *sess, FlapFrame *fr, ...) {
 	va_list ap;
 	char *email;
 	char *buf;
@@ -6319,7 +6319,7 @@
 	return 1;
 }
 
-static int gaim_account_confirm(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_account_confirm(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	guint16 status;
 	va_list ap;
@@ -6341,7 +6341,7 @@
 	return 1;
 }
 
-static int gaim_info_change(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_info_change(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	va_list ap;
 	guint16 perms, err;
@@ -6446,7 +6446,7 @@
 	return 0;
 }
 
-static int gaim_odc_send_im(aim_session_t *, aim_conn_t *, const char *, GaimMessageFlags);
+static int gaim_odc_send_im(OscarSession *, OscarConnection *, const char *, GaimMessageFlags);
 
 static int oscar_send_im(GaimConnection *gc, const char *name, const char *message, GaimMessageFlags imflags) {
 	OscarData *od = (OscarData *)gc->proto_data;
@@ -6940,14 +6940,14 @@
 }
 
 static gboolean gaim_ssi_rerequestdata(gpointer data) {
-	aim_session_t *sess = data;
+	OscarSession *sess = data;
 
 	aim_ssi_reqdata(sess);
 
 	return TRUE;
 }
 
-static int gaim_ssi_parseerr(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_ssi_parseerr(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 	va_list ap;
@@ -6978,7 +6978,7 @@
 	return 1;
 }
 
-static int gaim_ssi_parserights(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_ssi_parserights(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = (OscarData *)gc->proto_data;
 	int i;
@@ -7011,7 +7011,7 @@
 	return 1;
 }
 
-static int gaim_ssi_parselist(aim_session_t *sess, aim_frame_t *fr, ...)
+static int gaim_ssi_parselist(OscarSession *sess, FlapFrame *fr, ...)
 {
 	GaimConnection *gc;
 	OscarData *od;
@@ -7238,7 +7238,7 @@
 	return 1;
 }
 
-static int gaim_ssi_parseack(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_ssi_parseack(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	va_list ap;
 	struct aim_ssi_tmp *retval;
@@ -7285,7 +7285,7 @@
 	return 1;
 }
 
-static int gaim_ssi_parseadd(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_ssi_parseadd(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	char *gname, *gname_utf8, *alias, *alias_utf8;
 	GaimBuddy *b;
@@ -7333,7 +7333,7 @@
 	return 1;
 }
 
-static int gaim_ssi_authgiven(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_ssi_authgiven(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	va_list ap;
 	char *sn, *msg;
@@ -7372,7 +7372,7 @@
 	return 1;
 }
 
-static int gaim_ssi_authrequest(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_ssi_authrequest(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	va_list ap;
 	char *sn;
@@ -7425,7 +7425,7 @@
 	return 1;
 }
 
-static int gaim_ssi_authreply(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_ssi_authreply(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	va_list ap;
 	char *sn, *msg;
@@ -7463,7 +7463,7 @@
 	return 1;
 }
 
-static int gaim_ssi_gotadded(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int gaim_ssi_gotadded(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	va_list ap;
 	char *sn;
@@ -7521,7 +7521,7 @@
 
 static void oscar_join_chat(GaimConnection *gc, GHashTable *data) {
 	OscarData *od = (OscarData *)gc->proto_data;
-	aim_conn_t *cur;
+	OscarConnection *cur;
 	char *name, *exchange;
 
 	name = g_hash_table_lookup(data, "room");
@@ -7821,7 +7821,7 @@
 }
 
 
-static int oscar_icon_req(aim_session_t *sess, aim_frame_t *fr, ...) {
+static int oscar_icon_req(OscarSession *sess, FlapFrame *fr, ...) {
 	GaimConnection *gc = sess->aux_data;
 	OscarData *od = gc->proto_data;
 	va_list ap;
@@ -8219,7 +8219,7 @@
 {
 	GaimConnection *gc = (GaimConnection *) action->context;
 	OscarData *od = gc->proto_data;
-	aim_conn_t *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH);
+	OscarConnection *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH);
 
 	if (conn) {
 		aim_admin_reqconfirm(od->sess, conn);
@@ -8233,7 +8233,7 @@
 {
 	GaimConnection *gc = (GaimConnection *) action->context;
 	OscarData *od = gc->proto_data;
-	aim_conn_t *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH);
+	OscarConnection *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH);
 
 	if (conn) {
 		aim_admin_getinfo(od->sess, conn, 0x11);
@@ -8246,7 +8246,7 @@
 static void oscar_change_email(GaimConnection *gc, const char *email)
 {
 	OscarData *od = gc->proto_data;
-	aim_conn_t *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH);
+	OscarConnection *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH);
 
 	if (conn) {
 		aim_admin_setemail(od->sess, conn, email);
@@ -8371,7 +8371,7 @@
 static void oscar_set_icon(GaimConnection *gc, const char *iconfile)
 {
 	OscarData *od = gc->proto_data;
-	aim_session_t *sess = od->sess;
+	OscarSession *sess = od->sess;
 	FILE *file;
 	struct stat st;
 
@@ -8498,7 +8498,7 @@
 	if (od->icq) {
 		aim_icq_changepasswd(od->sess, new);
 	} else {
-		aim_conn_t *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH);
+		OscarConnection *conn = aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH);
 		if (conn) {
 			aim_admin_changepasswd(od->sess, conn, new, old);
 		} else {
@@ -8527,7 +8527,7 @@
 {
 	GaimConnection *gc = data;
 	OscarData *od = gc->proto_data;
-	aim_session_t *sess = od->sess;
+	OscarSession *sess = od->sess;
 	guint32 presence;
 
 	presence = aim_ssi_getpresence(sess->ssi.local);
--- a/src/protocols/oscar/oscar.h	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/oscar.h	Sun Feb 12 16:02:05 2006 +0000
@@ -29,8 +29,6 @@
 #ifndef _OSCAR_H_
 #define _OSCAR_H_
 
-#include "snactypes.h"
-
 #include "debug.h"
 #include "internal.h"
 
@@ -53,13 +51,23 @@
 #include "libc_interface.h"
 #endif
 
+typedef struct _ByteStream         ByteStream;
+typedef struct _ClientInfo         ClientInfo;
+typedef struct _FlapFrame          FlapFrame;
+typedef struct _IcbmCookie         IcbmCookie;
+typedef struct _OscarConnection    OscarConnection;
+typedef struct _OscarSession       OscarSession;
+
+typedef guint32 aim_snacid_t;
+typedef guint16 flap_seqnum_t;
+
+#include "peer.h"
+#include "snactypes.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-typedef guint32 aim_snacid_t;
-typedef guint16 flap_seqnum_t;
-
 #define WIN32_STATIC
 #if defined(_WIN32) && !defined(WIN32_STATIC)
 /*
@@ -82,14 +90,6 @@
 #define faim_internal
 #endif
 
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#ifndef TRUE
-#define TRUE (!FALSE)
-#endif
-
 #define FAIM_SNAC_HASH_SIZE 16
 
 /*
@@ -127,7 +127,7 @@
  * Current Maximum Length for Chat Room Messages
  *
  * This is actually defined by the protocol to be
- * dynamic, but I have yet to see due cause to 
+ * dynamic, but I have yet to see due cause to
  * define it dynamically here.  Maybe later.
  *
  */
@@ -141,12 +141,13 @@
 #define AIM_MD5_STRING "AOL Instant Messenger (SM)"
 
 /*
- * Client info.  Filled in by the client and passed in to 
+ * Client info.  Filled in by the client and passed in to
  * aim_send_login().  The information ends up getting passed to OSCAR
  * through the initial login command.
  *
  */
-struct client_info_s {
+struct _ClientInfo
+{
 	const char *clientstring;
 	guint16 clientid;
 	guint16 major;
@@ -386,7 +387,8 @@
 #define AIM_FRAMETYPE_FLAP		0x0000
 #define AIM_FRAMETYPE_OFT		0x0001
 
-typedef struct aim_conn_s {
+struct _OscarConnection
+{
 	int fd;
 	guint16 type;
 	guint16 subtype;
@@ -399,8 +401,8 @@
 	void *handlerlist;
 	void *sessv; /* pointer to parent session */
 	void *inside; /* only accessible from inside libfaim */
-	struct aim_conn_s *next;
-} aim_conn_t;
+	struct _OscarConnection *next;
+};
 
 /*
  * Byte Stream type. Sort of.
@@ -416,13 +418,15 @@
  * Don't touch the insides of this struct.  Or I'll have to kill you.
  *
  */
-typedef struct aim_bstream_s {
+struct _ByteStream
+{
 	guint8 *data;
 	guint32 len;
 	guint32 offset;
-} aim_bstream_t;
+};
 
-typedef struct aim_frame_s {
+struct _FlapFrame
+{
 	guint8 hdrtype; /* defines which piece of the union to use */
 	union {
 		struct {
@@ -435,25 +439,27 @@
 			guint16 type;
 		} rend;
 	} hdr;
-	aim_bstream_t data;		/* payload stream */
-	aim_conn_t *conn;		/* the connection it came in on/is going out on */
+	ByteStream data;		/* payload stream */
+	OscarConnection *conn;		/* the connection it came in on/is going out on */
 	guint8 handled;			/* 0 = new, !0 = been handled */
-	struct aim_frame_s *next;
-} aim_frame_t;
+	struct _FlapFrame *next;
+};
 
-typedef struct aim_msgcookie_s {
+struct _IcbmCookie
+{
 	guchar cookie[8];
 	int type;
 	void *data;
 	time_t addtime;
-	struct aim_msgcookie_s *next;
-} aim_msgcookie_t;
+	struct _IcbmCookie *next;
+};
 
 /*
  * AIM Session: The main client-data interface.
  *
  */
-typedef struct aim_session_s {
+struct _OscarSession
+{
 
 	/* ---- Client Accessible ------------------------ */
 
@@ -461,7 +467,7 @@
 	char sn[MAXSNLEN+1];
 
 	/*
-	 * Pointer to anything the client wants to 
+	 * Pointer to anything the client wants to
 	 * explicitly associate with this session.
 	 *
 	 * This is for use in the callbacks mainly. In any
@@ -473,7 +479,7 @@
 	/* ---- Internal Use Only ------------------------ */
 
 	/* Connection information */
-	aim_conn_t *connlist;
+	OscarConnection *connlist;
 
 	/*
 	 * Transmit/receive queues.
@@ -481,10 +487,10 @@
 	 * These are only used when you don't use your own lowlevel
 	 * I/O.  I don't suggest that you use libfaim's internal I/O.
 	 * Its really bad and the API/event model is quirky at best.
-	 *  
+	 *
 	 */
-	aim_frame_t *queue_outgoing;
-	aim_frame_t *queue_incoming;
+	FlapFrame *queue_outgoing;
+	FlapFrame *queue_incoming;
 
 	/*
 	 * Tx Enqueuing function.
@@ -494,7 +500,7 @@
 	 * to send something.
 	 *
 	 */
-	int (*tx_enqueue)(struct aim_session_s *, aim_frame_t *);
+	int (*tx_enqueue)(OscarSession *, FlapFrame *);
 
 	void *modlistv;
 
@@ -514,9 +520,9 @@
 	void *snac_hash[FAIM_SNAC_HASH_SIZE];
 	aim_snacid_t snacid_next;
 
-	aim_msgcookie_t *msgcookies;
+	IcbmCookie *msgcookies;
 	struct aim_icq_info *icq_info;
-	struct aim_oft_info *oft_info;
+	PeerInfo *oft_info;
 	struct aim_authresp_info *authinfo;
 	struct aim_emailinfo *emailinfo;
 
@@ -537,7 +543,7 @@
 		time_t timestamp;
 		int waiting_for_ack;
 	} ssi;
-} aim_session_t;
+};
 
 /* Valid for calling aim_icq_setstatus() and for aim_userinfo_t->icqinfo.status */
 #define AIM_ICQ_STATE_NORMAL		0x00000000
@@ -562,32 +568,34 @@
  * XXX Make this easily overridable.
  *
  */
-faim_export int aim_get_command(aim_session_t *, aim_conn_t *);
+faim_export int aim_get_command(OscarSession *, OscarConnection *);
 
 /*
  * Dispatch commands that are in the rx queue.
  */
-faim_export void aim_rxdispatch(aim_session_t *);
+faim_export void aim_rxdispatch(OscarSession *);
 
-faim_export int aim_debugconn_sendconnect(aim_session_t *sess, aim_conn_t *conn);
+faim_export int aim_debugconn_sendconnect(OscarSession *sess, OscarConnection *conn);
 
-faim_export int aim_logoff(aim_session_t *);
+faim_export int aim_logoff(OscarSession *);
 
 /* the library should never call aim_conn_kill */
-faim_export void aim_conn_kill(aim_session_t *sess, aim_conn_t **deadconn);
+faim_export void aim_conn_kill(OscarSession *sess, OscarConnection **deadconn);
 
-typedef int (*aim_rxcallback_t)(aim_session_t *, aim_frame_t *, ...);
+typedef int (*aim_rxcallback_t)(OscarSession *, FlapFrame *, ...);
 
 
-/* auth.c */
-struct aim_clientrelease {
+/* family_auth.c */
+struct aim_clientrelease
+{
 	char *name;
 	guint32 build;
 	char *url;
 	char *info;
 };
 
-struct aim_authresp_info {
+struct aim_authresp_info
+{
 	char *sn;
 	guint16 errorcode;
 	char *errorurl;
@@ -602,7 +610,8 @@
 };
 
 /* Callback data for redirect. */
-struct aim_redirect_data {
+struct aim_redirect_data
+{
 	guint16 group;
 	const char *ip;
 	guint16 cookielen;
@@ -614,47 +623,47 @@
 	} chat;
 };
 
-faim_export int aim_clientready(aim_session_t *sess, aim_conn_t *conn);
-faim_export int aim_sendflapver(aim_session_t *sess, aim_conn_t *conn);
-faim_export int aim_request_login(aim_session_t *sess, aim_conn_t *conn, const char *sn);
-faim_export int aim_send_login(aim_session_t *, aim_conn_t *, const char *, const char *, struct client_info_s *, const char *key);
-/* 0x000b */ faim_export int aim_auth_securid_send(aim_session_t *sess, const char *securid);
+faim_export int aim_clientready(OscarSession *sess, OscarConnection *conn);
+faim_export int aim_sendflapver(OscarSession *sess, OscarConnection *conn);
+faim_export int aim_request_login(OscarSession *sess, OscarConnection *conn, const char *sn);
+faim_export int aim_send_login(OscarSession *, OscarConnection *, const char *, const char *, ClientInfo *, const char *key);
+/* 0x000b */ faim_export int aim_auth_securid_send(OscarSession *sess, const char *securid);
 
-faim_export void aim_purge_rxqueue(aim_session_t *);
-faim_export void aim_cleansnacs(aim_session_t *, int maxage);
+faim_export void aim_purge_rxqueue(OscarSession *);
+faim_export void aim_cleansnacs(OscarSession *, int maxage);
 
 #define AIM_TX_QUEUED    0 /* default */
 #define AIM_TX_IMMEDIATE 1
 #define AIM_TX_USER      2
-faim_export int aim_tx_setenqueue(aim_session_t *sess, int what, int (*func)(aim_session_t *, aim_frame_t *));
+faim_export int aim_tx_setenqueue(OscarSession *sess, int what, int (*func)(OscarSession *, FlapFrame *));
 
-faim_export int aim_tx_flushqueue(aim_session_t *);
-faim_export void aim_tx_purgequeue(aim_session_t *);
+faim_export int aim_tx_flushqueue(OscarSession *);
+faim_export void aim_tx_purgequeue(OscarSession *);
 
-faim_export int aim_conn_setlatency(aim_conn_t *conn, int newval);
+faim_export int aim_conn_setlatency(OscarConnection *conn, int newval);
 
-faim_export int aim_conn_addhandler(aim_session_t *, aim_conn_t *conn, guint16 family, guint16 type, aim_rxcallback_t newhandler, guint16 flags);
-faim_export int aim_clearhandlers(aim_conn_t *conn);
+faim_export int aim_conn_addhandler(OscarSession *, OscarConnection *conn, guint16 family, guint16 type, aim_rxcallback_t newhandler, guint16 flags);
+faim_export int aim_clearhandlers(OscarConnection *conn);
 
-faim_export aim_conn_t *aim_conn_findbygroup(aim_session_t *sess, guint16 group);
-faim_export aim_session_t *aim_conn_getsess(aim_conn_t *conn);
-faim_export void aim_conn_close(aim_conn_t *deadconn);
-faim_export aim_conn_t *aim_newconn(aim_session_t *, int type);
-faim_export int aim_conn_in_sess(aim_session_t *sess, aim_conn_t *conn);
-faim_export int aim_conn_isready(aim_conn_t *);
-faim_export int aim_conn_setstatus(aim_conn_t *, int);
-faim_export int aim_conn_completeconnect(aim_session_t *sess, aim_conn_t *conn);
-faim_export int aim_conn_isconnecting(aim_conn_t *conn);
+faim_export OscarConnection *aim_conn_findbygroup(OscarSession *sess, guint16 group);
+faim_export OscarSession *aim_conn_getsess(OscarConnection *conn);
+faim_export void aim_conn_close(OscarConnection *deadconn);
+faim_export OscarConnection *aim_newconn(OscarSession *, int type);
+faim_export int aim_conn_in_sess(OscarSession *sess, OscarConnection *conn);
+faim_export int aim_conn_isready(OscarConnection *);
+faim_export int aim_conn_setstatus(OscarConnection *, int);
+faim_export int aim_conn_completeconnect(OscarSession *sess, OscarConnection *conn);
+faim_export int aim_conn_isconnecting(OscarConnection *conn);
 
-faim_export void aim_session_init(aim_session_t *, guint8 nonblocking);
-faim_export void aim_session_kill(aim_session_t *);
-faim_export aim_conn_t *aim_getconn_type(aim_session_t *, int type);
-faim_export aim_conn_t *aim_getconn_type_all(aim_session_t *, int type);
-faim_export aim_conn_t *aim_getconn_fd(aim_session_t *, int fd);
+faim_export void aim_session_init(OscarSession *, guint8 nonblocking);
+faim_export void aim_session_kill(OscarSession *);
+faim_export OscarConnection *aim_getconn_type(OscarSession *, int type);
+faim_export OscarConnection *aim_getconn_type_all(OscarSession *, int type);
+faim_export OscarConnection *aim_getconn_fd(OscarSession *, int fd);
 
-/* 0x0001 - service.c */
-faim_export int aim_srv_setstatusmsg(aim_session_t *sess, const char *msg);
-faim_export int aim_srv_setidle(aim_session_t *sess, guint32 idletime);
+/* 0x0001 - family_oservice.c */
+faim_export int aim_srv_setstatusmsg(OscarSession *sess, const char *msg);
+faim_export int aim_srv_setidle(OscarSession *sess, guint32 idletime);
 
 /* misc.c */
 
@@ -668,16 +677,16 @@
 
 #define AIM_WARN_ANON                     0x01
 
-faim_export int aim_sendpauseack(aim_session_t *sess, aim_conn_t *conn);
-faim_export int aim_nop(aim_session_t *, aim_conn_t *);
-faim_export int aim_flap_nop(aim_session_t *sess, aim_conn_t *conn);
-faim_export int aim_bos_changevisibility(aim_session_t *, aim_conn_t *, int, const char *);
-faim_export int aim_bos_setgroupperm(aim_session_t *, aim_conn_t *, guint32 mask);
-faim_export int aim_bos_setprivacyflags(aim_session_t *, aim_conn_t *, guint32);
-faim_export int aim_reqpersonalinfo(aim_session_t *, aim_conn_t *);
-faim_export int aim_reqservice(aim_session_t *, aim_conn_t *, guint16);
-faim_export int aim_bos_reqrights(aim_session_t *, aim_conn_t *);
-faim_export int aim_setextstatus(aim_session_t *sess, guint32 status);
+faim_export int aim_sendpauseack(OscarSession *sess, OscarConnection *conn);
+faim_export int aim_nop(OscarSession *, OscarConnection *);
+faim_export int aim_flap_nop(OscarSession *sess, OscarConnection *conn);
+faim_export int aim_bos_changevisibility(OscarSession *, OscarConnection *, int, const char *);
+faim_export int aim_bos_setgroupperm(OscarSession *, OscarConnection *, guint32 mask);
+faim_export int aim_bos_setprivacyflags(OscarSession *, OscarConnection *, guint32);
+faim_export int aim_reqpersonalinfo(OscarSession *, OscarConnection *);
+faim_export int aim_reqservice(OscarSession *, OscarConnection *, guint16);
+faim_export int aim_bos_reqrights(OscarSession *, OscarConnection *);
+faim_export int aim_setextstatus(OscarSession *sess, guint32 status);
 
 #define AIM_CLIENTTYPE_UNKNOWN  0x0000
 #define AIM_CLIENTTYPE_MC       0x0001
@@ -690,11 +699,11 @@
 #define AIM_RATE_CODE_WARNING    0x0002
 #define AIM_RATE_CODE_LIMIT      0x0003
 #define AIM_RATE_CODE_CLEARLIMIT 0x0004
-faim_export int aim_ads_requestads(aim_session_t *sess, aim_conn_t *conn);
+faim_export int aim_ads_requestads(OscarSession *sess, OscarConnection *conn);
 
 
 
-/* im.c */
+/* family_icbm.c */
 #define AIM_OFT_SUBTYPE_SEND_FILE	0x0001
 #define AIM_OFT_SUBTYPE_SEND_DIR	0x0002
 #define AIM_OFT_SUBTYPE_GET_FILE	0x0011
@@ -725,7 +734,8 @@
 	0 \
 }
 
-struct aim_icbmparameters {
+struct aim_icbmparameters
+{
 	guint16 maxchan;
 	guint32 flags; /* AIM_IMPARAM_FLAG_ */
 	guint16 maxmsglen; /* message size that you will accept */
@@ -734,7 +744,8 @@
 	guint32 minmsginterval; /* in milliseconds? */
 };
 
-struct aim_chat_roominfo {
+struct aim_chat_roominfo
+{
 	guint16 exchange;
 	char *name;
 	guint16 instance;
@@ -759,7 +770,8 @@
 /*
  * Multipart message structures.
  */
-typedef struct aim_mpmsg_section_s {
+typedef struct aim_mpmsg_section_s
+{
 	guint16 charset;
 	guint16 charsubset;
 	gchar *data;
@@ -767,16 +779,17 @@
 	struct aim_mpmsg_section_s *next;
 } aim_mpmsg_section_t;
 
-typedef struct aim_mpmsg_s {
+typedef struct aim_mpmsg_s
+{
 	unsigned int numparts;
 	aim_mpmsg_section_t *parts;
 } aim_mpmsg_t;
 
-faim_export int aim_mpmsg_init(aim_session_t *sess, aim_mpmsg_t *mpm);
-faim_export int aim_mpmsg_addraw(aim_session_t *sess, aim_mpmsg_t *mpm, guint16 charset, guint16 charsubset, const gchar *data, guint16 datalen);
-faim_export int aim_mpmsg_addascii(aim_session_t *sess, aim_mpmsg_t *mpm, const char *ascii);
-faim_export int aim_mpmsg_addunicode(aim_session_t *sess, aim_mpmsg_t *mpm, const guint16 *unicode, guint16 unicodelen);
-faim_export void aim_mpmsg_free(aim_session_t *sess, aim_mpmsg_t *mpm);
+faim_export int aim_mpmsg_init(OscarSession *sess, aim_mpmsg_t *mpm);
+faim_export int aim_mpmsg_addraw(OscarSession *sess, aim_mpmsg_t *mpm, guint16 charset, guint16 charsubset, const gchar *data, guint16 datalen);
+faim_export int aim_mpmsg_addascii(OscarSession *sess, aim_mpmsg_t *mpm, const char *ascii);
+faim_export int aim_mpmsg_addunicode(OscarSession *sess, aim_mpmsg_t *mpm, const guint16 *unicode, guint16 unicodelen);
+faim_export void aim_mpmsg_free(OscarSession *sess, aim_mpmsg_t *mpm);
 
 /*
  * Arguments to aim_send_im_ext().
@@ -784,7 +797,8 @@
  * This is really complicated.  But immensely versatile.
  *
  */
-struct aim_sendimext_args {
+struct aim_sendimext_args
+{
 
 	/* These are _required_ */
 	const char *destsn;
@@ -814,7 +828,8 @@
 /*
  * Arguments to aim_send_rtfmsg().
  */
-struct aim_sendrtfmsg_args {
+struct aim_sendrtfmsg_args
+{
 	const char *destsn;
 	guint32 fgcolor;
 	guint32 bgcolor;
@@ -823,7 +838,7 @@
 
 /*
  * This information is provided in the Incoming ICBM callback for
- * Channel 1 ICBM's.  
+ * Channel 1 ICBM's.
  *
  * Note that although CUSTOMFEATURES and CUSTOMCHARSET say they
  * are optional, both are always set by the current libfaim code.
@@ -831,15 +846,16 @@
  * consistency with aim_sendimext_args.
  *
  * Multipart messages require some explanation. If you want to use them,
- * I suggest you read all the comments in im.c.
+ * I suggest you read all the comments in family_icbm.c.
  *
  */
-struct aim_incomingim_ch1_args {
+struct aim_incomingim_ch1_args
+{
 
 	/* Always provided */
 	aim_mpmsg_t mpmsg;
 	guint32 icbmflags; /* some flags apply only to ->msg, not all mpmsg */
-	
+
 	/* Only provided if message has a human-readable section */
 	gchar *msg;
 	int msglen;
@@ -867,7 +883,8 @@
 #define AIM_RENDEZVOUS_CANCEL	0x0001
 #define AIM_RENDEZVOUS_ACCEPT	0x0002
 
-struct aim_incomingim_ch2_args {
+struct aim_incomingim_ch2_args
+{
 	guint16 status;
 	guchar cookie[8];
 	int reqclass;
@@ -914,7 +931,8 @@
 #define AIM_ICQMSG_AUTHDENIED	0x0007
 #define AIM_ICQMSG_AUTHGRANTED	0x0008
 
-struct aim_incomingim_ch4_args {
+struct aim_incomingim_ch4_args
+{
 	guint32 uin; /* Of the sender of the ICBM */
 	guint8 type;
 	guint8 flags;
@@ -923,26 +941,26 @@
 };
 
 /* SNAC sending functions */
-/* 0x0002 */ faim_export int aim_im_setparams(aim_session_t *sess, struct aim_icbmparameters *params);
-/* 0x0004 */ faim_export int aim_im_reqparams(aim_session_t *sess);
-/* 0x0006 */ faim_export int aim_im_sendch1_ext(aim_session_t *sess, struct aim_sendimext_args *args);
-/* 0x0006 */ faim_export int aim_im_sendch1(aim_session_t *, const char *destsn, guint16 flags, const char *msg);
-/* 0x0006 */ faim_export int aim_im_sendch2_chatinvite(aim_session_t *sess, const char *sn, const char *msg, guint16 exchange, const char *roomname, guint16 instance);
-/* 0x0006 */ faim_export int aim_im_sendch2_icon(aim_session_t *sess, const char *sn, const guint8 *icon, int iconlen, time_t stamp, guint16 iconsum);
-/* 0x0006 */ faim_export int aim_im_sendch2_rtfmsg(aim_session_t *sess, struct aim_sendrtfmsg_args *args);
-/* 0x0006 */ faim_export int aim_im_sendch2_odcrequest(aim_session_t *sess, guchar *cookie, gboolean usecookie, const char *sn, const guint8 *ip, guint16 port);
-/* 0x0006 */ faim_export int aim_im_sendch2_sendfile_ask(aim_session_t *sess, struct aim_oft_info *oft_info);
-/* 0x0006 */ faim_export int aim_im_sendch2_sendfile_accept(aim_session_t *sess, struct aim_oft_info *info);
-/* 0x0006 */ faim_export int aim_im_sendch2_sendfile_cancel(aim_session_t *sess, struct aim_oft_info *oft_info);
-/* 0x0006 */ faim_export int aim_im_sendch2_geticqaway(aim_session_t *sess, const char *sn, int type);
-/* 0x0006 */ faim_export int aim_im_sendch4(aim_session_t *sess, const char *sn, guint16 type, const char *message);
-/* 0x0008 */ faim_export int aim_im_warn(aim_session_t *sess, aim_conn_t *conn, const char *destsn, guint32 flags);
-/* 0x000b */ faim_export int aim_im_denytransfer(aim_session_t *sess, const char *sender, const guchar *cookie, guint16 code);
-/* 0x0014 */ faim_export int aim_im_sendmtn(aim_session_t *sess, guint16 type1, const char *sn, guint16 type2);
+/* 0x0002 */ faim_export int aim_im_setparams(OscarSession *sess, struct aim_icbmparameters *params);
+/* 0x0004 */ faim_export int aim_im_reqparams(OscarSession *sess);
+/* 0x0006 */ faim_export int aim_im_sendch1_ext(OscarSession *sess, struct aim_sendimext_args *args);
+/* 0x0006 */ faim_export int aim_im_sendch1(OscarSession *, const char *destsn, guint16 flags, const char *msg);
+/* 0x0006 */ faim_export int aim_im_sendch2_chatinvite(OscarSession *sess, const char *sn, const char *msg, guint16 exchange, const char *roomname, guint16 instance);
+/* 0x0006 */ faim_export int aim_im_sendch2_icon(OscarSession *sess, const char *sn, const guint8 *icon, int iconlen, time_t stamp, guint16 iconsum);
+/* 0x0006 */ faim_export int aim_im_sendch2_rtfmsg(OscarSession *sess, struct aim_sendrtfmsg_args *args);
+/* 0x0006 */ faim_export int aim_im_sendch2_odcrequest(OscarSession *sess, guchar *cookie, gboolean usecookie, const char *sn, const guint8 *ip, guint16 port);
+/* 0x0006 */ faim_export int aim_im_sendch2_sendfile_ask(OscarSession *sess, PeerInfo *oft_info);
+/* 0x0006 */ faim_export int aim_im_sendch2_sendfile_accept(OscarSession *sess, PeerInfo *info);
+/* 0x0006 */ faim_export int aim_im_sendch2_sendfile_cancel(OscarSession *sess, PeerInfo *oft_info);
+/* 0x0006 */ faim_export int aim_im_sendch2_geticqaway(OscarSession *sess, const char *sn, int type);
+/* 0x0006 */ faim_export int aim_im_sendch4(OscarSession *sess, const char *sn, guint16 type, const char *message);
+/* 0x0008 */ faim_export int aim_im_warn(OscarSession *sess, OscarConnection *conn, const char *destsn, guint32 flags);
+/* 0x000b */ faim_export int aim_im_denytransfer(OscarSession *sess, const char *sender, const guchar *cookie, guint16 code);
+/* 0x0014 */ faim_export int aim_im_sendmtn(OscarSession *sess, guint16 type1, const char *sn, guint16 type2);
 faim_export void aim_icbm_makecookie(guchar* cookie);
 
 
-/* 0x0002 - locate.c */
+/* 0x0002 - family_locate.c */
 /*
  * AIM User Info, Standard Form.
  */
@@ -950,7 +968,7 @@
 #define AIM_FLAG_ADMINISTRATOR	0x0002
 #define AIM_FLAG_AOL			0x0004
 #define AIM_FLAG_OSCAR_PAY		0x0008
-#define AIM_FLAG_FREE 			0x0010
+#define AIM_FLAG_FREE			0x0010
 #define AIM_FLAG_AWAY			0x0020
 #define AIM_FLAG_ICQ			0x0040
 #define AIM_FLAG_WIRELESS		0x0080
@@ -972,12 +990,14 @@
 #define AIM_USERINFO_PRESENT_SESSIONLEN   0x00000100
 #define AIM_USERINFO_PRESENT_CREATETIME   0x00000200
 
-struct userinfo_node {
+struct userinfo_node
+{
 	char *sn;
 	struct userinfo_node *next;
 };
 
-typedef struct aim_userinfo_s {
+typedef struct aim_userinfo_s
+{
 	char *sn;
 	guint16 warnlevel; /* evil percent * 10 (999 = 99.9%) */
 	guint16 idletime; /* in seconds */
@@ -1046,9 +1066,10 @@
 #define AIM_SENDMEMBLOCK_FLAG_ISREQUEST  0
 #define AIM_SENDMEMBLOCK_FLAG_ISHASH     1
 
-faim_export int aim_sendmemblock(aim_session_t *sess, aim_conn_t *conn, guint32 offset, guint32 len, const guint8 *buf, guint8 flag);
+faim_export int aim_sendmemblock(OscarSession *sess, OscarConnection *conn, guint32 offset, guint32 len, const guint8 *buf, guint8 flag);
 
-struct aim_invite_priv {
+struct aim_invite_priv
+{
 	char *sn;
 	char *roomname;
 	guint16 exchange;
@@ -1072,44 +1093,45 @@
 #define AIM_COOKIETYPE_OFTIMAGE 0x14
 #define AIM_COOKIETYPE_OFTICON  0x15
 
-faim_export aim_userinfo_t *aim_locate_finduserinfo(aim_session_t *sess, const char *sn);
-faim_export void aim_locate_dorequest(aim_session_t *sess);
+faim_export aim_userinfo_t *aim_locate_finduserinfo(OscarSession *sess, const char *sn);
+faim_export void aim_locate_dorequest(OscarSession *sess);
 
-/* 0x0002 */ faim_export int aim_locate_reqrights(aim_session_t *sess);
-/* 0x0004 */ faim_export int aim_locate_setcaps(aim_session_t *sess, guint32 caps);
-/* 0x0004 */ faim_export int aim_locate_setprofile(aim_session_t *sess, const char *profile_encoding, const gchar *profile, const int profile_len, const char *awaymsg_encoding, const gchar *awaymsg, const int awaymsg_len);
-/* 0x0005 */ faim_export int aim_locate_getinfo(aim_session_t *sess, const char *, guint16);
-/* 0x0009 */ faim_export int aim_locate_setdirinfo(aim_session_t *sess, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, guint16 privacy);
-/* 0x000b */ faim_export int aim_locate_000b(aim_session_t *sess, const char *sn);
-/* 0x000f */ faim_export int aim_locate_setinterests(aim_session_t *sess, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, guint16 privacy);
-/* 0x0015 */ faim_export int aim_locate_getinfoshort(aim_session_t *sess, const char *sn, guint32 flags);
+/* 0x0002 */ faim_export int aim_locate_reqrights(OscarSession *sess);
+/* 0x0004 */ faim_export int aim_locate_setcaps(OscarSession *sess, guint32 caps);
+/* 0x0004 */ faim_export int aim_locate_setprofile(OscarSession *sess, const char *profile_encoding, const gchar *profile, const int profile_len, const char *awaymsg_encoding, const gchar *awaymsg, const int awaymsg_len);
+/* 0x0005 */ faim_export int aim_locate_getinfo(OscarSession *sess, const char *, guint16);
+/* 0x0009 */ faim_export int aim_locate_setdirinfo(OscarSession *sess, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, guint16 privacy);
+/* 0x000b */ faim_export int aim_locate_000b(OscarSession *sess, const char *sn);
+/* 0x000f */ faim_export int aim_locate_setinterests(OscarSession *sess, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, guint16 privacy);
+/* 0x0015 */ faim_export int aim_locate_getinfoshort(OscarSession *sess, const char *sn, guint32 flags);
 
 
 
-/* 0x0003 - buddylist.c */
-/* 0x0002 */ faim_export int aim_buddylist_reqrights(aim_session_t *, aim_conn_t *);
-/* 0x0004 */ faim_export int aim_buddylist_set(aim_session_t *, aim_conn_t *, const char *);
-/* 0x0004 */ faim_export int aim_buddylist_addbuddy(aim_session_t *, aim_conn_t *, const char *);
-/* 0x0005 */ faim_export int aim_buddylist_removebuddy(aim_session_t *, aim_conn_t *, const char *);
-/* 0x000b */ faim_export int aim_buddylist_oncoming(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *info);
-/* 0x000c */ faim_export int aim_buddylist_offgoing(aim_session_t *sess, aim_conn_t *conn, const char *sn);
+/* 0x0003 - family_buddy.c */
+/* 0x0002 */ faim_export int aim_buddylist_reqrights(OscarSession *, OscarConnection *);
+/* 0x0004 */ faim_export int aim_buddylist_set(OscarSession *, OscarConnection *, const char *);
+/* 0x0004 */ faim_export int aim_buddylist_addbuddy(OscarSession *, OscarConnection *, const char *);
+/* 0x0005 */ faim_export int aim_buddylist_removebuddy(OscarSession *, OscarConnection *, const char *);
+/* 0x000b */ faim_export int aim_buddylist_oncoming(OscarSession *sess, OscarConnection *conn, aim_userinfo_t *info);
+/* 0x000c */ faim_export int aim_buddylist_offgoing(OscarSession *sess, OscarConnection *conn, const char *sn);
 
 
 
-/* 0x000a - search.c */
-faim_export int aim_search_address(aim_session_t *, aim_conn_t *, const char *);
+/* 0x000a - family_userlookup.c */
+faim_export int aim_search_address(OscarSession *, OscarConnection *, const char *);
 
 
 
-/* 0x000d - chatnav.c */
-/* 0x000e - chat.c */
+/* 0x000d - family_chatnav.c */
+/* 0x000e - family_chat.c */
 /* These apply to exchanges as well. */
 #define AIM_CHATROOM_FLAG_EVILABLE 0x0001
 #define AIM_CHATROOM_FLAG_NAV_ONLY 0x0002
 #define AIM_CHATROOM_FLAG_INSTANCING_ALLOWED 0x0004
 #define AIM_CHATROOM_FLAG_OCCUPANT_PEEK_ALLOWED 0x0008
 
-struct aim_chat_exchangeinfo {
+struct aim_chat_exchangeinfo
+{
 	guint16 number;
 	guint16 flags;
 	char *name;
@@ -1121,21 +1143,22 @@
 
 #define AIM_CHATFLAGS_NOREFLECT 0x0001
 #define AIM_CHATFLAGS_AWAY      0x0002
-faim_export int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, guint16 flags, const gchar *msg, int msglen, const char *encoding, const char *language);
-faim_export int aim_chat_join(aim_session_t *sess, aim_conn_t *conn, guint16 exchange, const char *roomname, guint16 instance);
-faim_export int aim_chat_attachname(aim_conn_t *conn, guint16 exchange, const char *roomname, guint16 instance);
-faim_export char *aim_chat_getname(aim_conn_t *conn);
-faim_export aim_conn_t *aim_chat_getconn(aim_session_t *, const char *name);
+faim_export int aim_chat_send_im(OscarSession *sess, OscarConnection *conn, guint16 flags, const gchar *msg, int msglen, const char *encoding, const char *language);
+faim_export int aim_chat_join(OscarSession *sess, OscarConnection *conn, guint16 exchange, const char *roomname, guint16 instance);
+faim_export int aim_chat_attachname(OscarConnection *conn, guint16 exchange, const char *roomname, guint16 instance);
+faim_export char *aim_chat_getname(OscarConnection *conn);
+faim_export OscarConnection *aim_chat_getconn(OscarSession *, const char *name);
 
-faim_export int aim_chatnav_reqrights(aim_session_t *sess, aim_conn_t *conn);
+faim_export int aim_chatnav_reqrights(OscarSession *sess, OscarConnection *conn);
 
-faim_export int aim_chatnav_createroom(aim_session_t *sess, aim_conn_t *conn, const char *name, guint16 exchange);
-faim_export int aim_chat_leaveroom(aim_session_t *sess, const char *name);
+faim_export int aim_chatnav_createroom(OscarSession *sess, OscarConnection *conn, const char *name, guint16 exchange);
+faim_export int aim_chat_leaveroom(OscarSession *sess, const char *name);
 
 
 
-/* 0x000f - odir.c */
-struct aim_odir {
+/* 0x000f - family_odir.c */
+struct aim_odir
+{
 	char *first;
 	char *last;
 	char *middle;
@@ -1153,19 +1176,19 @@
 	struct aim_odir *next;
 };
 
-faim_export int aim_odir_email(aim_session_t *, const char *, const char *);
-faim_export int aim_odir_name(aim_session_t *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *);
-faim_export int aim_odir_interest(aim_session_t *, const char *, const char *);
+faim_export int aim_odir_email(OscarSession *, const char *, const char *);
+faim_export int aim_odir_name(OscarSession *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *);
+faim_export int aim_odir_interest(OscarSession *, const char *, const char *);
 
 
 
-/* 0x0010 - icon.c */
-faim_export int aim_bart_upload(aim_session_t *sess, const guint8 *icon, guint16 iconlen);
-faim_export int aim_bart_request(aim_session_t *sess, const char *sn, guint8 iconcsumtype, const guint8 *iconstr, guint16 iconstrlen);
+/* 0x0010 - family_bart.c */
+faim_export int aim_bart_upload(OscarSession *sess, const guint8 *icon, guint16 iconlen);
+faim_export int aim_bart_request(OscarSession *sess, const char *sn, guint8 iconcsumtype, const guint8 *iconstr, guint16 iconstrlen);
 
 
 
-/* 0x0013 - ssi.c */
+/* 0x0013 - family_feedbag.c */
 #define AIM_SSI_TYPE_BUDDY		0x0000
 #define AIM_SSI_TYPE_GROUP		0x0001
 #define AIM_SSI_TYPE_PERMIT		0x0002
@@ -1185,7 +1208,8 @@
 #define AIM_SSI_PRESENCE_FLAG_SHOWIDLE        0x00000400
 #define AIM_SSI_PRESENCE_FLAG_NORECENTBUDDIES 0x00020000
 
-struct aim_ssi_item {
+struct aim_ssi_item
+{
 	char *name;
 	guint16 gid;
 	guint16 bid;
@@ -1194,7 +1218,8 @@
 	struct aim_ssi_item *next;
 };
 
-struct aim_ssi_tmp {
+struct aim_ssi_tmp
+{
 	guint16 action;
 	guint16 ack;
 	char *name;
@@ -1203,16 +1228,16 @@
 };
 
 /* These build the actual SNACs and queue them to be sent */
-/* 0x0002 */ faim_export int aim_ssi_reqrights(aim_session_t *sess);
-/* 0x0004 */ faim_export int aim_ssi_reqdata(aim_session_t *sess);
-/* 0x0005 */ faim_export int aim_ssi_reqifchanged(aim_session_t *sess, time_t localstamp, guint16 localrev);
-/* 0x0007 */ faim_export int aim_ssi_enable(aim_session_t *sess);
-/* 0x0008 */ faim_export int aim_ssi_addmoddel(aim_session_t *sess);
-/* 0x0011 */ faim_export int aim_ssi_modbegin(aim_session_t *sess);
-/* 0x0012 */ faim_export int aim_ssi_modend(aim_session_t *sess);
-/* 0x0014 */ faim_export int aim_ssi_sendauth(aim_session_t *sess, char *sn, char *msg);
-/* 0x0018 */ faim_export int aim_ssi_sendauthrequest(aim_session_t *sess, char *sn, const char *msg);
-/* 0x001a */ faim_export int aim_ssi_sendauthreply(aim_session_t *sess, char *sn, guint8 reply, const char *msg);
+/* 0x0002 */ faim_export int aim_ssi_reqrights(OscarSession *sess);
+/* 0x0004 */ faim_export int aim_ssi_reqdata(OscarSession *sess);
+/* 0x0005 */ faim_export int aim_ssi_reqifchanged(OscarSession *sess, time_t localstamp, guint16 localrev);
+/* 0x0007 */ faim_export int aim_ssi_enable(OscarSession *sess);
+/* 0x0008 */ faim_export int aim_ssi_addmoddel(OscarSession *sess);
+/* 0x0011 */ faim_export int aim_ssi_modbegin(OscarSession *sess);
+/* 0x0012 */ faim_export int aim_ssi_modend(OscarSession *sess);
+/* 0x0014 */ faim_export int aim_ssi_sendauth(OscarSession *sess, char *sn, char *msg);
+/* 0x0018 */ faim_export int aim_ssi_sendauthrequest(OscarSession *sess, char *sn, const char *msg);
+/* 0x001a */ faim_export int aim_ssi_sendauthreply(OscarSession *sess, char *sn, guint8 reply, const char *msg);
 
 /* Client functions for retrieving SSI data */
 faim_export struct aim_ssi_item *aim_ssi_itemlist_find(struct aim_ssi_item *list, guint16 gid, guint16 bid);
@@ -1226,26 +1251,26 @@
 faim_export int aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn);
 
 /* Client functions for changing SSI data */
-faim_export int aim_ssi_addbuddy(aim_session_t *sess, const char *name, const char *group, const char *alias, const char *comment, const char *smsnum, int needauth);
-faim_export int aim_ssi_addpermit(aim_session_t *sess, const char *name);
-faim_export int aim_ssi_adddeny(aim_session_t *sess, const char *name);
-faim_export int aim_ssi_delbuddy(aim_session_t *sess, const char *name, const char *group);
-faim_export int aim_ssi_delpermit(aim_session_t *sess, const char *name);
-faim_export int aim_ssi_deldeny(aim_session_t *sess, const char *name);
-faim_export int aim_ssi_movebuddy(aim_session_t *sess, const char *oldgn, const char *newgn, const char *sn);
-faim_export int aim_ssi_aliasbuddy(aim_session_t *sess, const char *gn, const char *sn, const char *alias);
-faim_export int aim_ssi_editcomment(aim_session_t *sess, const char *gn, const char *sn, const char *alias);
-faim_export int aim_ssi_rename_group(aim_session_t *sess, const char *oldgn, const char *newgn);
-faim_export int aim_ssi_cleanlist(aim_session_t *sess);
-faim_export int aim_ssi_deletelist(aim_session_t *sess);
-faim_export int aim_ssi_setpermdeny(aim_session_t *sess, guint8 permdeny, guint32 vismask);
-faim_export int aim_ssi_setpresence(aim_session_t *sess, guint32 presence);
-faim_export int aim_ssi_seticon(aim_session_t *sess, guint8 *iconsum, guint16 iconsumlen);
-faim_export int aim_ssi_delicon(aim_session_t *sess);
+faim_export int aim_ssi_addbuddy(OscarSession *sess, const char *name, const char *group, const char *alias, const char *comment, const char *smsnum, int needauth);
+faim_export int aim_ssi_addpermit(OscarSession *sess, const char *name);
+faim_export int aim_ssi_adddeny(OscarSession *sess, const char *name);
+faim_export int aim_ssi_delbuddy(OscarSession *sess, const char *name, const char *group);
+faim_export int aim_ssi_delpermit(OscarSession *sess, const char *name);
+faim_export int aim_ssi_deldeny(OscarSession *sess, const char *name);
+faim_export int aim_ssi_movebuddy(OscarSession *sess, const char *oldgn, const char *newgn, const char *sn);
+faim_export int aim_ssi_aliasbuddy(OscarSession *sess, const char *gn, const char *sn, const char *alias);
+faim_export int aim_ssi_editcomment(OscarSession *sess, const char *gn, const char *sn, const char *alias);
+faim_export int aim_ssi_rename_group(OscarSession *sess, const char *oldgn, const char *newgn);
+faim_export int aim_ssi_cleanlist(OscarSession *sess);
+faim_export int aim_ssi_deletelist(OscarSession *sess);
+faim_export int aim_ssi_setpermdeny(OscarSession *sess, guint8 permdeny, guint32 vismask);
+faim_export int aim_ssi_setpresence(OscarSession *sess, guint32 presence);
+faim_export int aim_ssi_seticon(OscarSession *sess, guint8 *iconsum, guint16 iconsumlen);
+faim_export int aim_ssi_delicon(OscarSession *sess);
 
 
 
-/* 0x0015 - icq.c */
+/* 0x0015 - family_icq.c */
 #define AIM_ICQ_INFO_SIMPLE	0x001
 #define AIM_ICQ_INFO_SUMMARY	0x002
 #define AIM_ICQ_INFO_EMAIL	0x004
@@ -1257,7 +1282,8 @@
 #define AIM_ICQ_INFO_UNKNOWN	0x100
 #define AIM_ICQ_INFO_HAVEALL	0x1ff
 
-struct aim_icq_offlinemsg {
+struct aim_icq_offlinemsg
+{
 	guint32 sender;
 	guint16 year;
 	guint8 month, day, hour, minute;
@@ -1267,7 +1293,8 @@
 	int msglen;
 };
 
-struct aim_icq_info {
+struct aim_icq_info
+{
 	guint16 reqid;
 
 	/* simple */
@@ -1325,28 +1352,29 @@
 	struct aim_icq_info *next;
 };
 
-faim_export int aim_icq_reqofflinemsgs(aim_session_t *sess);
-faim_export int aim_icq_ackofflinemsgs(aim_session_t *sess);
-faim_export int aim_icq_setsecurity(aim_session_t *sess, gboolean auth_required, gboolean webaware);
-faim_export int aim_icq_changepasswd(aim_session_t *sess, const char *passwd);
-faim_export int aim_icq_getsimpleinfo(aim_session_t *sess, const char *uin);
-faim_export int aim_icq_getalias(aim_session_t *sess, const char *uin);
-faim_export int aim_icq_getallinfo(aim_session_t *sess, const char *uin);
+faim_export int aim_icq_reqofflinemsgs(OscarSession *sess);
+faim_export int aim_icq_ackofflinemsgs(OscarSession *sess);
+faim_export int aim_icq_setsecurity(OscarSession *sess, gboolean auth_required, gboolean webaware);
+faim_export int aim_icq_changepasswd(OscarSession *sess, const char *passwd);
+faim_export int aim_icq_getsimpleinfo(OscarSession *sess, const char *uin);
+faim_export int aim_icq_getalias(OscarSession *sess, const char *uin);
+faim_export int aim_icq_getallinfo(OscarSession *sess, const char *uin);
 
 
 
-/* 0x0017 - auth.c */
-faim_export int aim_sendcookie(aim_session_t *, aim_conn_t *, const guint16 length, const guint8 *);
-faim_export int aim_admin_changepasswd(aim_session_t *, aim_conn_t *, const char *newpw, const char *curpw);
-faim_export int aim_admin_reqconfirm(aim_session_t *sess, aim_conn_t *conn);
-faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, guint16 info);
-faim_export int aim_admin_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail);
-faim_export int aim_admin_setnick(aim_session_t *sess, aim_conn_t *conn, const char *newnick);
+/* 0x0017 - family_auth.c */
+faim_export int aim_sendcookie(OscarSession *, OscarConnection *, const guint16 length, const guint8 *);
+faim_export int aim_admin_changepasswd(OscarSession *, OscarConnection *, const char *newpw, const char *curpw);
+faim_export int aim_admin_reqconfirm(OscarSession *sess, OscarConnection *conn);
+faim_export int aim_admin_getinfo(OscarSession *sess, OscarConnection *conn, guint16 info);
+faim_export int aim_admin_setemail(OscarSession *sess, OscarConnection *conn, const char *newemail);
+faim_export int aim_admin_setnick(OscarSession *sess, OscarConnection *conn, const char *newnick);
 
 
 
-/* 0x0018 - email.c */
-struct aim_emailinfo {
+/* 0x0018 - family_alert.c */
+struct aim_emailinfo
+{
 	guint8 *cookie16;
 	guint8 *cookie8;
 	char *url;
@@ -1357,22 +1385,24 @@
 	struct aim_emailinfo *next;
 };
 
-faim_export int aim_email_sendcookies(aim_session_t *sess);
-faim_export int aim_email_activate(aim_session_t *sess);
+faim_export int aim_email_sendcookies(OscarSession *sess);
+faim_export int aim_email_activate(OscarSession *sess);
 
 
 
 /* tlv.c - TLV handling */
 
 /* TLV structure */
-typedef struct aim_tlv_s {
+typedef struct aim_tlv_s
+{
 	guint16 type;
 	guint16 length;
 	guint8 *value;
 } aim_tlv_t;
 
 /* TLV List structure */
-typedef struct aim_tlvlist_s {
+typedef struct aim_tlvlist_s
+{
 	aim_tlv_t *tlv;
 	struct aim_tlvlist_s *next;
 } aim_tlvlist_t;
@@ -1386,15 +1416,15 @@
 faim_internal guint32 aim_tlv_get32(aim_tlvlist_t *list, const guint16 type, const int nth);
 
 /* TLV list handling functions */
-faim_internal aim_tlvlist_t *aim_tlvlist_read(aim_bstream_t *bs);
-faim_internal aim_tlvlist_t *aim_tlvlist_readnum(aim_bstream_t *bs, guint16 num);
-faim_internal aim_tlvlist_t *aim_tlvlist_readlen(aim_bstream_t *bs, guint16 len);
+faim_internal aim_tlvlist_t *aim_tlvlist_read(ByteStream *bs);
+faim_internal aim_tlvlist_t *aim_tlvlist_readnum(ByteStream *bs, guint16 num);
+faim_internal aim_tlvlist_t *aim_tlvlist_readlen(ByteStream *bs, guint16 len);
 faim_internal aim_tlvlist_t *aim_tlvlist_copy(aim_tlvlist_t *orig);
 
 faim_internal int aim_tlvlist_count(aim_tlvlist_t **list);
 faim_internal int aim_tlvlist_size(aim_tlvlist_t **list);
 faim_internal int aim_tlvlist_cmp(aim_tlvlist_t *one, aim_tlvlist_t *two);
-faim_internal int aim_tlvlist_write(aim_bstream_t *bs, aim_tlvlist_t **list);
+faim_internal int aim_tlvlist_write(ByteStream *bs, aim_tlvlist_t **list);
 faim_internal void aim_tlvlist_free(aim_tlvlist_t **list);
 
 faim_internal int aim_tlvlist_add_raw(aim_tlvlist_t **list, const guint16 type, const guint16 length, const guint8 *value);
@@ -1472,8 +1502,6 @@
 		(((*((buf)+2)) << 16) & 0x00ff0000) + \
 		(((*((buf)+3)) << 24) & 0xff000000))
 
-
-faim_export int aimutil_putstr(char *, const char *, int);
 faim_export guint16 aimutil_iconsum(const guint8 *buf, int buflen);
 faim_export int aimutil_tokslen(char *toSearch, int theindex, char dl);
 faim_export int aimutil_itemcnt(char *toSearch, char dl);
--- a/src/protocols/oscar/oscar_internal.h	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/oscar_internal.h	Sun Feb 12 16:02:05 2006 +0000
@@ -42,95 +42,95 @@
 	guint16 toolversion;
 	guint16 flags;
 	char name[AIM_MODULENAME_MAXLEN+1];
-	int (*snachandler)(aim_session_t *sess, struct aim_module_s *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs);
+	int (*snachandler)(OscarSession *sess, struct aim_module_s *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs);
 
-	void (*shutdown)(aim_session_t *sess, struct aim_module_s *mod);
+	void (*shutdown)(OscarSession *sess, struct aim_module_s *mod);
 	void *priv;
 	struct aim_module_s *next;
 } aim_module_t;
 
-faim_internal int aim__registermodule(aim_session_t *sess, int (*modfirst)(aim_session_t *, aim_module_t *));
-faim_internal void aim__shutdownmodules(aim_session_t *sess);
-faim_internal aim_module_t *aim__findmodulebygroup(aim_session_t *sess, guint16 group);
-faim_internal aim_module_t *aim__findmodule(aim_session_t *sess, const char *name);
+faim_internal int aim__registermodule(OscarSession *sess, int (*modfirst)(OscarSession *, aim_module_t *));
+faim_internal void aim__shutdownmodules(OscarSession *sess);
+faim_internal aim_module_t *aim__findmodulebygroup(OscarSession *sess, guint16 group);
+faim_internal aim_module_t *aim__findmodule(OscarSession *sess, const char *name);
 
-faim_internal int admin_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int buddylist_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int bos_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int search_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int stats_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int auth_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int msg_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int misc_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int chatnav_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int chat_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int locate_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int service_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int invite_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int translate_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int popups_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int adverts_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int odir_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int bart_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int ssi_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int icq_modfirst(aim_session_t *sess, aim_module_t *mod);
-faim_internal int email_modfirst(aim_session_t *sess, aim_module_t *mod);
+faim_internal int admin_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int buddylist_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int bos_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int search_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int stats_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int auth_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int msg_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int misc_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int chatnav_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int chat_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int locate_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int service_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int invite_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int translate_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int popups_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int adverts_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int odir_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int bart_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int ssi_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int icq_modfirst(OscarSession *sess, aim_module_t *mod);
+faim_internal int email_modfirst(OscarSession *sess, aim_module_t *mod);
 
-faim_internal int aim_genericreq_n(aim_session_t *, aim_conn_t *conn, guint16 family, guint16 subtype);
-faim_internal int aim_genericreq_n_snacid(aim_session_t *, aim_conn_t *conn, guint16 family, guint16 subtype);
-faim_internal int aim_genericreq_l(aim_session_t *, aim_conn_t *conn, guint16 family, guint16 subtype, guint32 *);
-faim_internal int aim_genericreq_s(aim_session_t *, aim_conn_t *conn, guint16 family, guint16 subtype, guint16 *);
+faim_internal int aim_genericreq_n(OscarSession *, OscarConnection *conn, guint16 family, guint16 subtype);
+faim_internal int aim_genericreq_n_snacid(OscarSession *, OscarConnection *conn, guint16 family, guint16 subtype);
+faim_internal int aim_genericreq_l(OscarSession *, OscarConnection *conn, guint16 family, guint16 subtype, guint32 *);
+faim_internal int aim_genericreq_s(OscarSession *, OscarConnection *conn, guint16 family, guint16 subtype, guint16 *);
 
 #define AIMBS_CURPOSPAIR(x) ((x)->data + (x)->offset), ((x)->len - (x)->offset)
 
 /* bstream.c */
-faim_internal int aim_bstream_init(aim_bstream_t *bs, guint8 *data, int len);
-faim_internal int aim_bstream_empty(aim_bstream_t *bs);
-faim_internal int aim_bstream_curpos(aim_bstream_t *bs);
-faim_internal int aim_bstream_setpos(aim_bstream_t *bs, unsigned int off);
-faim_internal void aim_bstream_rewind(aim_bstream_t *bs);
-faim_internal int aim_bstream_advance(aim_bstream_t *bs, int n);
-faim_internal guint8 aimbs_get8(aim_bstream_t *bs);
-faim_internal guint16 aimbs_get16(aim_bstream_t *bs);
-faim_internal guint32 aimbs_get32(aim_bstream_t *bs);
-faim_internal guint8 aimbs_getle8(aim_bstream_t *bs);
-faim_internal guint16 aimbs_getle16(aim_bstream_t *bs);
-faim_internal guint32 aimbs_getle32(aim_bstream_t *bs);
-faim_internal int aimbs_getrawbuf(aim_bstream_t *bs, guint8 *buf, int len);
-faim_internal guint8 *aimbs_getraw(aim_bstream_t *bs, int len);
-faim_internal char *aimbs_getstr(aim_bstream_t *bs, int len);
-faim_internal int aimbs_put8(aim_bstream_t *bs, guint8 v);
-faim_internal int aimbs_put16(aim_bstream_t *bs, guint16 v);
-faim_internal int aimbs_put32(aim_bstream_t *bs, guint32 v);
-faim_internal int aimbs_putle8(aim_bstream_t *bs, guint8 v);
-faim_internal int aimbs_putle16(aim_bstream_t *bs, guint16 v);
-faim_internal int aimbs_putle32(aim_bstream_t *bs, guint32 v);
-faim_internal int aimbs_putraw(aim_bstream_t *bs, const guint8 *v, int len);
-faim_internal int aimbs_putstr(aim_bstream_t *bs, const char *str);
-faim_internal int aimbs_putbs(aim_bstream_t *bs, aim_bstream_t *srcbs, int len);
-faim_internal int aimbs_putcaps(aim_bstream_t *bs, guint32 caps);
+faim_internal int aim_bstream_init(ByteStream *bs, guint8 *data, int len);
+faim_internal int aim_bstream_empty(ByteStream *bs);
+faim_internal int aim_bstream_curpos(ByteStream *bs);
+faim_internal int aim_bstream_setpos(ByteStream *bs, unsigned int off);
+faim_internal void aim_bstream_rewind(ByteStream *bs);
+faim_internal int aim_bstream_advance(ByteStream *bs, int n);
+faim_internal guint8 aimbs_get8(ByteStream *bs);
+faim_internal guint16 aimbs_get16(ByteStream *bs);
+faim_internal guint32 aimbs_get32(ByteStream *bs);
+faim_internal guint8 aimbs_getle8(ByteStream *bs);
+faim_internal guint16 aimbs_getle16(ByteStream *bs);
+faim_internal guint32 aimbs_getle32(ByteStream *bs);
+faim_internal int aimbs_getrawbuf(ByteStream *bs, guint8 *buf, int len);
+faim_internal guint8 *aimbs_getraw(ByteStream *bs, int len);
+faim_internal char *aimbs_getstr(ByteStream *bs, int len);
+faim_internal int aimbs_put8(ByteStream *bs, guint8 v);
+faim_internal int aimbs_put16(ByteStream *bs, guint16 v);
+faim_internal int aimbs_put32(ByteStream *bs, guint32 v);
+faim_internal int aimbs_putle8(ByteStream *bs, guint8 v);
+faim_internal int aimbs_putle16(ByteStream *bs, guint16 v);
+faim_internal int aimbs_putle32(ByteStream *bs, guint32 v);
+faim_internal int aimbs_putraw(ByteStream *bs, const guint8 *v, int len);
+faim_internal int aimbs_putstr(ByteStream *bs, const char *str);
+faim_internal int aimbs_putbs(ByteStream *bs, ByteStream *srcbs, int len);
+faim_internal int aimbs_putcaps(ByteStream *bs, guint32 caps);
 
 /* conn.c */
-faim_internal aim_conn_t *aim_cloneconn(aim_session_t *sess, aim_conn_t *src);
+faim_internal OscarConnection *aim_cloneconn(OscarSession *sess, OscarConnection *src);
 
 /* rxhandlers.c */
-faim_internal aim_rxcallback_t aim_callhandler(aim_session_t *sess, aim_conn_t *conn, guint16 family, guint16 type);
-faim_internal int aim_callhandler_noparam(aim_session_t *sess, aim_conn_t *conn, guint16 family, guint16 type, aim_frame_t *ptr);
-faim_internal int aim_parse_unknown(aim_session_t *, aim_frame_t *, ...);
-faim_internal void aim_clonehandlers(aim_session_t *sess, aim_conn_t *dest, aim_conn_t *src);
+faim_internal aim_rxcallback_t aim_callhandler(OscarSession *sess, OscarConnection *conn, guint16 family, guint16 type);
+faim_internal int aim_callhandler_noparam(OscarSession *sess, OscarConnection *conn, guint16 family, guint16 type, FlapFrame *ptr);
+faim_internal int aim_parse_unknown(OscarSession *, FlapFrame *, ...);
+faim_internal void aim_clonehandlers(OscarSession *sess, OscarConnection *dest, OscarConnection *src);
 
 /* rxqueue.c */
 faim_internal int aim_recv(int fd, void *buf, size_t count);
-faim_internal int aim_bstream_recv(aim_bstream_t *bs, int fd, size_t count);
-faim_internal void aim_rxqueue_cleanbyconn(aim_session_t *sess, aim_conn_t *conn);
-faim_internal void aim_frame_destroy(aim_frame_t *);
+faim_internal int aim_bstream_recv(ByteStream *bs, int fd, size_t count);
+faim_internal void aim_rxqueue_cleanbyconn(OscarSession *sess, OscarConnection *conn);
+faim_internal void aim_frame_destroy(FlapFrame *);
 
 /* txqueue.c */
-faim_internal aim_frame_t *aim_tx_new(aim_session_t *sess, aim_conn_t *conn, guint8 framing, guint16 chan, int datalen);
-faim_internal int aim_tx_enqueue(aim_session_t *, aim_frame_t *);
-faim_internal int aim_bstream_send(aim_bstream_t *bs, aim_conn_t *conn, size_t count);
-faim_internal int aim_tx_sendframe(aim_session_t *sess, aim_frame_t *cur);
-faim_internal void aim_tx_cleanqueue(aim_session_t *, aim_conn_t *);
+faim_internal FlapFrame *aim_tx_new(OscarSession *sess, OscarConnection *conn, guint8 framing, guint16 chan, int datalen);
+faim_internal int aim_tx_enqueue(OscarSession *, FlapFrame *);
+faim_internal int aim_bstream_send(ByteStream *bs, OscarConnection *conn, size_t count);
+faim_internal int aim_tx_sendframe(OscarSession *sess, FlapFrame *cur);
+faim_internal void aim_tx_cleanqueue(OscarSession *, OscarConnection *);
 
 /*
  * Generic SNAC structure.  Rarely if ever used.
@@ -146,11 +146,11 @@
 } aim_snac_t;
 
 /* snac.c */
-faim_internal void aim_initsnachash(aim_session_t *sess);
-faim_internal aim_snacid_t aim_newsnac(aim_session_t *, aim_snac_t *newsnac);
-faim_internal aim_snacid_t aim_cachesnac(aim_session_t *sess, const guint16 family, const guint16 type, const guint16 flags, const void *data, const int datalen);
-faim_internal aim_snac_t *aim_remsnac(aim_session_t *, aim_snacid_t id);
-faim_internal int aim_putsnac(aim_bstream_t *, guint16 family, guint16 type, guint16 flags, aim_snacid_t id);
+faim_internal void aim_initsnachash(OscarSession *sess);
+faim_internal aim_snacid_t aim_newsnac(OscarSession *, aim_snac_t *newsnac);
+faim_internal aim_snacid_t aim_cachesnac(OscarSession *sess, const guint16 family, const guint16 type, const guint16 flags, const void *data, const int datalen);
+faim_internal aim_snac_t *aim_remsnac(OscarSession *, aim_snacid_t id);
+faim_internal int aim_putsnac(ByteStream *, guint16 family, guint16 type, guint16 flags, aim_snacid_t id);
 
 /* Stored in ->priv of the service request SNAC for chats. */
 struct chatsnacinfo {
@@ -200,32 +200,32 @@
 	struct rateclass *rates;
 } aim_conn_inside_t;
 
-faim_internal void aim_conn_addgroup(aim_conn_t *conn, guint16 group);
+faim_internal void aim_conn_addgroup(OscarConnection *conn, guint16 group);
 
-faim_internal int aim_cachecookie(aim_session_t *sess, aim_msgcookie_t *cookie);
-faim_internal aim_msgcookie_t *aim_uncachecookie(aim_session_t *sess, guint8 *cookie, int type);
-faim_internal aim_msgcookie_t *aim_mkcookie(guint8 *, int, void *);
-faim_internal aim_msgcookie_t *aim_checkcookie(aim_session_t *, const unsigned char *, const int);
-faim_internal int aim_freecookie(aim_session_t *sess, aim_msgcookie_t *cookie);
+faim_internal int aim_cachecookie(OscarSession *sess, IcbmCookie *cookie);
+faim_internal IcbmCookie *aim_uncachecookie(OscarSession *sess, guint8 *cookie, int type);
+faim_internal IcbmCookie *aim_mkcookie(guint8 *, int, void *);
+faim_internal IcbmCookie *aim_checkcookie(OscarSession *, const unsigned char *, const int);
+faim_internal int aim_freecookie(OscarSession *sess, IcbmCookie *cookie);
 faim_internal int aim_msgcookie_gettype(int reqclass);
-faim_internal int aim_cookie_free(aim_session_t *sess, aim_msgcookie_t *cookie);
+faim_internal int aim_cookie_free(OscarSession *sess, IcbmCookie *cookie);
 
 /* 0x0002 - locate.c */
-faim_internal void aim_locate_requestuserinfo(aim_session_t *sess, const char *sn);
-faim_internal guint32 aim_locate_getcaps(aim_session_t *sess, aim_bstream_t *bs, int len);
-faim_internal guint32 aim_locate_getcaps_short(aim_session_t *sess, aim_bstream_t *bs, int len);
+faim_internal void aim_locate_requestuserinfo(OscarSession *sess, const char *sn);
+faim_internal guint32 aim_locate_getcaps(OscarSession *sess, ByteStream *bs, int len);
+faim_internal guint32 aim_locate_getcaps_short(OscarSession *sess, ByteStream *bs, int len);
 faim_internal void aim_info_free(aim_userinfo_t *);
-faim_internal int aim_info_extract(aim_session_t *sess, aim_bstream_t *bs, aim_userinfo_t *);
-faim_internal int aim_putuserinfo(aim_bstream_t *bs, aim_userinfo_t *info);
+faim_internal int aim_info_extract(OscarSession *sess, ByteStream *bs, aim_userinfo_t *);
+faim_internal int aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info);
 
-faim_internal int aim_chat_readroominfo(aim_bstream_t *bs, struct aim_chat_roominfo *outinfo);
+faim_internal int aim_chat_readroominfo(ByteStream *bs, struct aim_chat_roominfo *outinfo);
 
-faim_internal void aim_conn_kill_chat(aim_session_t *sess, aim_conn_t *conn);
+faim_internal void aim_conn_kill_chat(OscarSession *sess, OscarConnection *conn);
 
 /* These are all handled internally now. */
-faim_internal int aim_setversions(aim_session_t *sess, aim_conn_t *conn);
-faim_internal int aim_reqrates(aim_session_t *, aim_conn_t *);
-faim_internal int aim_rates_addparam(aim_session_t *, aim_conn_t *);
-faim_internal int aim_rates_delparam(aim_session_t *, aim_conn_t *);
+faim_internal int aim_setversions(OscarSession *sess, OscarConnection *conn);
+faim_internal int aim_reqrates(OscarSession *, OscarConnection *);
+faim_internal int aim_rates_addparam(OscarSession *, OscarConnection *);
+faim_internal int aim_rates_delparam(OscarSession *, OscarConnection *);
 
 #endif /* _OSCAR_INTERNAL_H_ */
--- a/src/protocols/oscar/peer.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/peer.c	Sun Feb 12 16:02:05 2006 +0000
@@ -22,40 +22,40 @@
  * Oscar File transfer (OFT) and Oscar Direct Connect (ODC).
  * (ODC is also referred to as DirectIM and IM Image.)
  *
- * There are a few static helper functions at the top, then 
+ * There are a few static helper functions at the top, then
  * ODC stuff, then ft stuff.
  *
- * I feel like this is a good place to explain OFT, so I'm going to 
- * do just that.  Each OFT packet has a header type.  I guess this 
- * is pretty similar to the subtype of a SNAC packet.  The type 
- * basically tells the other client the meaning of the OFT packet.  
- * There are two distinct types of file transfer, which I usually 
- * call "sendfile" and "getfile."  Sendfile is when you send a file 
- * to another AIM user.  Getfile is when you share a group of files, 
+ * I feel like this is a good place to explain OFT, so I'm going to
+ * do just that.  Each OFT packet has a header type.  I guess this
+ * is pretty similar to the subtype of a SNAC packet.  The type
+ * basically tells the other client the meaning of the OFT packet.
+ * There are two distinct types of file transfer, which I usually
+ * call "sendfile" and "getfile."  Sendfile is when you send a file
+ * to another AIM user.  Getfile is when you share a group of files,
  * and other users request that you send them the files.
  *
  * A typical sendfile file transfer goes like this:
- *   1) Sender sends a channel 2 ICBM telling the other user that 
- *      we want to send them a file.  At the same time, we open a 
- *      listener socket (this should be done before sending the 
- *      ICBM) on some port, and wait for them to connect to us.  
- *      The ICBM we sent should contain our IP address and the port 
+ *   1) Sender sends a channel 2 ICBM telling the other user that
+ *      we want to send them a file.  At the same time, we open a
+ *      listener socket (this should be done before sending the
+ *      ICBM) on some port, and wait for them to connect to us.
+ *      The ICBM we sent should contain our IP address and the port
  *      number that we're listening on.
- *   2) The receiver connects to the sender on the given IP address 
- *      and port.  After the connection is established, the receiver 
+ *   2) The receiver connects to the sender on the given IP address
+ *      and port.  After the connection is established, the receiver
  *      sends an ICBM signifying that we are ready and waiting.
- *   3) The sender sends an OFT PROMPT message over the OFT 
+ *   3) The sender sends an OFT PROMPT message over the OFT
  *      connection.
- *   4) The receiver of the file sends back an exact copy of this 
- *      OFT packet, except the cookie is filled in with the cookie 
- *      from the ICBM.  I think this might be an attempt to verify 
- *      that the user that is connected is actually the guy that 
+ *   4) The receiver of the file sends back an exact copy of this
+ *      OFT packet, except the cookie is filled in with the cookie
+ *      from the ICBM.  I think this might be an attempt to verify
+ *      that the user that is connected is actually the guy that
  *      we sent the ICBM to.  Oh, I've been calling this the ACK.
- *   5) The sender starts sending raw data across the connection 
+ *   5) The sender starts sending raw data across the connection
  *      until the entire file has been sent.
- *   6) The receiver knows the file is finished because the sender 
- *      sent the file size in an earlier OFT packet.  So then the 
- *      receiver sends the DONE thingy (after filling in the 
+ *   6) The receiver knows the file is finished because the sender
+ *      sent the file size in an earlier OFT packet.  So then the
+ *      receiver sends the DONE thingy (after filling in the
  *      "received" checksum and size) and closes the connection.
  */
 
@@ -106,7 +106,8 @@
  *
  * @param name The filename to convert.
  */
-static void aim_oft_dirconvert_tostupid(char *name)
+static void
+aim_oft_dirconvert_tostupid(char *name)
 {
 	while (name[0]) {
 		if (name[0] == 0x01)
@@ -120,7 +121,8 @@
  *
  * @param name The filename to convert.
  */
-static void aim_oft_dirconvert_fromstupid(char *name)
+static void
+aim_oft_dirconvert_fromstupid(char *name)
 {
 	while (name[0]) {
 		if (name[0] == G_DIR_SEPARATOR)
@@ -132,25 +134,26 @@
 /**
  * Calculate oft checksum of buffer
  *
- * Prevcheck should be 0xFFFF0000 when starting a checksum of a file.  The 
- * checksum is kind of a rolling checksum thing, so each time you get bytes 
- * of a file you just call this puppy and it updates the checksum.  You can 
- * calculate the checksum of an entire file by calling this in a while or a 
+ * Prevcheck should be 0xFFFF0000 when starting a checksum of a file.  The
+ * checksum is kind of a rolling checksum thing, so each time you get bytes
+ * of a file you just call this puppy and it updates the checksum.  You can
+ * calculate the checksum of an entire file by calling this in a while or a
  * for loop, or something.
  *
- * Thanks to Graham Booker for providing this improved checksum routine, 
- * which is simpler and should be more accurate than Josh Myer's original 
+ * Thanks to Graham Booker for providing this improved checksum routine,
+ * which is simpler and should be more accurate than Josh Myer's original
  * code. -- wtm
  *
- * This algorithm works every time I have tried it.  The other fails 
- * sometimes.  So, AOL who thought this up?  It has got to be the weirdest 
+ * This algorithm works every time I have tried it.  The other fails
+ * sometimes.  So, AOL who thought this up?  It has got to be the weirdest
  * checksum I have ever seen.
  *
  * @param buffer Buffer of data to checksum.  Man I'd like to buff her...
  * @param bufsize Size of buffer.
  * @param prevcheck Previous checksum.
  */
-faim_export guint32 aim_oft_checksum_chunk(const guint8 *buffer, int bufferlen, guint32 prevcheck)
+guint32
+aim_oft_checksum_chunk(const guint8 *buffer, int bufferlen, guint32 prevcheck)
 {
 	guint32 check = (prevcheck >> 16) & 0xffff, oldcheck;
 	int i;
@@ -164,7 +167,7 @@
 			val = buffer[i] << 8;
 		check -= val;
 		/*
-		 * The following appears to be necessary.... It happens 
+		 * The following appears to be necessary.... It happens
 		 * every once in a while and the checksum doesn't fail.
 		 */
 		if (check > oldcheck)
@@ -175,7 +178,9 @@
 	return check << 16;
 }
 
-faim_export guint32 aim_oft_checksum_file(char *filename) {
+guint32
+aim_oft_checksum_file(char *filename)
+{
 	FILE *fd;
 	guint32 checksum = 0xffff0000;
 
@@ -201,13 +206,14 @@
  * @param cur The conn the incoming connection is on.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_handlerendconnect(aim_session_t *sess, aim_conn_t *cur)
+int
+aim_handlerendconnect(OscarSession *sess, OscarConnection *cur)
 {
 	int acceptfd = 0;
 	struct sockaddr addr;
 	socklen_t addrlen = sizeof(addr);
 	int ret = 0;
-	aim_conn_t *newconn;
+	OscarConnection *newconn;
 	char ip[20];
 	unsigned short port;
 
@@ -240,14 +246,14 @@
 		cur->internal = NULL;
 		snprintf(priv->ip, sizeof(priv->ip), "%s:%hu", ip, port);
 
-		if ((userfunc = aim_callhandler(sess, newconn, AIM_CB_FAM_OFT, OFT_TYPE_DIRECTIM_ESTABLISHED)))
+		if ((userfunc = aim_callhandler(sess, newconn, AIM_CB_FAM_OFT, PEER_TYPE_DIRECTIM_ESTABLISHED)))
 			ret = userfunc(sess, NULL, newconn, cur);
 
 	} else if (newconn->subtype == AIM_CONN_SUBTYPE_OFT_GETFILE) {
 	} else if (newconn->subtype == AIM_CONN_SUBTYPE_OFT_SENDFILE) {
 		aim_rxcallback_t userfunc;
 
-		if ((userfunc = aim_callhandler(sess, newconn, AIM_CB_FAM_OFT, OFT_TYPE_ESTABLISHED)))
+		if ((userfunc = aim_callhandler(sess, newconn, AIM_CB_FAM_OFT, PEER_TYPE_ESTABLISHED)))
 			ret = userfunc(sess, NULL, newconn, cur);
 
 	} else {
@@ -264,15 +270,16 @@
  *
  * @param sess The session.
  * @param conn The already-connected ODC connection.
- * @param typing If 0x0002, sends a "typing" message, 0x0001 sends "typed," and 
+ * @param typing If 0x0002, sends a "typing" message, 0x0001 sends "typed," and
  *        0x0000 sends "stopped."
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_odc_send_typing(aim_session_t *sess, aim_conn_t *conn, int typing)
+int
+aim_odc_send_typing(OscarSession *sess, OscarConnection *conn, int typing)
 {
 	struct aim_odc_intdata *intdata = (struct aim_odc_intdata *)conn->internal;
-	aim_frame_t *fr;
-	aim_bstream_t *hdrbs;
+	FlapFrame *fr;
+	ByteStream *hdrbs;
 	guint8 *hdr;
 	int hdrlen = 0x44;
 
@@ -337,7 +344,7 @@
 /**
  * Send client-to-client IM over an established direct connection.
  * Call this just like you would aim_send_im, to send a directim.
- * 
+ *
  * @param sess The session.
  * @param conn The already-connected ODC connection.
  * @param msg Null-terminated string to send.
@@ -346,10 +353,11 @@
  * @param isawaymsg 0 if this is not an auto-response, 1 if it is.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_odc_send_im(aim_session_t *sess, aim_conn_t *conn, const char *msg, int len, int encoding, int isawaymsg)
+int
+aim_odc_send_im(OscarSession *sess, OscarConnection *conn, const char *msg, int len, int encoding, int isawaymsg)
 {
-	aim_frame_t *fr;
-	aim_bstream_t *hdrbs;
+	FlapFrame *fr;
+	ByteStream *hdrbs;
 	struct aim_odc_intdata *intdata = (struct aim_odc_intdata *)conn->internal;
 	int hdrlen = 0x44;
 	guint8 *hdr;
@@ -404,7 +412,7 @@
 
 	/* end of hdr2 */
 
-#if 0 /* XXX - this is how you send buddy icon info... */	
+#if 0 /* XXX - this is how you send buddy icon info... */
 	aimbs_put16(hdrbs, 0x0008);
 	aimbs_put16(hdrbs, 0x000c);
 	aimbs_put16(hdrbs, 0x0000);
@@ -427,7 +435,8 @@
  * @param conn The ODC connection.
  * @return The screen name of the dude, or NULL if there was an anomaly.
  */
-faim_export const char *aim_odc_getsn(aim_conn_t *conn)
+const char *
+aim_odc_getsn(OscarConnection *conn)
 {
 	struct aim_odc_intdata *intdata;
 
@@ -449,7 +458,8 @@
  * @param conn The ODC connection.
  * @return The cookie, an 8 byte unterminated string, or NULL if there was an anomaly.
  */
-faim_export const guchar *aim_odc_getcookie(aim_conn_t *conn)
+const guchar *
+aim_odc_getcookie(OscarConnection *conn)
 {
 	struct aim_odc_intdata *intdata;
 
@@ -466,12 +476,13 @@
  *
  * @param sess The session.
  * @param sn The screen name of the buddy whose direct connection you want to find.
- * @return The conn for the direct connection with the given buddy, or NULL if no 
+ * @return The conn for the direct connection with the given buddy, or NULL if no
  *         connection was found.
  */
-faim_export aim_conn_t *aim_odc_getconn(aim_session_t *sess, const char *sn)
+OscarConnection *
+aim_odc_getconn(OscarSession *sess, const char *sn)
 {
-	aim_conn_t *cur;
+	OscarConnection *cur;
 	struct aim_odc_intdata *intdata;
 
 	if (!sess || !sn || !strlen(sn))
@@ -500,11 +511,12 @@
  * @param sn The screen name to connect to.
  * @return The new connection.
  */
-faim_export aim_conn_t *aim_odc_initiate(aim_session_t *sess, const char *sn, int listenfd,
-                                         const guint8 *localip, guint16 port, const guint8 *mycookie)
+OscarConnection *
+aim_odc_initiate(OscarSession *sess, const char *sn, int listenfd,
+                 const guint8 *localip, guint16 port, const guint8 *mycookie)
 {
-	aim_conn_t *newconn;
-	aim_msgcookie_t *cookie;
+	OscarConnection *newconn;
+	IcbmCookie *cookie;
 	struct aim_odc_intdata *priv;
 	guint8 ck[8];
 
@@ -517,7 +529,7 @@
 	} else
 		aim_im_sendch2_odcrequest(sess, ck, FALSE, sn, localip, port);
 
-	cookie = (aim_msgcookie_t *)calloc(1, sizeof(aim_msgcookie_t));
+	cookie = (IcbmCookie *)calloc(1, sizeof(IcbmCookie));
 	memcpy(cookie->cookie, ck, 8);
 	cookie->type = AIM_COOKIETYPE_OFTIM;
 
@@ -554,7 +566,7 @@
  *
  * This is a wrapper for aim_newconn.
  *
- * If addr is NULL, the socket is not created, but the connection is 
+ * If addr is NULL, the socket is not created, but the connection is
  * allocated and setup to connect.
  *
  * @param sess The Godly session.
@@ -562,9 +574,10 @@
  * @param addr Address to connect to.
  * @return The new connection.
  */
-faim_export aim_conn_t *aim_odc_connect(aim_session_t *sess, const char *sn, const char *addr, const guint8 *cookie)
+OscarConnection *
+aim_odc_connect(OscarSession *sess, const char *sn, const char *addr, const guint8 *cookie)
 {
-	aim_conn_t *newconn;
+	OscarConnection *newconn;
 	struct aim_odc_intdata *intdata;
 
 	if (!sess || !sn)
@@ -598,9 +611,10 @@
  * @param bs It stands for "bologna sandwich."
  * @return Return 0 if no errors, otherwise return the error number.
  */
-static int handlehdr_odc(aim_session_t *sess, aim_conn_t *conn, aim_frame_t *frr, aim_bstream_t *bs)
+static int
+handlehdr_odc(OscarSession *sess, OscarConnection *conn, FlapFrame *frr, ByteStream *bs)
 {
-	aim_frame_t fr;
+	FlapFrame fr;
 	int ret = 0;
 	aim_rxcallback_t userfunc;
 	guint32 payloadlength;
@@ -626,13 +640,13 @@
 	gaim_debug_misc("oscar", "faim: OFT frame: handlehdr_odc: %04x / %04x / %s\n", payloadlength, flags, snptr);
 
 	if (flags & 0x0008) {
-		if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, OFT_TYPE_DIRECTIMTYPING)))
+		if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, PEER_TYPE_DIRECTIMTYPING)))
 			ret = userfunc(sess, &fr, snptr, 2);
 	} else if (flags & 0x0004) {
-		if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, OFT_TYPE_DIRECTIMTYPING)))
+		if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, PEER_TYPE_DIRECTIMTYPING)))
 			ret = userfunc(sess, &fr, snptr, 1);
 	} else {
-		if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, OFT_TYPE_DIRECTIMTYPING)))
+		if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, PEER_TYPE_DIRECTIMTYPING)))
 			ret = userfunc(sess, &fr, snptr, 0);
 	}
 
@@ -651,7 +665,7 @@
 		while (payloadlength - recvd) {
 			if (payloadlength - recvd >= 1024)
 				i = aim_recv(conn->fd, &msg[recvd], 1024);
-			else 
+			else
 				i = aim_recv(conn->fd, &msg[recvd], payloadlength - recvd);
 			if (i <= 0) {
 				free(msg);
@@ -662,8 +676,8 @@
 			if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_IMAGETRANSFER)))
 				ret = userfunc(sess, &fr, snptr, (double)recvd / payloadlength);
 		}
-		
-		if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, OFT_TYPE_DIRECTIMINCOMING)))
+
+		if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, PEER_TYPE_DIRECTIMINCOMING)))
 			ret = userfunc(sess, &fr, snptr, msg, payloadlength, encoding, isawaymsg);
 
 		free(msg);
@@ -674,14 +688,15 @@
 	return ret;
 }
 
-faim_export struct aim_oft_info *aim_oft_createinfo(aim_session_t *sess, const guint8 *cookie, const char *sn, const char *ip, guint16 port, guint32 size, guint32 modtime, char *filename, int send_or_recv, int method, int stage)
+PeerInfo *
+aim_oft_createinfo(OscarSession *sess, const guint8 *cookie, const char *sn, const char *ip, guint16 port, guint32 size, guint32 modtime, char *filename, int send_or_recv, int method, int stage)
 {
-	struct aim_oft_info *new;
+	PeerInfo *new;
 
 	if (!sess)
 		return NULL;
 
-	if (!(new = (struct aim_oft_info *)calloc(1, sizeof(struct aim_oft_info))))
+	if (!(new = (PeerInfo *)calloc(1, sizeof(PeerInfo))))
 		return NULL;
 
 	new->sess = sess;
@@ -726,36 +741,37 @@
 	return new;
 }
 
-faim_export struct aim_rv_proxy_info *aim_rv_proxy_createinfo(aim_session_t *sess, const guint8 *cookie,
+PeerProxyInfo *aim_rv_proxy_createinfo(OscarSession *sess, const guint8 *cookie,
 	guint16 port)
 {
-	struct aim_rv_proxy_info *proxy_info;
-	
-	if (!(proxy_info = (struct aim_rv_proxy_info*)calloc(1, sizeof(struct aim_rv_proxy_info))))
+	PeerProxyInfo *proxy_info;
+
+	if (!(proxy_info = (PeerProxyInfo*)calloc(1, sizeof(PeerProxyInfo))))
 		return NULL;
-	
+
 	proxy_info->sess = sess;
 	proxy_info->port = port;
 	proxy_info->packet_ver = AIM_RV_PROXY_PACKETVER_DFLT;
 	proxy_info->unknownA = AIM_RV_PROXY_UNKNOWNA_DFLT;
-	
+
 	if (cookie)
 		memcpy(proxy_info->cookie, cookie, 8);
-	
+
 	return proxy_info;
 }
 
 /**
- * Remove the given oft_info struct from the oft_info linked list, and 
+ * Remove the given oft_info struct from the oft_info linked list, and
  * then free its memory.
  *
  * @param sess The session.
- * @param oft_info The aim_oft_info struct that we're destroying.
+ * @param oft_info The PeerInfo that we're destroying.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_oft_destroyinfo(struct aim_oft_info *oft_info)
+int
+aim_oft_destroyinfo(PeerInfo *oft_info)
 {
-	aim_session_t *sess;
+	OscarSession *sess;
 
 	if (!oft_info || !(sess = oft_info->sess))
 		return -EINVAL;
@@ -763,7 +779,7 @@
 	if (sess->oft_info && (sess->oft_info == oft_info)) {
 		sess->oft_info = sess->oft_info->next;
 	} else {
-		struct aim_oft_info *cur;
+		PeerInfo *cur;
 		for (cur=sess->oft_info; (cur->next && (cur->next!=oft_info)); cur=cur->next);
 		if (cur->next)
 			cur->next = cur->next->next;
@@ -781,17 +797,18 @@
 /**
  * Creates a listener socket so the other dude can connect to us.
  *
- * You'll want to set up some kind of watcher on this socket.  
- * When the state changes, call aim_handlerendconnection with 
- * the connection returned by this.  aim_handlerendconnection 
+ * You'll want to set up some kind of watcher on this socket.
+ * When the state changes, call aim_handlerendconnection with
+ * the connection returned by this.  aim_handlerendconnection
  * will accept the pending connection and stop listening.
  *
  * @param sess The session.
- * @param oft_info File transfer information associated with this 
+ * @param oft_info File transfer information associated with this
  *        connection.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_sendfile_listen(aim_session_t *sess, struct aim_oft_info *oft_info, int listenfd)
+int
+aim_sendfile_listen(OscarSession *sess, PeerInfo *oft_info, int listenfd)
 {
 	if (!oft_info)
 		return -EINVAL;
@@ -814,11 +831,12 @@
  * @param bs The should be from an incoming rendezvous packet.
  * @return A pointer to new struct on success, or NULL on error.
  */
-static struct aim_fileheader_t *aim_oft_getheader(aim_bstream_t *bs)
+static PeerFrame *
+aim_oft_getheader(ByteStream *bs)
 {
-	struct aim_fileheader_t *fh;
+	PeerFrame *fh;
 
-	if (!(fh = calloc(1, sizeof(struct aim_fileheader_t))))
+	if (!(fh = calloc(1, sizeof(PeerFrame))))
 		return NULL;
 
 	/* The bstream should be positioned after the hdrtype. */
@@ -851,17 +869,18 @@
 	fh->name[63] = '\0';
 
 	return fh;
-} 
+}
 
 /**
  * Fills a buffer with network-order fh data
  *
  * @param bs A bstream to fill -- automatically initialized
- * @param fh A struct aim_fileheader_t to get data from.
+ * @param fh A PeerFrame to get data from.
  * @return Return non-zero on error.
  */
-static int aim_oft_buildheader(aim_bstream_t *bs, struct aim_fileheader_t *fh)
-{ 
+static int
+aim_oft_buildheader(ByteStream *bs, PeerFrame *fh)
+{
 	guint8 *hdr;
 
 	if (!bs || !fh)
@@ -906,21 +925,21 @@
  *
  * @param sess The session.
  * @param type The subtype of the OFT packet we're sending.
- * @param oft_info The aim_oft_info struct with the connection and OFT 
+ * @param oft_info The PeerInfo with the connection and OFT
  *        info we're sending.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_oft_sendheader(aim_session_t *sess, guint16 type, struct aim_oft_info *oft_info)
+int aim_oft_sendheader(OscarSession *sess, guint16 type, PeerInfo *oft_info)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 
 	if (!sess || !oft_info || !oft_info->conn || (oft_info->conn->type != AIM_CONN_TYPE_RENDEZVOUS))
 		return -EINVAL;
 
 #if 0
 	/*
-	 * If you are receiving a file, the cookie should be null, if you are sending a 
-	 * file, the cookie should be the same as the one used in the ICBM negotiation 
+	 * If you are receiving a file, the cookie should be null, if you are sending a
+	 * file, the cookie should be the same as the one used in the ICBM negotiation
 	 * SNACs.
 	 */
 	fh->lnameoffset = 0x1a;
@@ -958,12 +977,13 @@
  * @param proxy_info Changable pieces of data for this packet
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_rv_proxy_init_recv(struct aim_rv_proxy_info *proxy_info)
+int
+aim_rv_proxy_init_recv(PeerProxyInfo *proxy_info)
 {
 #if 0
 	aim_tlvlist_t *tlvlist_sendfile;
 #endif
-	aim_bstream_t bs;
+	ByteStream bs;
 	guint8 *bs_raw;
 	guint16 packet_len;
 	guint8 sn_len;
@@ -1031,12 +1051,13 @@
  * @param proxy_info Changable pieces of data for this packet
  * @return Return 0 if no errors, otherwise return the error number.
  */
-faim_export int aim_rv_proxy_init_send(struct aim_rv_proxy_info *proxy_info)
+int
+aim_rv_proxy_init_send(PeerProxyInfo *proxy_info)
 {
 #if 0
 	aim_tlvlist_t *tlvlist_sendfile;
 #endif
-	aim_bstream_t bs;
+	ByteStream bs;
 	guint8 *bs_raw;
 	guint16 packet_len;
 	guint8 sn_len;
@@ -1101,9 +1122,10 @@
  * @return Return 0 if the packet was handled correctly, otherwise return the
  *         error number.
  */
-faim_internal int aim_rxdispatch_rendezvous(aim_session_t *sess, aim_frame_t *fr)
+int
+aim_rxdispatch_rendezvous(OscarSession *sess, FlapFrame *fr)
 {
-	aim_conn_t *conn = fr->conn;
+	OscarConnection *conn = fr->conn;
 	int ret = 1;
 
 	if (conn->subtype == AIM_CONN_SUBTYPE_OFT_DIRECTIM) {
@@ -1114,7 +1136,7 @@
 
 	} else {
 		aim_rxcallback_t userfunc;
-		struct aim_fileheader_t *header = aim_oft_getheader(&fr->data);
+		PeerFrame *header = aim_oft_getheader(&fr->data);
 		aim_oft_dirconvert_fromstupid(header->name); /* XXX - This should be client-side */
 
 		if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, fr->hdr.rend.type)))
@@ -1135,24 +1157,25 @@
  *
  * @param sess The session.
  * @param fr The frame allocated for the incoming data.
- * @return Return 0 if the packet was handled correctly, otherwise return the 
+ * @return Return 0 if the packet was handled correctly, otherwise return the
  *         error number.
  */
-faim_internal struct aim_rv_proxy_info *aim_rv_proxy_read(aim_session_t *sess, aim_conn_t *conn)
+PeerProxyInfo *
+aim_rv_proxy_read(OscarSession *sess, OscarConnection *conn)
 {
-	aim_bstream_t bs_hdr;
+	ByteStream bs_hdr;
 	guint8 hdr_buf[AIM_RV_PROXY_HDR_LEN];
-	aim_bstream_t bs_body; /* The body (everything but the header) of the packet */
+	ByteStream bs_body; /* The body (everything but the header) of the packet */
 	guint8 *body_buf = NULL;
 	guint8 body_len;
-	
+
 	char str_ip[30] = {""};
 	guint8 ip_temp[4];
-	
+
 	guint16 len;
-	struct aim_rv_proxy_info *proxy_info;
-	
-	if(!(proxy_info = malloc(sizeof(struct aim_rv_proxy_info))))
+	PeerProxyInfo *proxy_info;
+
+	if(!(proxy_info = malloc(sizeof(PeerProxyInfo))))
 		return NULL;
 
 	aim_bstream_init(&bs_hdr, hdr_buf, AIM_RV_PROXY_HDR_LEN);
@@ -1213,7 +1236,7 @@
 			}
 		} else {
 			gaim_debug_warning("oscar","unknown type for aim rendezvous proxy packet\n");
-		}	
+		}
 	} else {
 		gaim_debug_warning("oscar","error reading header of rv proxy packet\n");
 		aim_conn_close(conn);
--- a/src/protocols/oscar/peer.h	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/peer.h	Sun Feb 12 16:02:05 2006 +0000
@@ -33,66 +33,70 @@
 #ifndef _PEER_H_
 #define _PEER_H_
 
+typedef struct _PeerFrame          PeerFrame;
+typedef struct _PeerInfo           PeerInfo;
+typedef struct _PeerProxyInfo      PeerProxyInfo;
+
 #define AIM_CB_FAM_OFT 0xfffe /* OFT/Rvous */
 
-#define OFT_TYPE_DIRECTIMCONNECTREQ 0x0001	/* connect request -- actually an OSCAR CAP */
-#define OFT_TYPE_DIRECTIMINCOMING 0x0002
-#define OFT_TYPE_DIRECTIMDISCONNECT 0x0003
-#define OFT_TYPE_DIRECTIMTYPING 0x0004
-#define OFT_TYPE_DIRECTIM_ESTABLISHED 0x0005
+#define PEER_TYPE_DIRECTIMCONNECTREQ 0x0001	/* connect request -- actually an OSCAR CAP */
+#define PEER_TYPE_DIRECTIMINCOMING 0x0002
+#define PEER_TYPE_DIRECTIMDISCONNECT 0x0003
+#define PEER_TYPE_DIRECTIMTYPING 0x0004
+#define PEER_TYPE_DIRECTIM_ESTABLISHED 0x0005
 
-#define OFT_TYPE_PROMPT 0x0101		/* "I am going to send you this file, is that ok?" */
-#define OFT_TYPE_RESUMESOMETHING 0x0106	/* I really don't know */
-#define OFT_TYPE_ACK 0x0202			/* "Yes, it is ok for you to send me that file" */
-#define OFT_TYPE_DONE 0x0204			/* "I received that file with no problems, thanks a bunch" */
-#define OFT_TYPE_RESUME 0x0205		/* Resume transferring, sent by whoever paused? */
-#define OFT_TYPE_RESUMEACK 0x0207		/* Not really sure */
+#define PEER_TYPE_PROMPT 0x0101		/* "I am going to send you this file, is that ok?" */
+#define PEER_TYPE_RESUMESOMETHING 0x0106	/* I really don't know */
+#define PEER_TYPE_ACK 0x0202			/* "Yes, it is ok for you to send me that file" */
+#define PEER_TYPE_DONE 0x0204			/* "I received that file with no problems, thanks a bunch" */
+#define PEER_TYPE_RESUME 0x0205		/* Resume transferring, sent by whoever paused? */
+#define PEER_TYPE_RESUMEACK 0x0207		/* Not really sure */
 
-#define OFT_TYPE_GETFILE_REQUESTLISTING 0x1108 /* "I have a listing.txt file, do you want it?" */
-#define OFT_TYPE_GETFILE_RECEIVELISTING 0x1209 /* "Yes, please send me your listing.txt file" */
-#define OFT_TYPE_GETFILE_RECEIVEDLISTING 0x120a /* received corrupt listing.txt file? I'm just guessing about this one... */
-#define OFT_TYPE_GETFILE_ACKLISTING 0x120b	/* "I received the listing.txt file successfully" */
-#define OFT_TYPE_GETFILE_REQUESTFILE 0x120c	/* "Please send me this file" */
+#define PEER_TYPE_GETFILE_REQUESTLISTING 0x1108 /* "I have a listing.txt file, do you want it?" */
+#define PEER_TYPE_GETFILE_RECEIVELISTING 0x1209 /* "Yes, please send me your listing.txt file" */
+#define PEER_TYPE_GETFILE_RECEIVEDLISTING 0x120a /* received corrupt listing.txt file? I'm just guessing about this one... */
+#define PEER_TYPE_GETFILE_ACKLISTING 0x120b	/* "I received the listing.txt file successfully" */
+#define PEER_TYPE_GETFILE_REQUESTFILE 0x120c	/* "Please send me this file" */
 
-#define OFT_TYPE_ESTABLISHED 0xFFFF		/* connection to buddy initiated */
-
+#define PEER_TYPE_ESTABLISHED 0xFFFF		/* connection to buddy initiated */
 
-struct aim_fileheader_t {
+struct _PeerFrame
+{
 #if 0
-	char magic[4];		/* 0 */
-	guint16 hdrlen;		/* 4 */
-	guint16 hdrtype;		/* 6 */
+	char magic[4];           /* 0 */
+	guint16 hdrlen;          /* 4 */
+	guint16 hdrtype;         /* 6 */
 #endif
-	guchar bcookie[8];	/* 8 */
-	guint16 encrypt;		/* 16 */
-	guint16 compress;	/* 18 */
-	guint16 totfiles;	/* 20 */
-	guint16 filesleft;	/* 22 */
-	guint16 totparts;	/* 24 */
-	guint16 partsleft;	/* 26 */
-	guint32 totsize;		/* 28 */
-	guint32 size;		/* 32 */
-	guint32 modtime;		/* 36 */
-	guint32 checksum;	/* 40 */
-	guint32 rfrcsum;		/* 44 */
-	guint32 rfsize;		/* 48 */
-	guint32 cretime;		/* 52 */
-	guint32 rfcsum;		/* 56 */
-	guint32 nrecvd;		/* 60 */
-	guint32 recvcsum;	/* 64 */
-	char idstring[32];	/* 68 */
-	guint8 flags;		/* 100 */
-	guint8 lnameoffset;	/* 101 */
-	guint8 lsizeoffset;	/* 102 */
-	char dummy[69];		/* 103 */
-	char macfileinfo[16];	/* 172 */
-	guint16 nencode;		/* 188 */
-	guint16 nlanguage;	/* 190 */
-	char name[64];		/* 192 */
-				/* 256 */
+	guchar bcookie[8];       /* 8 */
+	guint16 encrypt;         /* 16 */
+	guint16 compress;        /* 18 */
+	guint16 totfiles;        /* 20 */
+	guint16 filesleft;       /* 22 */
+	guint16 totparts;        /* 24 */
+	guint16 partsleft;       /* 26 */
+	guint32 totsize;         /* 28 */
+	guint32 size;            /* 32 */
+	guint32 modtime;         /* 36 */
+	guint32 checksum;        /* 40 */
+	guint32 rfrcsum;         /* 44 */
+	guint32 rfsize;          /* 48 */
+	guint32 cretime;         /* 52 */
+	guint32 rfcsum;          /* 56 */
+	guint32 nrecvd;          /* 60 */
+	guint32 recvcsum;        /* 64 */
+	char idstring[32];       /* 68 */
+	guint8 flags;            /* 100 */
+	guint8 lnameoffset;      /* 101 */
+	guint8 lsizeoffset;      /* 102 */
+	char dummy[69];          /* 103 */
+	char macfileinfo[16];    /* 172 */
+	guint16 nencode;         /* 188 */
+	guint16 nlanguage;       /* 190 */
+	char name[64];           /* 192 */
+	/* Payload? */           /* 256 */
 };
 
-struct aim_rv_proxy_info {
+struct _PeerProxyInfo {
 	guint16 packet_ver;
 	guint16 cmd_type;
 	guint16 flags;
@@ -101,11 +105,11 @@
 	guchar cookie[8];
 	guint32 unknownA;
 	guint16 err_code; /* Valid only for cmd_type of AIM_RV_PROXY_ERROR */
-	aim_conn_t *conn;
-	aim_session_t *sess;
+	OscarConnection *conn;
+	OscarSession *sess;
 };
 
-struct aim_oft_info {
+struct _PeerInfo {
 	guchar cookie[8];
 	char *sn;
 	char *proxyip;
@@ -120,42 +124,49 @@
 	int redir_attempted; /* Have we previously attempted to redirect the connection? */
 	guint32 res_bytes; /* The bytes already received for resuming a transfer */
 
-	aim_conn_t *conn;
-	aim_session_t *sess;
+	OscarConnection *conn;
+	OscarSession *sess;
 	int success; /* Was the connection successful? Used for timing out the transfer. */
-	struct aim_fileheader_t fh;
-	struct aim_oft_info *next;
-	struct aim_rv_proxy_info *proxy_info;
+	PeerFrame fh;
+	struct _PeerInfo *next;
+	PeerProxyInfo *proxy_info;
 };
 
-faim_export guint32 aim_oft_checksum_chunk(const guint8 *buffer, int bufferlen, guint32 prevcheck);
-faim_export guint32 aim_oft_checksum_file(char *filename);
-faim_export int aim_handlerendconnect(aim_session_t *sess, aim_conn_t *cur);
-faim_export int aim_odc_send_typing(aim_session_t *sess, aim_conn_t *conn, int typing);
-faim_export int aim_odc_send_im(aim_session_t *sess, aim_conn_t *conn, const char *msg, int len, int encoding, int isawaymsg);
-faim_export const char *aim_odc_getsn(aim_conn_t *conn);
-faim_export const guchar *aim_odc_getcookie(aim_conn_t *conn);
-faim_export aim_conn_t *aim_odc_getconn(aim_session_t *sess, const char *sn);
-faim_export aim_conn_t *aim_odc_initiate(aim_session_t *sess, const char *sn, int listenfd,
-                                         const guint8 *localip, guint16 port, const guchar *mycookie);
-faim_export aim_conn_t *aim_odc_connect(aim_session_t *sess, const char *sn, const char *addr, const guchar *cookie);
+int aim_handlerendconnect(OscarSession *sess, OscarConnection *cur);
+int aim_rxdispatch_rendezvous(OscarSession *sess, FlapFrame *fr);
 
-faim_export struct aim_oft_info *aim_oft_createinfo(aim_session_t *sess, const guchar *cookie, const char *sn,
+/*
+ * OFT
+ */
+int aim_sendfile_listen(OscarSession *sess, PeerInfo *oft_info, int listenfd);
+int aim_oft_sendheader(OscarSession *sess, guint16 type, PeerInfo *oft_info);
+guint32 aim_oft_checksum_chunk(const guint8 *buffer, int bufferlen, guint32 prevcheck);
+guint32 aim_oft_checksum_file(char *filename);
+int aim_oft_sendheader(OscarSession *sess, guint16 type, PeerInfo *oft_info);
+PeerInfo *aim_oft_createinfo(OscarSession *sess, const guchar *cookie, const char *sn,
 	const char *ip, guint16 port, guint32 size, guint32 modtime, char *filename, int send_or_recv,
 	int method, int stage);
-faim_export int aim_oft_destroyinfo(struct aim_oft_info *oft_info);
-faim_export struct aim_rv_proxy_info *aim_rv_proxy_createinfo(aim_session_t *sess, const guchar *cookie, guint16 port);
-faim_export int aim_sendfile_listen(aim_session_t *sess, struct aim_oft_info *oft_info, int listenfd);
-faim_export int aim_oft_sendheader(aim_session_t *sess, guint16 type, struct aim_oft_info *oft_info);
+int aim_oft_destroyinfo(PeerInfo *oft_info);
 
-faim_export int aim_rv_proxy_init_recv(struct aim_rv_proxy_info *proxy_info);
-faim_export int aim_rv_proxy_init_send(struct aim_rv_proxy_info *proxy_info);
+/*
+ * ODC
+ */
+int aim_odc_send_typing(OscarSession *sess, OscarConnection *conn, int typing);
+int aim_odc_send_im(OscarSession *sess, OscarConnection *conn, const char *msg, int len, int encoding, int isawaymsg);
+const char *aim_odc_getsn(OscarConnection *conn);
+const guchar *aim_odc_getcookie(OscarConnection *conn);
+OscarConnection *aim_odc_getconn(OscarSession *sess, const char *sn);
+OscarConnection *aim_odc_initiate(OscarSession *sess, const char *sn, int listenfd,
+                                         const guint8 *localip, guint16 port, const guchar *mycookie);
+OscarConnection *aim_odc_connect(OscarSession *sess, const char *sn, const char *addr, const guchar *cookie);
 
-faim_export int aim_sendfile_listen(aim_session_t *sess, struct aim_oft_info *oft_info, int listenfd);
-faim_export int aim_oft_sendheader(aim_session_t *sess, guint16 type, struct aim_oft_info *oft_info);
-faim_internal struct aim_rv_proxy_info *aim_rv_proxy_read(aim_session_t *sess, aim_conn_t *conn);
+/*
+ * Rendezvous proxy
+ */
+PeerProxyInfo *aim_rv_proxy_createinfo(OscarSession *sess, const guchar *cookie, guint16 port);
+int aim_rv_proxy_init_recv(PeerProxyInfo *proxy_info);
+int aim_rv_proxy_init_send(PeerProxyInfo *proxy_info);
 
-
-faim_internal int aim_rxdispatch_rendezvous(aim_session_t *sess, aim_frame_t *fr);
+PeerProxyInfo *aim_rv_proxy_read(OscarSession *sess, OscarConnection *conn);
 
 #endif /* _PEER_H_ */
--- a/src/protocols/oscar/rxhandlers.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/rxhandlers.c	Sun Feb 12 16:02:05 2006 +0000
@@ -38,7 +38,7 @@
 	struct aim_rxcblist_s *next;
 };
 
-faim_internal aim_module_t *aim__findmodulebygroup(aim_session_t *sess, guint16 group)
+faim_internal aim_module_t *aim__findmodulebygroup(OscarSession *sess, guint16 group)
 {
 	aim_module_t *cur;
 
@@ -50,7 +50,7 @@
 	return NULL;
 }
 
-faim_internal aim_module_t *aim__findmodule(aim_session_t *sess, const char *name)
+faim_internal aim_module_t *aim__findmodule(OscarSession *sess, const char *name)
 {
 	aim_module_t *cur;
 
@@ -62,7 +62,7 @@
 	return NULL;
 }
 
-faim_internal int aim__registermodule(aim_session_t *sess, int (*modfirst)(aim_session_t *, aim_module_t *))
+faim_internal int aim__registermodule(OscarSession *sess, int (*modfirst)(OscarSession *, aim_module_t *))
 {
 	aim_module_t *mod;
 
@@ -93,7 +93,7 @@
 	return 0;
 }
 
-faim_internal void aim__shutdownmodules(aim_session_t *sess)
+faim_internal void aim__shutdownmodules(OscarSession *sess)
 {
 	aim_module_t *cur;
 
@@ -115,7 +115,7 @@
 	return;
 }
 
-static int consumesnac(aim_session_t *sess, aim_frame_t *rx)
+static int consumesnac(OscarSession *sess, FlapFrame *rx)
 {
 	aim_module_t *cur;
 	aim_modsnac_t snac;
@@ -163,7 +163,7 @@
 	return 0;
 }
 
-static int consumenonsnac(aim_session_t *sess, aim_frame_t *rx, guint16 family, guint16 subtype)
+static int consumenonsnac(OscarSession *sess, FlapFrame *rx, guint16 family, guint16 subtype)
 {
 	aim_module_t *cur;
 	aim_modsnac_t snac;
@@ -186,7 +186,7 @@
 	return 0;
 }
 
-static int negchan_middle(aim_session_t *sess, aim_frame_t *fr)
+static int negchan_middle(OscarSession *sess, FlapFrame *fr)
 {
 	aim_tlvlist_t *tlvlist;
 	char *msg = NULL;
@@ -226,7 +226,7 @@
  * Bleck functions get called when there's no non-bleck functions
  * around to cleanup the mess...
  */
-static int bleck(aim_session_t *sess, aim_frame_t *frame, ...)
+static int bleck(OscarSession *sess, FlapFrame *frame, ...)
 {
 	guint16 family, subtype;
 	guint16 maxf, maxs;
@@ -411,7 +411,7 @@
 	return 1;
 }
 
-faim_export int aim_conn_addhandler(aim_session_t *sess, aim_conn_t *conn, guint16 family, guint16 type, aim_rxcallback_t newhandler, guint16 flags)
+faim_export int aim_conn_addhandler(OscarSession *sess, OscarConnection *conn, guint16 family, guint16 type, aim_rxcallback_t newhandler, guint16 flags)
 {
 	struct aim_rxcblist_s *newcb;
 
@@ -442,7 +442,7 @@
 	return 0;
 }
 
-faim_export int aim_clearhandlers(aim_conn_t *conn)
+faim_export int aim_clearhandlers(OscarConnection *conn)
 {
 	struct aim_rxcblist_s *cur;
 
@@ -461,7 +461,7 @@
 	return 0;
 }
 
-faim_internal aim_rxcallback_t aim_callhandler(aim_session_t *sess, aim_conn_t *conn, guint16 family, guint16 type)
+faim_internal aim_rxcallback_t aim_callhandler(OscarSession *sess, OscarConnection *conn, guint16 family, guint16 type)
 {
 	struct aim_rxcblist_s *cur;
 
@@ -485,7 +485,7 @@
 	return aim_callhandler(sess, conn, family, AIM_CB_SPECIAL_DEFAULT);
 }
 
-faim_internal void aim_clonehandlers(aim_session_t *sess, aim_conn_t *dest, aim_conn_t *src)
+faim_internal void aim_clonehandlers(OscarSession *sess, OscarConnection *dest, OscarConnection *src)
 {
 	struct aim_rxcblist_s *cur;
 
@@ -497,7 +497,7 @@
 	return;
 }
 
-faim_internal int aim_callhandler_noparam(aim_session_t *sess, aim_conn_t *conn,guint16 family, guint16 type, aim_frame_t *ptr)
+faim_internal int aim_callhandler_noparam(OscarSession *sess, OscarConnection *conn,guint16 family, guint16 type, FlapFrame *ptr)
 {
 	aim_rxcallback_t userfunc;
 
@@ -522,10 +522,10 @@
  * TODO: Allow for NULL handlers.
  *
  */
-faim_export void aim_rxdispatch(aim_session_t *sess)
+faim_export void aim_rxdispatch(OscarSession *sess)
 {
 	int i;
-	aim_frame_t *cur;
+	FlapFrame *cur;
 
 	for (cur = sess->queue_incoming, i = 0; cur; cur = cur->next, i++) {
 
@@ -584,7 +584,7 @@
 	return;
 }
 
-faim_internal int aim_parse_unknown(aim_session_t *sess, aim_frame_t *frame, ...)
+faim_internal int aim_parse_unknown(OscarSession *sess, FlapFrame *frame, ...)
 {
 	int i;
 
--- a/src/protocols/oscar/rxqueue.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/rxqueue.c	Sun Feb 12 16:02:05 2006 +0000
@@ -57,7 +57,7 @@
  * Read into a byte stream.  Will not read more than count, but may read
  * less if there is not enough room in the stream buffer.
  */
-faim_internal int aim_bstream_recv(aim_bstream_t *bs, int fd, size_t count)
+faim_internal int aim_bstream_recv(ByteStream *bs, int fd, size_t count)
 {
 	int red = 0;
 
@@ -81,12 +81,12 @@
 }
 
 /**
- * Free an aim_frame_t
+ * Free an FlapFrame
  *
  * @param frame The frame to free.
  * @return -1 on error; 0 on success.
  */
-faim_internal void aim_frame_destroy(aim_frame_t *frame)
+faim_internal void aim_frame_destroy(FlapFrame *frame)
 {
 
 	free(frame->data.data); /* XXX aim_bstream_free */
@@ -101,10 +101,10 @@
  *
  * @return -1 on error, otherwise return the length of the payload.
  */
-static int aim_get_command_flap(aim_session_t *sess, aim_conn_t *conn, aim_frame_t *fr)
+static int aim_get_command_flap(OscarSession *sess, OscarConnection *conn, FlapFrame *fr)
 {
 	guint8 hdr_raw[6];
-	aim_bstream_t hdr;
+	ByteStream hdr;
 
 	fr->hdrtype = AIM_FRAMETYPE_FLAP;
 
@@ -149,10 +149,10 @@
  *
  * @return -1 on error, otherwise return the length of the payload.
  */
-static int aim_get_command_rendezvous(aim_session_t *sess, aim_conn_t *conn, aim_frame_t *fr)
+static int aim_get_command_rendezvous(OscarSession *sess, OscarConnection *conn, FlapFrame *fr)
 {
 	guint8 hdr_raw[8];
-	aim_bstream_t hdr;
+	ByteStream hdr;
 
 	fr->hdrtype = AIM_FRAMETYPE_OFT;
 
@@ -182,9 +182,9 @@
  *         "Success" doesn't mean we have new data, it just means
  *         the connection isn't dead.
  */
-faim_export int aim_get_command(aim_session_t *sess, aim_conn_t *conn)
+faim_export int aim_get_command(OscarSession *sess, OscarConnection *conn)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 	int payloadlen;
 
 	if (!sess || !conn)
@@ -201,7 +201,7 @@
 	if (conn->status & AIM_CONN_STATUS_INPROGRESS)
 		return aim_conn_completeconnect(sess, conn);
 
-	if (!(fr = (aim_frame_t *)calloc(sizeof(aim_frame_t), 1)))
+	if (!(fr = (FlapFrame *)calloc(sizeof(FlapFrame), 1)))
 		return -ENOMEM;
 
 	/*
@@ -250,7 +250,7 @@
 	if (sess->queue_incoming == NULL)
 		sess->queue_incoming = fr;
 	else {
-		aim_frame_t *cur;
+		FlapFrame *cur;
 		for (cur = sess->queue_incoming; cur->next; cur = cur->next);
 		cur->next = fr;
 	}
@@ -264,9 +264,9 @@
  * Purge receive queue of all handled commands (->handled==1).
  *
  */
-faim_export void aim_purge_rxqueue(aim_session_t *sess)
+faim_export void aim_purge_rxqueue(OscarSession *sess)
 {
-	aim_frame_t *cur, **prev;
+	FlapFrame *cur, **prev;
 
 	for (prev = &sess->queue_incoming; (cur = *prev); ) {
 		if (cur->handled) {
@@ -286,9 +286,9 @@
  * XXX: this is something that was handled better in the old connection
  * handling method, but eh.
  */
-faim_internal void aim_rxqueue_cleanbyconn(aim_session_t *sess, aim_conn_t *conn)
+faim_internal void aim_rxqueue_cleanbyconn(OscarSession *sess, OscarConnection *conn)
 {
-	aim_frame_t *currx;
+	FlapFrame *currx;
 
 	for (currx = sess->queue_incoming; currx; currx = currx->next) {
 		if ((!currx->handled) && (currx->conn == conn))
--- a/src/protocols/oscar/snac.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/snac.c	Sun Feb 12 16:02:05 2006 +0000
@@ -37,7 +37,7 @@
 /*
  * Called from aim_session_init() to initialize the hash.
  */
-faim_internal void aim_initsnachash(aim_session_t *sess)
+faim_internal void aim_initsnachash(OscarSession *sess)
 {
 	int i;
 
@@ -47,7 +47,7 @@
 	return;
 }
 
-faim_internal aim_snacid_t aim_cachesnac(aim_session_t *sess, const guint16 family, const guint16 type, const guint16 flags, const void *data, const int datalen)
+faim_internal aim_snacid_t aim_cachesnac(OscarSession *sess, const guint16 family, const guint16 type, const guint16 flags, const void *data, const int datalen)
 {
 	aim_snac_t snac;
 
@@ -70,7 +70,7 @@
  * Clones the passed snac structure and caches it in the
  * list/hash.
  */
-faim_internal aim_snacid_t aim_newsnac(aim_session_t *sess, aim_snac_t *newsnac)
+faim_internal aim_snacid_t aim_newsnac(OscarSession *sess, aim_snac_t *newsnac)
 {
 	aim_snac_t *snac;
 	int index;
@@ -98,7 +98,7 @@
  * The returned structure must be freed by the caller.
  *
  */
-faim_internal aim_snac_t *aim_remsnac(aim_session_t *sess, aim_snacid_t id) 
+faim_internal aim_snac_t *aim_remsnac(OscarSession *sess, aim_snacid_t id) 
 {
 	aim_snac_t *cur, **prev;
 	int index;
@@ -127,7 +127,7 @@
  * maxage is the _minimum_ age in seconds to keep SNACs.
  *
  */
-faim_export void aim_cleansnacs(aim_session_t *sess, int maxage)
+faim_export void aim_cleansnacs(OscarSession *sess, int maxage)
 {
 	int i;
 
@@ -155,7 +155,7 @@
 	return;
 }
 
-faim_internal int aim_putsnac(aim_bstream_t *bs, guint16 family, guint16 subtype, guint16 flags, aim_snacid_t snacid)
+faim_internal int aim_putsnac(ByteStream *bs, guint16 family, guint16 subtype, guint16 flags, aim_snacid_t snacid)
 {
 
 	aimbs_put16(bs, family);
--- a/src/protocols/oscar/tlv.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/tlv.c	Sun Feb 12 16:02:05 2006 +0000
@@ -64,7 +64,7 @@
  * @param bs Input bstream
  * @return Return the TLV chain read
  */
-faim_internal aim_tlvlist_t *aim_tlvlist_read(aim_bstream_t *bs)
+faim_internal aim_tlvlist_t *aim_tlvlist_read(ByteStream *bs)
 {
 	aim_tlvlist_t *list = NULL, *cur;
 
@@ -149,7 +149,7 @@
  *        preceded by the number of TLVs.  So you can limit that with this.
  * @return Return the TLV chain read
  */
-faim_internal aim_tlvlist_t *aim_tlvlist_readnum(aim_bstream_t *bs, guint16 num)
+faim_internal aim_tlvlist_t *aim_tlvlist_readnum(ByteStream *bs, guint16 num)
 {
 	aim_tlvlist_t *list = NULL, *cur;
 
@@ -218,7 +218,7 @@
  *        preceded by the length of the TLVs.  So you can limit that with this.
  * @return Return the TLV chain read
  */
-faim_internal aim_tlvlist_t *aim_tlvlist_readlen(aim_bstream_t *bs, guint16 len)
+faim_internal aim_tlvlist_t *aim_tlvlist_readlen(ByteStream *bs, guint16 len)
 {
 	aim_tlvlist_t *list = NULL, *cur;
 
@@ -294,7 +294,7 @@
  */
 faim_internal int aim_tlvlist_cmp(aim_tlvlist_t *one, aim_tlvlist_t *two)
 {
-	aim_bstream_t bs1, bs2;
+	ByteStream bs1, bs2;
 
 	if (aim_tlvlist_size(&one) != aim_tlvlist_size(&two))
 		return 1;
@@ -513,7 +513,7 @@
 faim_internal int aim_tlvlist_add_caps(aim_tlvlist_t **list, const guint16 type, const guint32 caps)
 {
 	guint8 buf[16*16]; /* XXX icky fixed length buffer */
-	aim_bstream_t bs;
+	ByteStream bs;
 
 	if (!caps)
 		return 0; /* nothing there anyway */
@@ -535,7 +535,7 @@
 faim_internal int aim_tlvlist_add_userinfo(aim_tlvlist_t **list, guint16 type, aim_userinfo_t *userinfo)
 {
 	guint8 buf[1024]; /* bleh */
-	aim_bstream_t bs;
+	ByteStream bs;
 
 	aim_bstream_init(&bs, buf, sizeof(buf));
 
@@ -557,7 +557,7 @@
 {
 	guint8 *buf;
 	int len;
-	aim_bstream_t bs;
+	ByteStream bs;
 
 	len = 2 + 1 + strlen(roomname) + 2;
 
@@ -610,7 +610,7 @@
 {
 	guint8 *buf;
 	int buflen;
-	aim_bstream_t bs;
+	ByteStream bs;
 
 	buflen = aim_tlvlist_size(tl);
 
@@ -778,7 +778,7 @@
  * @param list Source TLV chain
  * @return Return 0 if the destination bstream is too small.
  */
-faim_internal int aim_tlvlist_write(aim_bstream_t *bs, aim_tlvlist_t **list)
+faim_internal int aim_tlvlist_write(ByteStream *bs, aim_tlvlist_t **list)
 {
 	int goodbuflen;
 	aim_tlvlist_t *cur;
--- a/src/protocols/oscar/txqueue.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/txqueue.c	Sun Feb 12 16:02:05 2006 +0000
@@ -46,9 +46,9 @@
  * chan = channel for FLAP, hdrtype for OFT
  *
  */
-faim_internal aim_frame_t *aim_tx_new(aim_session_t *sess, aim_conn_t *conn, guint8 framing, guint16 chan, int datalen)
+faim_internal FlapFrame *aim_tx_new(OscarSession *sess, OscarConnection *conn, guint8 framing, guint16 chan, int datalen)
 {
-	aim_frame_t *fr;
+	FlapFrame *fr;
 
 	if (!sess || !conn) {
 		gaim_debug_misc("oscar", "aim_tx_new: No session or no connection specified!\n");
@@ -68,7 +68,7 @@
 		}
 	}
 
-	if (!(fr = (aim_frame_t *)calloc(1, sizeof(aim_frame_t))))
+	if (!(fr = (FlapFrame *)calloc(1, sizeof(FlapFrame))))
 		return NULL;
 
 	fr->conn = conn;
@@ -100,7 +100,7 @@
  * normally called during the final step of packet preparation
  * before enqueuement (in aim_tx_enqueue()).
  */
-static flap_seqnum_t aim_get_next_txseqnum(aim_conn_t *conn)
+static flap_seqnum_t aim_get_next_txseqnum(OscarConnection *conn)
 {
 	flap_seqnum_t ret;
 
@@ -121,7 +121,7 @@
  * that is, when sess->tx_enqueue is set to &aim_tx_enqueue__queuebased.
  *
  */
-static int aim_tx_enqueue__queuebased(aim_session_t *sess, aim_frame_t *fr)
+static int aim_tx_enqueue__queuebased(OscarSession *sess, FlapFrame *fr)
 {
 
 	if (!fr->conn) {
@@ -140,7 +140,7 @@
 	if (!sess->queue_outgoing)
 		sess->queue_outgoing = fr;
 	else {
-		aim_frame_t *cur;
+		FlapFrame *cur;
 		for (cur = sess->queue_outgoing; cur->next; cur = cur->next);
 		cur->next = fr;
 	}
@@ -157,7 +157,7 @@
  * right here.
  *
  */
-static int aim_tx_enqueue__immediate(aim_session_t *sess, aim_frame_t *fr)
+static int aim_tx_enqueue__immediate(OscarSession *sess, FlapFrame *fr)
 {
 	int ret;
 
@@ -179,7 +179,7 @@
 	return ret;
 }
 
-faim_export int aim_tx_setenqueue(aim_session_t *sess, int what, int (*func)(aim_session_t *, aim_frame_t *))
+faim_export int aim_tx_setenqueue(OscarSession *sess, int what, int (*func)(OscarSession *, FlapFrame *))
 {
 
 	if (what == AIM_TX_QUEUED)
@@ -196,7 +196,7 @@
 	return 0;
 }
 
-faim_internal int aim_tx_enqueue(aim_session_t *sess, aim_frame_t *fr)
+faim_internal int aim_tx_enqueue(OscarSession *sess, FlapFrame *fr)
 {
 
 	/*
@@ -233,7 +233,7 @@
 	return cur;
 }
 
-faim_internal int aim_bstream_send(aim_bstream_t *bs, aim_conn_t *conn, size_t count)
+faim_internal int aim_bstream_send(ByteStream *bs, OscarConnection *conn, size_t count)
 {
 	int wrote = 0;
 
@@ -279,9 +279,9 @@
 	return wrote;
 }
 
-static int sendframe_flap(aim_session_t *sess, aim_frame_t *fr)
+static int sendframe_flap(OscarSession *sess, FlapFrame *fr)
 {
-	aim_bstream_t bs;
+	ByteStream bs;
 	guint8 *bs_raw;
 	int payloadlen, err = 0, bslen;
 
@@ -315,9 +315,9 @@
 	return err;
 }
 
-static int sendframe_rendezvous(aim_session_t *sess, aim_frame_t *fr)
+static int sendframe_rendezvous(OscarSession *sess, FlapFrame *fr)
 {
-	aim_bstream_t bs;
+	ByteStream bs;
 	guint8 *bs_raw;
 	int payloadlen, err = 0, bslen;
 
@@ -350,7 +350,7 @@
 	return err;
 }
 
-faim_internal int aim_tx_sendframe(aim_session_t *sess, aim_frame_t *fr)
+faim_internal int aim_tx_sendframe(OscarSession *sess, FlapFrame *fr)
 {
 	if (fr->hdrtype == AIM_FRAMETYPE_FLAP)
 		return sendframe_flap(sess, fr);
@@ -360,9 +360,9 @@
 	return -1;
 }
 
-faim_export int aim_tx_flushqueue(aim_session_t *sess)
+faim_export int aim_tx_flushqueue(OscarSession *sess)
 {
-	aim_frame_t *cur;
+	FlapFrame *cur;
 
 	for (cur = sess->queue_outgoing; cur; cur = cur->next) {
 
@@ -402,9 +402,9 @@
  * queue. This is not a required operation, but it of course helps
  * reduce memory footprint at run time!  
  */
-faim_export void aim_tx_purgequeue(aim_session_t *sess)
+faim_export void aim_tx_purgequeue(OscarSession *sess)
 {
-	aim_frame_t *cur, **prev;
+	FlapFrame *cur, **prev;
 
 	for (prev = &sess->queue_outgoing; (cur = *prev); ) {
 		if (cur->handled) {
@@ -425,9 +425,9 @@
  * @param sess A session.
  * @param conn Connection that's dying.
  */
-faim_internal void aim_tx_cleanqueue(aim_session_t *sess, aim_conn_t *conn)
+faim_internal void aim_tx_cleanqueue(OscarSession *sess, OscarConnection *conn)
 {
-	aim_frame_t *cur;
+	FlapFrame *cur;
 
 	for (cur = sess->queue_outgoing; cur; cur = cur->next) {
 		if (cur->conn == conn)
--- a/src/protocols/oscar/util.c	Sun Feb 12 15:27:11 2006 +0000
+++ b/src/protocols/oscar/util.c	Sun Feb 12 16:02:05 2006 +0000
@@ -32,12 +32,6 @@
 #include "win32dep.h"
 #endif
 
-faim_export int aimutil_putstr(char *dest, const char *src, int len)
-{
-	memcpy(dest, src, len);
-	return len;
-}
-
 /*
  * Tokenizing functions.  Used to portably replace strtok/sep.
  *   -- DMP.