No release numbers
------------------
+ - Tue Sep 5 03:47:26 GMT 2000
+ - More ANSIfication for win32
+ - Forgot aim_misc last time.
+
- Mon Sep 4 22:08:35 GMT 2000
- Forgot aim_snac and aim_search
* Generate a random message cookie
*/
for (i=0;i<8;i++)
- curbyte += aimutil_put8(newpacket->data+curbyte, (u_char) random());
+ curbyte += aimutil_put8(newpacket->data+curbyte, (u_char) rand());
aim_cachecookie(sess, aim_mkcookie(newpacket->data+curbyte-8, AIM_COOKIETYPE_CHAT, NULL));
*
*/
- for(i=0;i<strlen(dest);i++) {
+ for(i=0;i<(int)strlen(dest);i++) {
if (dest[i] == ':') {
port = atoi(&(dest[i+1]));
break;
#include <faim/aim.h>
+#ifndef _WIN32
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/utsname.h> /* for aim_directim_initiate */
#include <arpa/inet.h> /* for inet_ntoa */
+#endif
/* aim_msgcookies.c is mostly new. just look at the diff and replace yours, easiest. */
case AIM_CONN_SUBTYPE_OFT_GETFILE: {
struct aim_filetransfer_priv *priv;
- priv->state = 0;
-
priv = (struct aim_filetransfer_priv *)calloc(1, sizeof(struct aim_filetransfer_priv));
snprintf(priv->ip, sizeof(priv->ip), "%s:%u", inet_ntoa(((struct sockaddr_in *)&cliaddr)->sin_addr), ntohs(((struct sockaddr_in *)&cliaddr)->sin_port));
short port = 4443;
struct hostent *hptr;
- struct utsname myname;
+ char localhost[129];
unsigned char cap[16];
char d[4]; /* XXX: IPv6. *cough* */
* get our local IP
*/
- if(uname(&myname) < 0)
+ if(gethostname(localhost, 128) < 0)
return NULL;
- if( (hptr = gethostbyname(myname.nodename)) == NULL)
+ if( (hptr = gethostbyname(localhost)) == NULL)
return NULL;
memcpy(&d, hptr->h_addr_list[0], 4); /* XXX: this probably isn't quite kosher, but it works */
* This cookie needs to be alphanumeric and NULL-terminated to be TOC-compatible.
*/
for (i=0;i<7;i++)
- curbyte += aimutil_put8(newpacket->data+curbyte, 0x30 + ((u_char) random() % 20));
+ curbyte += aimutil_put8(newpacket->data+curbyte, 0x30 + ((u_char) rand() % 20));
curbyte += aimutil_put8(newpacket->data+curbyte, 0x00);
/*
* allocate and set up our connection
*/
+#if 0
i = fcntl(listenfd, F_GETFL, 0);
fcntl(listenfd, F_SETFL, i | O_NONBLOCK);
+#endif
newconn = aim_newconn(sess, AIM_CONN_TYPE_RENDEZVOUS_OUT, NULL);
if (!newconn) {
faim_internal int aim_listenestablish(u_short portnum)
{
+#if defined(__linux__) /* XXX what other OS's support getaddrinfo? */
int listenfd;
const int on = 1;
struct addrinfo hints, *res, *ressave;
}
freeaddrinfo(ressave);
return listenfd;
+#else
+ int listenfd;
+ const int on = 1;
+ struct sockaddr_in sockin;
+
+ if ((listenfd = socket(PF_INET, SOCK_STREAM, AF_INET)) < 0) {
+ perror("socket(listenfd)");
+ return -1;
+ }
+ if (setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on) != 0)) {
+ perror("setsockopt(listenfd)");
+ close(listenfd);
+ return -1;
+ }
+ memset(&sockin, 0, sizeof(struct sockaddr_in));
+ sockin.sin_family = AF_INET;
+ sockin.sin_port = htons(portnum);
+ if (bind(listenfd, (struct sockaddr *)&sockin, sizeof(struct sockaddr_in)) != 0) {
+ perror("bind(listenfd)");
+ close(listenfd);
+ return -1;
+ }
+ if (listen(listenfd, 4) != 0) {
+ perror("listen(listenfd)");
+ close(listenfd);
+ return -1;
+ }
+
+ return listenfd;
+}
+#endif
}
faim_internal int aim_get_command_rendezvous(struct aim_session_t *sess, struct aim_conn_t *conn)
faim_mutex_lock(&conn->active); /* gets locked down for the entirety */
- if ( (hdrlen = read(conn->fd, hdrbuf1, 6)) < 6) {
+ if ( (hdrlen = aim_recv(conn->fd, hdrbuf1, 6)) < 6) {
if(hdrlen < 0)
perror("read");
printf("faim: rend: read error (fd: %i) %02x%02x%02x%02x%02x%02x (%i)\n", conn->fd, hdrbuf1[0],hdrbuf1[1],hdrbuf1[0],hdrbuf1[0],hdrbuf1[0],hdrbuf1[0],hdrlen);
if (!(hdr = malloc(hdrlen)))
return -1;
- if (read(conn->fd, hdr, hdrlen) < hdrlen) {
+ if (aim_recv(conn->fd, hdr, hdrlen) < hdrlen) {
perror("read");
printf("faim: rend: read2 error\n");
free(hdr);
return 0;
}
- if (recv(conn->fd, msg, payloadlength, MSG_WAITALL) < payloadlength) {
+ if (aim_recv(conn->fd, msg, payloadlength) < payloadlength) {
perror("read");
printf("faim: rend: read3 error\n");
free(msg);
data = calloc(1, commandlen);
memcpy(data, "01/01/1999 00:00 100 file.txt\r\n", commandlen);
- if (write(conn->fd, data, commandlen) != commandlen) {
+ if (send(conn->fd, data, commandlen, 0) != commandlen) {
perror("listing write error");
}
faim_mutex_unlock(&conn->active);
if(newoft->commandlen > 0) {
int i;
- bzero(newoft->data, newoft->commandlen);
- for(i = 0; i < newoft->commandlen; i++)
+ memset(newoft->data, 0, newoft->commandlen);
+ for(i = 0; i < (signed)newoft->commandlen; i++)
newoft->data[i] = 0x30 + (i%10);
// memcpy(newoft->data, "This has been a Test\r\n-josh\r\n", newoft->commandlen);
for(i = 0; i < fh->size; i++)
c[i] = 0x30 + (i%10);
- if ( (i = write(conn->fd, c, fh->size)) != fh->size ) {
+ if ( (i = send(conn->fd, c, fh->size, 0)) != fh->size ) {
printf("whoopsy, didn't write it all...\n");
}
*
*/
for (i=0;i<8;i++)
- curbyte += aimutil_put8(newpacket->data+curbyte, (u_char) random());
+ curbyte += aimutil_put8(newpacket->data+curbyte, (u_char) rand());
/*
* Channel ID
aim_addtlvtochain32(&tlvlist, 0x0003, info->onlinesince);
aim_addtlvtochain16(&tlvlist, 0x0004, info->idletime);
/* XXX: should put caps here */
- aim_addtlvtochain32(&tlvlist, (info->class)&AIM_CLASS_AOL?0x0010:0x000f, info->sessionlen);
+ aim_addtlvtochain32(&tlvlist, (unsigned short)((info->class)&AIM_CLASS_AOL?0x0010:0x000f), info->sessionlen);
i += aim_writetlvchain(buf+i, buflen-i, &tlvlist);
aim_freetlvchain(&tlvlist);
if (strlen(clientinfo->clientstring))
curbyte += aim_puttlv_str(newpacket->data+curbyte, 0x0003, strlen(clientinfo->clientstring), clientinfo->clientstring);
- curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0016, clientinfo->major2);
- curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0017, clientinfo->major);
- curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0018, clientinfo->minor);
- curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0019, clientinfo->minor2);
- curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x001a, clientinfo->build);
+ curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0016, (unsigned short)clientinfo->major2);
+ curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0017, (unsigned short)clientinfo->major);
+ curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0018, (unsigned short)clientinfo->minor);
+ curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0019, (unsigned short)clientinfo->minor2);
+ curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x001a, (unsigned short)clientinfo->build);
curbyte += aim_puttlv_32(newpacket->data+curbyte, 0x0014, clientinfo->unknown);
curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0009, 0x0015);
aim_addtlvtochain_str(&tlvlist, 0x0005, bosip, strlen(bosip));
aim_addtlvtochain_str(&tlvlist, 0x0006, cookie, AIM_COOKIELEN);
aim_addtlvtochain_str(&tlvlist, 0x0011, email, strlen(email));
- aim_addtlvtochain16(&tlvlist, 0x0013, regstatus);
+ aim_addtlvtochain16(&tlvlist, 0x0013, (unsigned short)regstatus);
}
tx->commandlen = aim_writetlvchain(tx->data, tx->commandlen, &tlvlist);
* time.
*
*/
-u_long aim_bos_setidle(struct aim_session_t *sess,
- struct aim_conn_t *conn,
- u_long idletime)
+faim_export unsigned long aim_bos_setidle(struct aim_session_t *sess,
+ struct aim_conn_t *conn,
+ u_long idletime)
{
return aim_genericreq_l(sess, conn, 0x0001, 0x0011, &idletime);
}
*
*
*/
-u_long aim_bos_changevisibility(struct aim_session_t *sess,
- struct aim_conn_t *conn,
- int changetype, char *denylist)
+faim_export unsigned long aim_bos_changevisibility(struct aim_session_t *sess,
+ struct aim_conn_t *conn,
+ int changetype,
+ char *denylist)
{
struct command_tx_struct *newpacket;
int packlen = 0;
* XXX: I can't stress the TODO enough.
*
*/
-u_long aim_bos_setbuddylist(struct aim_session_t *sess,
- struct aim_conn_t *conn,
- char *buddy_list)
+faim_export unsigned long aim_bos_setbuddylist(struct aim_session_t *sess,
+ struct aim_conn_t *conn,
+ char *buddy_list)
{
int i, j;
*
*
*/
-u_long aim_bos_setprofile(struct aim_session_t *sess,
- struct aim_conn_t *conn,
- char *profile,
- char *awaymsg,
- unsigned int caps)
+faim_export unsigned long aim_bos_setprofile(struct aim_session_t *sess,
+ struct aim_conn_t *conn,
+ char *profile,
+ char *awaymsg,
+ unsigned short caps)
{
struct command_tx_struct *newpacket;
int i = 0, tmp, caplen;
* a bitwise OR of all the user classes you want to see you.
*
*/
-u_long aim_bos_setgroupperm(struct aim_session_t *sess,
- struct aim_conn_t *conn,
- u_long mask)
+faim_export unsigned long aim_bos_setgroupperm(struct aim_session_t *sess,
+ struct aim_conn_t *conn,
+ u_long mask)
{
return aim_genericreq_l(sess, conn, 0x0009, 0x0004, &mask);
}
-int aim_parse_bosrights(struct aim_session_t *sess,
- struct command_rx_struct *command, ...)
+faim_internal int aim_parse_bosrights(struct aim_session_t *sess,
+ struct command_rx_struct *command, ...)
{
rxcallback_t userfunc = NULL;
int ret=1;
* TODO: Dynamisize.
*
*/
-u_long aim_bos_clientready(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_bos_clientready(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
u_char command_2[] = {
/* placeholders for dynamic data */
* Request Rate Information.
*
*/
-u_long aim_bos_reqrate(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_bos_reqrate(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
return aim_genericreq_n(sess, conn, 0x0001, 0x0006);
}
* Rate Information Response Acknowledge.
*
*/
-u_long aim_bos_ackrateresp(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_bos_ackrateresp(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
struct command_tx_struct *newpacket;
int packlen = 20, i=0;
* Bit 2: Allows other AIM users to see how long you've been a member.
*
*/
-u_long aim_bos_setprivacyflags(struct aim_session_t *sess,
- struct aim_conn_t *conn,
- u_long flags)
+faim_export unsigned long aim_bos_setprivacyflags(struct aim_session_t *sess,
+ struct aim_conn_t *conn,
+ u_long flags)
{
return aim_genericreq_l(sess, conn, 0x0001, 0x0014, &flags);
}
* because aparently it uses SNAC flags.
*
*/
-u_long aim_bos_reqpersonalinfo(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_bos_reqpersonalinfo(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
return aim_genericreq_n(sess, conn, 0x0001, 0x000e);
}
-u_long aim_setversions(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_setversions(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
struct command_tx_struct *newpacket;
int i;
* Service request.
*
*/
-u_long aim_bos_reqservice(struct aim_session_t *sess,
+faim_export unsigned long aim_bos_reqservice(struct aim_session_t *sess,
struct aim_conn_t *conn,
u_short serviceid)
{
* the connection alive. Its not real necessary.
*
*/
-u_long aim_bos_nop(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_bos_nop(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
return aim_genericreq_n(sess, conn, 0x0001, 0x0016);
}
* Request BOS rights.
*
*/
-u_long aim_bos_reqrights(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_bos_reqrights(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
return aim_genericreq_n(sess, conn, 0x0009, 0x0002);
}
* Request Buddy List rights.
*
*/
-u_long aim_bos_reqbuddyrights(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_bos_reqbuddyrights(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
return aim_genericreq_n(sess, conn, 0x0003, 0x0002);
}
* returns -1 on error (couldn't alloc packet), next snacid on success.
*
*/
-int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn, int anon)
+faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn, int anon)
{
struct command_tx_struct *newpacket;
int curbyte;
return (sess->snac_nextid++);
}
-
-
/*
* aim_debugconn_sendconnect()
*
* For aimdebugd. If you don't know what it is, you don't want to.
*/
-u_long aim_debugconn_sendconnect(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_debugconn_sendconnect(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
return aim_genericreq_n(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DEBUGCONN_CONNECT);
}
* back to the single. I don't see any advantage to doing it either way.
*
*/
-u_long aim_genericreq_n(struct aim_session_t *sess,
- struct aim_conn_t *conn,
- u_short family, u_short subtype)
+faim_internal unsigned long aim_genericreq_n(struct aim_session_t *sess,
+ struct aim_conn_t *conn,
+ u_short family, u_short subtype)
{
struct command_tx_struct *newpacket;
*
*
*/
-u_long aim_genericreq_l(struct aim_session_t *sess,
- struct aim_conn_t *conn,
- u_short family, u_short subtype, u_long *longdata)
+faim_internal unsigned long aim_genericreq_l(struct aim_session_t *sess,
+ struct aim_conn_t *conn,
+ u_short family, u_short subtype,
+ u_long *longdata)
{
struct command_tx_struct *newpacket;
u_long newlong;
return (sess->snac_nextid++);
}
-u_long aim_genericreq_s(struct aim_session_t *sess,
- struct aim_conn_t *conn,
- u_short family, u_short subtype, u_short *shortdata)
+faim_internal unsigned long aim_genericreq_s(struct aim_session_t *sess,
+ struct aim_conn_t *conn,
+ u_short family, u_short subtype,
+ u_short *shortdata)
{
struct command_tx_struct *newpacket;
u_short newshort;
* Request Location services rights.
*
*/
-u_long aim_bos_reqlocaterights(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_bos_reqlocaterights(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
return aim_genericreq_n(sess, conn, 0x0002, 0x0002);
}
* Request ICBM parameter information.
*
*/
-u_long aim_bos_reqicbmparaminfo(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_bos_reqicbmparaminfo(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
return aim_genericreq_n(sess, conn, 0x0004, 0x0004);
}
/*
* Add ICBM parameter? Huh?
*/
-unsigned long aim_addicbmparam(struct aim_session_t *sess,
- struct aim_conn_t *conn)
+faim_export unsigned long aim_addicbmparam(struct aim_session_t *sess,
+ struct aim_conn_t *conn)
{
struct command_tx_struct *newpacket;
int packlen = 10+16, i=0;
* take more for a badly fragmented packet.
*
*/
-static int aim_recv(int fd, void *buf, size_t count)
+faim_internal int aim_recv(int fd, void *buf, size_t count)
{
#ifdef MSG_WAITALL
return recv(fd, buf, count, MSG_WAITALL);
left = count;
while (left) {
- ret = read(fd, ((unsigned char *)buf)+cur, left);
+ ret = recv(fd, ((unsigned char *)buf)+cur, left, 0);
if (ret == -1)
return -1;
if (ret == 0)
return curbyte;
}
-faim_internal int aim_puttlv_str(u_char *buf, u_short t, u_short l, char *v)
+faim_internal int aim_puttlv_str(u_char *buf, u_short t, int l, char *v)
{
int curbyte;
#include <faim/aim.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#endif
+
/*
* Allocate a new tx frame.
*
* chan = channel for OSCAR, hdrtype for OFT
*
*/
-faim_internal struct command_tx_struct *aim_tx_new(unsigned short framing, int chan, struct aim_conn_t *conn, int datalen)
+faim_internal struct command_tx_struct *aim_tx_new(unsigned char framing, int chan, struct aim_conn_t *conn, int datalen)
{
struct command_tx_struct *new;
* since OFT allows us to do the data in a different write (yay!).
*/
faim_mutex_lock(&cur->conn->active);
- if ( (u_int)write(cur->conn->fd, curPacket, buflen) != buflen) {
+ if (send(cur->conn->fd, curPacket, buflen, 0) != buflen) {
faim_mutex_unlock(&cur->conn->active);
cur->sent = 1;
aim_conn_kill(sess, &cur->conn);
}
if ((cur->hdrtype == AIM_FRAMETYPE_OFT) && cur->commandlen) {
- if (write(cur->conn->fd, cur->data, cur->commandlen) != cur->commandlen) {
+ if (send(cur->conn->fd, cur->data, cur->commandlen, 0) != (int)cur->commandlen) {
/*
* Theres nothing we can do about this since we've already sent the
* header! The connection is unstable.
#ifdef _WIN32
#define sleep Sleep
-#define strlen(x) (int)strlen(x) /* win32 has a unsigned size_t */
+#define socklen_t int /* this must be a POSIXy thing */
+#define snprintf _snprintf /* I'm not sure whats wrong with Microsoft here */
#endif
#if defined(mach) && defined(__APPLE__)
#define faim_shortfunc inline
#endif
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(WIN32_STATIC)
/*
* For a win32 DLL, we define WIN32_INDLL if this file
* is included while compiling the DLL. If its not
faim_internal int aim_freetlv(struct aim_tlv_t **oldtlv);
faim_internal int aim_puttlv_16(u_char *, u_short, u_short);
faim_internal int aim_puttlv_32(u_char *, u_short, u_long);
-faim_internal int aim_puttlv_str(u_char *buf, u_short t, u_short l, char *v);
+faim_internal int aim_puttlv_str(u_char *buf, u_short t, int l, char *v);
faim_internal int aim_writetlvchain(u_char *buf, int buflen, struct aim_tlvlist_t **list);
faim_internal int aim_addtlvtochain16(struct aim_tlvlist_t **list, unsigned short type, unsigned short val);
faim_internal int aim_addtlvtochain32(struct aim_tlvlist_t **list, unsigned short type, unsigned long val);
faim_export int aim_get_command(struct aim_session_t *, struct aim_conn_t *);
int aim_rxdispatch(struct aim_session_t *);
-u_long aim_debugconn_sendconnect(struct aim_session_t *sess, struct aim_conn_t *conn);
+faim_export unsigned long aim_debugconn_sendconnect(struct aim_session_t *sess, struct aim_conn_t *conn);
int aim_logoff(struct aim_session_t *);
typedef int (*rxcallback_t)(struct aim_session_t *, struct command_rx_struct *, ...);
int aim_register_callbacks(rxcallback_t *);
-u_long aim_genericreq_n(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype);
-u_long aim_genericreq_l(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_long *);
-u_long aim_genericreq_s(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_short *);
+faim_internal unsigned long aim_genericreq_n(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype);
+faim_internal unsigned long aim_genericreq_l(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_long *);
+faim_internal unsigned long aim_genericreq_s(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_short *);
faim_internal struct aim_fileheader_t *aim_oft_getfh(unsigned char *hdr);
faim_export unsigned long aim_sendredirect(struct aim_session_t *sess, struct aim_conn_t *conn, unsigned short servid, char *ip, char *cookie);
faim_export void aim_purge_rxqueue(struct aim_session_t *);
faim_internal void aim_rxqueue_cleanbyconn(struct aim_session_t *sess, struct aim_conn_t *conn);
+faim_internal int aim_recv(int fd, void *buf, size_t count);
int aim_parse_unknown(struct aim_session_t *, struct command_rx_struct *command, ...);
int aim_parse_missed_im(struct aim_session_t *, struct command_rx_struct *, ...);
int aim_parse_last_bad(struct aim_session_t *, struct command_rx_struct *, ...);
faim_internal int aim_get_command_rendezvous(struct aim_session_t *sess, struct aim_conn_t *conn);
-faim_internal struct command_tx_struct *aim_tx_new(unsigned short framing, int chan, struct aim_conn_t *conn, int datalen);
+faim_internal struct command_tx_struct *aim_tx_new(unsigned char framing, int chan, struct aim_conn_t *conn, int datalen);
faim_internal int aim_tx_enqueue__queuebased(struct aim_session_t *, struct command_tx_struct *);
faim_internal int aim_tx_enqueue__immediate(struct aim_session_t *, struct command_tx_struct *);
#define aim_tx_enqueue(x, y) ((*(x->tx_enqueue))(x, y))
#define AIM_WARN_ANON 0x01
-int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn, int anon);
-u_long aim_bos_nop(struct aim_session_t *, struct aim_conn_t *);
-u_long aim_bos_setidle(struct aim_session_t *, struct aim_conn_t *, u_long);
-u_long aim_bos_changevisibility(struct aim_session_t *, struct aim_conn_t *, int, char *);
-u_long aim_bos_setbuddylist(struct aim_session_t *, struct aim_conn_t *, char *);
-u_long aim_bos_setprofile(struct aim_session_t *, struct aim_conn_t *, char *, char *, unsigned int);
-u_long aim_bos_setgroupperm(struct aim_session_t *, struct aim_conn_t *, u_long);
-unsigned long aim_bos_clientready(struct aim_session_t *, struct aim_conn_t *);
-u_long aim_bos_reqrate(struct aim_session_t *, struct aim_conn_t *);
-u_long aim_bos_ackrateresp(struct aim_session_t *, struct aim_conn_t *);
-u_long aim_bos_setprivacyflags(struct aim_session_t *, struct aim_conn_t *, u_long);
-u_long aim_bos_reqpersonalinfo(struct aim_session_t *, struct aim_conn_t *);
-u_long aim_bos_reqservice(struct aim_session_t *, struct aim_conn_t *, u_short);
-unsigned long aim_bos_reqrights(struct aim_session_t *, struct aim_conn_t *);
-u_long aim_bos_reqbuddyrights(struct aim_session_t *, struct aim_conn_t *);
-u_long aim_bos_reqlocaterights(struct aim_session_t *, struct aim_conn_t *);
-u_long aim_bos_reqicbmparaminfo(struct aim_session_t *, struct aim_conn_t *);
-unsigned long aim_addicbmparam(struct aim_session_t *sess,struct aim_conn_t *conn);
-u_long aim_setversions(struct aim_session_t *sess, struct aim_conn_t *conn);
+faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn, int anon);
+faim_export unsigned long aim_bos_nop(struct aim_session_t *, struct aim_conn_t *);
+faim_export unsigned long aim_bos_setidle(struct aim_session_t *, struct aim_conn_t *, u_long);
+faim_export unsigned long aim_bos_changevisibility(struct aim_session_t *, struct aim_conn_t *, int, char *);
+faim_export unsigned long aim_bos_setbuddylist(struct aim_session_t *, struct aim_conn_t *, char *);
+faim_export unsigned long aim_bos_setprofile(struct aim_session_t *, struct aim_conn_t *, char *, char *, unsigned short);
+faim_export unsigned long aim_bos_setgroupperm(struct aim_session_t *, struct aim_conn_t *, u_long);
+faim_export unsigned long aim_bos_clientready(struct aim_session_t *, struct aim_conn_t *);
+faim_export unsigned long aim_bos_reqrate(struct aim_session_t *, struct aim_conn_t *);
+faim_export unsigned long aim_bos_ackrateresp(struct aim_session_t *, struct aim_conn_t *);
+faim_export unsigned long aim_bos_setprivacyflags(struct aim_session_t *, struct aim_conn_t *, u_long);
+faim_export unsigned long aim_bos_reqpersonalinfo(struct aim_session_t *, struct aim_conn_t *);
+faim_export unsigned long aim_bos_reqservice(struct aim_session_t *, struct aim_conn_t *, u_short);
+faim_export unsigned long aim_bos_reqrights(struct aim_session_t *, struct aim_conn_t *);
+faim_export unsigned long aim_bos_reqbuddyrights(struct aim_session_t *, struct aim_conn_t *);
+faim_export unsigned long aim_bos_reqlocaterights(struct aim_session_t *, struct aim_conn_t *);
+faim_export unsigned long aim_bos_reqicbmparaminfo(struct aim_session_t *, struct aim_conn_t *);
+faim_export unsigned long aim_addicbmparam(struct aim_session_t *sess,struct aim_conn_t *conn);
+faim_export unsigned long aim_setversions(struct aim_session_t *sess, struct aim_conn_t *conn);
faim_internal struct aim_fileheader_t *aim_getlisting(struct aim_session_t*);
faim_internal int aim_listenestablish(u_short);
faim_export unsigned long aim_seticbmparam(struct aim_session_t *, struct aim_conn_t *conn);
faim_internal int aim_parse_msgerror_middle(struct aim_session_t *, struct command_rx_struct *);
faim_internal int aim_negchan_middle(struct aim_session_t *sess, struct command_rx_struct *command);
-int aim_parse_bosrights(struct aim_session_t *sess, struct command_rx_struct *command, ...);
+faim_internal int aim_parse_bosrights(struct aim_session_t *sess, struct command_rx_struct *command, ...);
faim_internal int aim_parse_missedcall(struct aim_session_t *sess, struct command_rx_struct *command);
faim_export struct aim_conn_t * aim_directim_initiate(struct aim_session_t *, struct aim_conn_t *, struct aim_directim_priv *, char *);
*/
#define FAIM_SNAC_HASH_SIZE 16
+/*
+ * If building on Win32,define WIN32_STATIC if you don't want
+ * to compile libfaim as a DLL (and instead link it right into
+ * your app).
+ */
+#define WIN32_STATIC
+
#endif /* __FAIMCONFIG_H__ */
*/
#include "md5.h"
+#include <string.h>
#ifdef TEST
/*