]>
Commit | Line | Data |
---|---|---|
7daf4a38 | 1 | /* |
2 | * aim_internal.h -- prototypes/structs for the guts of libfaim | |
3 | * | |
4 | */ | |
5 | ||
6 | #ifdef FAIM_INTERNAL | |
7 | #ifndef __AIM_INTERNAL_H__ | |
8 | #define __AIM_INTERNAL_H__ 1 | |
9 | ||
9f1a4013 | 10 | typedef struct { |
11 | unsigned short family; | |
12 | unsigned short subtype; | |
13 | unsigned short flags; | |
14 | unsigned long id; | |
15 | } aim_modsnac_t; | |
16 | ||
17 | #define AIM_MODULENAME_MAXLEN 16 | |
18 | #define AIM_MODFLAG_MULTIFAMILY 0x0001 | |
19 | typedef struct aim_module_s { | |
20 | unsigned short family; | |
21 | unsigned short flags; | |
22 | unsigned short version; | |
23 | char name[AIM_MODULENAME_MAXLEN+1]; | |
24 | int (*snachandler)(struct aim_session_t *sess, struct aim_module_s *mod, struct command_rx_struct *rx, aim_modsnac_t *snac, unsigned char *data, int datalen); | |
25 | void (*shutdown)(struct aim_session_t *sess, struct aim_module_s *mod); | |
26 | void *priv; | |
27 | struct aim_module_s *next; | |
28 | } aim_module_t; | |
29 | ||
30 | faim_internal int aim__registermodule(struct aim_session_t *sess, int (*modfirst)(struct aim_session_t *, aim_module_t *)); | |
31 | faim_internal void aim__shutdownmodules(struct aim_session_t *sess); | |
32 | ||
33 | ||
34 | faim_internal int buddylist_modfirst(struct aim_session_t *sess, aim_module_t *mod); | |
35 | faim_internal int admin_modfirst(struct aim_session_t *sess, aim_module_t *mod); | |
36 | faim_internal int bos_modfirst(struct aim_session_t *sess, aim_module_t *mod); | |
37 | faim_internal int search_modfirst(struct aim_session_t *sess, aim_module_t *mod); | |
38 | faim_internal int stats_modfirst(struct aim_session_t *sess, aim_module_t *mod); | |
39 | faim_internal int auth_modfirst(struct aim_session_t *sess, aim_module_t *mod); | |
40 | ||
41 | ||
7daf4a38 | 42 | faim_internal unsigned long aim_genericreq_n(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype); |
43 | faim_internal unsigned long aim_genericreq_l(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_long *); | |
44 | faim_internal unsigned long aim_genericreq_s(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_short *); | |
45 | ||
7daf4a38 | 46 | faim_internal void aim_rxqueue_cleanbyconn(struct aim_session_t *sess, struct aim_conn_t *conn); |
47 | faim_internal int aim_recv(int fd, void *buf, size_t count); | |
48 | ||
49 | faim_internal int aim_parse_unknown(struct aim_session_t *, struct command_rx_struct *command, ...); | |
50 | faim_internal int aim_get_command_rendezvous(struct aim_session_t *sess, struct aim_conn_t *conn); | |
51 | ||
52 | faim_internal int aim_tx_sendframe(struct aim_session_t *sess, struct command_tx_struct *cur); | |
53 | faim_internal unsigned int aim_get_next_txseqnum(struct aim_conn_t *); | |
54 | faim_internal struct command_tx_struct *aim_tx_new(struct aim_session_t *sess, struct aim_conn_t *conn, unsigned char framing, int chan, int datalen); | |
55 | faim_internal int aim_tx_enqueue(struct aim_session_t *, struct command_tx_struct *); | |
56 | faim_internal int aim_tx_printqueue(struct aim_session_t *); | |
57 | faim_internal int aim_parse_hostonline(struct aim_session_t *sess, struct command_rx_struct *command, ...); | |
58 | faim_internal int aim_parse_hostversions(struct aim_session_t *sess, struct command_rx_struct *command, ...); | |
7daf4a38 | 59 | faim_internal int aim_tx_cleanqueue(struct aim_session_t *, struct aim_conn_t *); |
60 | ||
61 | faim_internal rxcallback_t aim_callhandler(struct aim_session_t *sess, struct aim_conn_t *conn, u_short family, u_short type); | |
62 | ||
63 | /* | |
64 | * Generic SNAC structure. Rarely if ever used. | |
65 | */ | |
66 | struct aim_snac_t { | |
67 | u_long id; | |
68 | u_short family; | |
69 | u_short type; | |
70 | u_short flags; | |
71 | void *data; | |
72 | time_t issuetime; | |
73 | struct aim_snac_t *next; | |
74 | }; | |
75 | faim_internal void aim_initsnachash(struct aim_session_t *sess); | |
76 | faim_internal unsigned long aim_newsnac(struct aim_session_t *, struct aim_snac_t *newsnac); | |
77 | faim_internal unsigned long aim_cachesnac(struct aim_session_t *sess, const unsigned short family, const unsigned short type, const unsigned short flags, const void *data, const int datalen); | |
78 | faim_internal struct aim_snac_t *aim_remsnac(struct aim_session_t *, u_long id); | |
79 | faim_internal int aim_cleansnacs(struct aim_session_t *, int maxage); | |
80 | faim_internal int aim_putsnac(u_char *, int, int, int, u_long); | |
81 | ||
82 | faim_internal void aim_connrst(struct aim_session_t *); | |
83 | faim_internal struct aim_conn_t *aim_conn_getnext(struct aim_session_t *); | |
84 | faim_internal struct aim_conn_t *aim_cloneconn(struct aim_session_t *sess, struct aim_conn_t *src); | |
85 | ||
86 | faim_internal int aim_oft_buildheader(unsigned char *,struct aim_fileheader_t *); | |
87 | faim_internal int aim_listenestablish(u_short); | |
88 | faim_internal int aim_tx_destroy(struct command_tx_struct *); | |
89 | ||
7daf4a38 | 90 | faim_internal int aim_handleredirect_middle(struct aim_session_t *, struct command_rx_struct *, ...); |
91 | faim_internal int aim_parse_unknown(struct aim_session_t *, struct command_rx_struct *, ...); | |
92 | faim_internal int aim_parse_generalerrs(struct aim_session_t *, struct command_rx_struct *command, ...); | |
93 | faim_internal int aim_parsemotd_middle(struct aim_session_t *sess, struct command_rx_struct *command, ...); | |
94 | ||
95 | /* these are used by aim_*_clientready */ | |
96 | #define AIM_TOOL_JAVA 0x0001 | |
97 | #define AIM_TOOL_MAC 0x0002 | |
98 | #define AIM_TOOL_WIN16 0x0003 | |
99 | #define AIM_TOOL_WIN32 0x0004 | |
100 | #define AIM_TOOL_MAC68K 0x0005 | |
101 | #define AIM_TOOL_MACPPC 0x0006 | |
102 | #define AIM_TOOL_NEWWIN 0x0010 | |
103 | struct aim_tool_version { | |
104 | unsigned short group; | |
105 | unsigned short version; | |
106 | unsigned short tool; | |
107 | unsigned short toolversion; | |
108 | }; | |
109 | ||
110 | faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct command_rx_struct *command); | |
111 | ||
112 | faim_internal int aim_parse_evilnotify_middle(struct aim_session_t *sess, struct command_rx_struct *command); | |
113 | faim_internal int aim_parse_msgack_middle(struct aim_session_t *sess, struct command_rx_struct *command); | |
114 | ||
115 | faim_internal int aim_parse_incoming_im_middle(struct aim_session_t *, struct command_rx_struct *); | |
116 | faim_internal int aim_parse_outgoing_im_middle(struct aim_session_t *, struct command_rx_struct *); | |
117 | faim_internal int aim_parse_msgerror_middle(struct aim_session_t *, struct command_rx_struct *); | |
118 | faim_internal int aim_negchan_middle(struct aim_session_t *sess, struct command_rx_struct *command); | |
7daf4a38 | 119 | faim_internal int aim_parse_missedcall(struct aim_session_t *sess, struct command_rx_struct *command); |
120 | ||
121 | extern u_char aim_caps[8][16]; | |
122 | faim_internal unsigned short aim_getcap(struct aim_session_t *sess, unsigned char *capblock, int buflen); | |
123 | faim_internal int aim_putcap(unsigned char *capblock, int buflen, u_short caps); | |
124 | ||
125 | faim_internal int aim_cachecookie(struct aim_session_t *sess, struct aim_msgcookie_t *cookie); | |
126 | faim_internal struct aim_msgcookie_t *aim_uncachecookie(struct aim_session_t *sess, unsigned char *cookie, int type); | |
127 | faim_internal struct aim_msgcookie_t *aim_mkcookie(unsigned char *, int, void *); | |
128 | faim_internal struct aim_msgcookie_t *aim_checkcookie(struct aim_session_t *, const unsigned char *, const int); | |
129 | faim_internal int aim_freecookie(struct aim_session_t *sess, struct aim_msgcookie_t *cookie); | |
130 | faim_internal int aim_msgcookie_gettype(int reqclass); | |
131 | faim_internal int aim_cookie_free(struct aim_session_t *sess, struct aim_msgcookie_t *cookie); | |
132 | ||
133 | faim_internal int aim_extractuserinfo(struct aim_session_t *sess, unsigned char *, struct aim_userinfo_s *); | |
134 | faim_internal int aim_parse_userinfo_middle(struct aim_session_t *, struct command_rx_struct *); | |
7daf4a38 | 135 | faim_internal int aim_putuserinfo(u_char *buf, int buflen, struct aim_userinfo_s *info); |
136 | faim_internal int aim_parse_locateerr(struct aim_session_t *sess, struct command_rx_struct *command); | |
7daf4a38 | 137 | |
138 | faim_internal int aim_chat_readroominfo(u_char *buf, struct aim_chat_roominfo *outinfo); | |
139 | faim_internal int aim_chat_parse_infoupdate(struct aim_session_t *sess, struct command_rx_struct *command); | |
140 | faim_internal int aim_chat_parse_joined(struct aim_session_t *sess, struct command_rx_struct *command); | |
141 | faim_internal int aim_chat_parse_leave(struct aim_session_t *sess, struct command_rx_struct *command); | |
142 | faim_internal int aim_chat_parse_incoming(struct aim_session_t *sess, struct command_rx_struct *command); | |
143 | faim_internal int aim_chatnav_parse_info(struct aim_session_t *sess, struct command_rx_struct *command); | |
144 | ||
145 | faim_internal void faimdprintf(struct aim_session_t *sess, int dlevel, const char *format, ...); | |
146 | ||
147 | /* why the hell wont cpp let you use #error inside #define's? */ | |
148 | /* isn't it single-pass? so the #error would get passed to the compiler --jbm */ | |
149 | #define printf() printf called inside libfaim | |
150 | #define sprintf() unbounded sprintf used inside libfaim | |
151 | ||
152 | #endif /* __AIM_INTERNAL_H__ */ | |
153 | #endif /* FAIM_INTERNAL */ |