-u_long aim_accepttransfer(struct aim_session_t *sess,
- struct aim_conn_t *conn,
- char *sender,
- char *cookie,
- unsigned short rendid)
-{
- struct command_tx_struct *newpacket;
- int curbyte, i;
-
- if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+8+2+1+strlen(sender)+4+2+8+16)))
- return -1;
-
- newpacket->lock = 1;
-
- curbyte = aim_putsnac(newpacket->data, 0x0004, 0x0006, 0x0000, sess->snac_nextid);
- for (i = 0; i < 8; i++)
- curbyte += aimutil_put8(newpacket->data+curbyte, cookie[i]);
- curbyte += aimutil_put16(newpacket->data+curbyte, 0x0002);
- curbyte += aimutil_put8(newpacket->data+curbyte, strlen(sender));
- curbyte += aimutil_putstr(newpacket->data+curbyte, sender, strlen(sender));
- curbyte += aimutil_put16(newpacket->data+curbyte, 0x0005);
- curbyte += aimutil_put16(newpacket->data+curbyte, 0x001a);
- curbyte += aimutil_put16(newpacket->data+curbyte, 0x0002 /* accept */);
- for (i = 0; i < 8; i++)
- curbyte += aimutil_put8(newpacket->data+curbyte, cookie[i]);
- curbyte += aim_putcap(newpacket->data+curbyte, 0x10, rendid);
-
- newpacket->lock = 0;
- aim_tx_enqueue(sess, newpacket);
-
- return (sess->snac_nextid++);
-}
-