/[cvs]/eggdrop1.8/src/proto.h
ViewVC logotype

Contents of /eggdrop1.8/src/proto.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download) (as text)
Tue Oct 19 12:13:33 2010 UTC (9 years ago) by pseudo
Branch: MAIN
Changes since 1.3: +13 -1 lines
File MIME type: text/x-csrc
Added full SSL support including Tcl commands.
Added support for certificate authentication.
Added support for botnet and partyline encryption using ssl.
Documented the new features and commands.
Fixed add_server() problems with IPv6 addresses in the server list.

1 /*
2 * proto.h
3 * prototypes for every function used outside its own module
4 *
5 * (i guess i'm not very modular, cuz there are a LOT of these.)
6 * with full prototyping, some have been moved to other .h files
7 * because they use structures in those
8 * (saves including those .h files EVERY time) - Beldin
9 *
10 * $Id: proto.h,v 1.3 2010/10/10 18:22:47 pseudo Exp $
11 */
12 /*
13 * Copyright (C) 1997 Robey Pointer
14 * Copyright (C) 1999 - 2010 Eggheads Development Team
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31 #ifndef _EGG_PROTO_H
32 #define _EGG_PROTO_H
33
34 #include "lush.h"
35 #include "misc_file.h"
36
37 #define dprintf dprintf_eggdrop
38
39 struct chanset_t; /* keeps the compiler warnings down :) */
40 struct userrec;
41 struct maskrec;
42 struct igrec;
43 struct flag_record;
44 struct list_type;
45 struct tand_t_struct;
46
47 #ifndef MAKING_MODS
48 extern void (*encrypt_pass) (char *, char *);
49 extern char *(*encrypt_string) (char *, char *);
50 extern char *(*decrypt_string) (char *, char *);
51 extern int (*rfc_casecmp) (const char *, const char *);
52 extern int (*rfc_ncasecmp) (const char *, const char *, int);
53 extern int (*rfc_toupper) (int);
54 extern int (*rfc_tolower) (int);
55 extern int (*match_noterej) (struct userrec *, char *);
56 #endif
57
58 /* botcmd.c */
59 void bot_share(int, char *);
60 int base64_to_int(char *);
61
62 /* botnet.c */
63 void answer_local_whom(int, int);
64 char *lastbot(char *);
65 int nextbot(char *);
66 int in_chain(char *);
67 void tell_bots(int);
68 void tell_bottree(int, int);
69 int botlink(char *, int, char *);
70 int botunlink(int, char *, char *, char *);
71 void dump_links(int);
72 void addbot(char *, char *, char *, char, int);
73 void updatebot(int, char *, char, int);
74 void rembot(char *);
75 struct tand_t_struct *findbot(char *);
76 void unvia(int, struct tand_t_struct *);
77 void check_botnet_pings();
78 int partysock(char *, char *);
79 int addparty(char *, char *, int, char, int, char *, int *);
80 void remparty(char *, int);
81 void partystat(char *, int, int, int);
82 int partynick(char *, int, char *);
83 int partyidle(char *, char *);
84 void partysetidle(char *, int, int);
85 void partyaway(char *, int, char *);
86 void zapfbot(int);
87 void tandem_relay(int, char *, int);
88 int getparty(char *, int);
89
90 /* botmsg.c */
91 int add_note(char *, char *, char *, int, int);
92 int simple_sprintf EGG_VARARGS(char *, arg1);
93 void tandout_but EGG_VARARGS(int, arg1);
94 char *int_to_base10(int);
95 char *unsigned_int_to_base10(unsigned int);
96 char *int_to_base64(unsigned int);
97
98 /* chanprog.c */
99 void tell_verbose_uptime(int);
100 void tell_verbose_status(int);
101 void tell_settings(int);
102 int logmodes(char *);
103 int isowner(char *);
104 char *masktype(int);
105 char *maskname(int);
106 void reaffirm_owners();
107 void rehash();
108 void reload();
109 void chanprog();
110 void check_timers();
111 void check_utimers();
112 void rmspace(char *s);
113 void check_timers();
114 void set_chanlist(const char *host, struct userrec *rec);
115 void clear_chanlist(void);
116 void clear_chanlist_member(const char *nick);
117 float getcputime();
118
119 /* cmds.c */
120 int check_dcc_attrs(struct userrec *, int);
121 int check_dcc_chanattrs(struct userrec *, char *, int, int);
122 int stripmodes(char *);
123 char *stripmasktype(int);
124
125 /* dcc.c */
126 void failed_link(int);
127 void strip_mirc_codes(int, char *);
128 int check_ansi(char *);
129 void dupwait_notify(char *);
130 #ifdef TLS
131 int dcc_fingerprint(int);
132 #endif
133
134 /* dccutil.c */
135 int increase_socks_max();
136 int findidx(int);
137 int findanyidx(int);
138 char *add_cr(char *);
139 void dprintf EGG_VARARGS(int, arg1);
140 void chatout EGG_VARARGS(char *, arg1);
141 extern void (*shareout) ();
142 extern void (*sharein) (int, char *);
143 void chanout_but EGG_VARARGS(int, arg1);
144 void dcc_chatter(int);
145 void lostdcc(int);
146 void killtransfer(int);
147 void removedcc(int);
148 void makepass(char *);
149 void tell_dcc(int);
150 void not_away(int);
151 void set_away(int, char *);
152 void *_get_data_ptr(int, char *, int);
153 void dcc_remove_lost(void);
154 void do_boot(int, char *, char *);
155 int detect_dcc_flood(time_t *, struct chat_info *, int);
156
157 #define get_data_ptr(x) _get_data_ptr(x,__FILE__,__LINE__)
158 void flush_lines(int, struct chat_info *);
159 struct dcc_t *find_idx(int);
160 int new_dcc(struct dcc_table *, int);
161 void del_dcc(int);
162 void changeover_dcc(int, struct dcc_table *, int);
163
164 /* dns.c */
165 extern void (*dns_hostbyip) (sockname_t *);
166 void block_dns_hostbyip(sockname_t *);
167 void call_hostbyip(sockname_t *, char *, int);
168 void call_ipbyhost(char *, sockname_t *, int);
169 void dcc_dnshostbyip(sockname_t *);
170 extern void (*dns_ipbyhost) (char *);
171 void block_dns_ipbyhost(char *);
172 void dcc_dnsipbyhost(char *);
173
174 /* language.c */
175 char *get_language(int);
176 int cmd_loadlanguage(struct userrec *, int, char *);
177 void add_lang_section(char *);
178 int del_lang_section(char *);
179 int exist_lang_section(char *);
180
181 /* main.c */
182 void fatal(const char *, int);
183 int expected_memory(void);
184 void eggContext(const char *, int, const char *);
185 void eggContextNote(const char *, int, const char *, const char *);
186 void eggAssert(const char *, int, const char *);
187 void backup_userfile(void);
188 int mainloop(int);
189
190 /* match.c */
191 int casecharcmp(unsigned char, unsigned char);
192 int charcmp(unsigned char, unsigned char);
193 int _wild_match(register unsigned char *, register unsigned char *);
194 int _wild_match_per(register unsigned char *, register unsigned char *,
195 int (*)(unsigned char, unsigned char),
196 int (*)(unsigned char, unsigned char),
197 unsigned char *);
198 int addr_match(char *, char *, int, int);
199 int mask_match(char *, char *);
200 int cidr_match(char *, char *, int);
201 int cron_match(const char *, const char *);
202
203 #define wild_match(a,b) _wild_match((unsigned char *)(a),(unsigned char *)(b))
204 #define wild_match_per(a,b) _wild_match_per((unsigned char *)(a), \
205 (unsigned char *)(b),casecharcmp,NULL,NULL)
206 #define wild_match_partial_case(a,b) _wild_match_per((unsigned char *)(a), \
207 (unsigned char *)(b),casecharcmp,charcmp, \
208 (unsigned char *)strchr((b),' '))
209 #define match_addr(a,b) addr_match((char *)(a),(char *)(b),0,0)
210 #define match_useraddr(a,b) addr_match((char *)(a),(char *)(b),1,0)
211 #define cmp_masks(a,b) addr_match((char *)(a),(char *)(b),0,1)
212 #define cmp_usermasks(a,b) addr_match((char *)(a),(char *)(b),1,1)
213
214 /* mem.c */
215 void *n_malloc(int, const char *, int);
216 void *n_realloc(void *, int, const char *, int);
217 void n_free(void *, const char *, int);
218 void tell_mem_status(char *);
219 void tell_mem_status_dcc(int);
220 void debug_mem_to_dcc(int);
221
222 /* misc.c */
223 int egg_strcatn(char *, const char *, size_t);
224 int my_strcpy(char *, char *);
225 void putlog EGG_VARARGS(int, arg1);
226 void flushlogs();
227 void check_logsize();
228 void splitc(char *, char *, char);
229 void splitcn(char *, char *, char, size_t);
230 void remove_crlf(char **);
231 char *newsplit(char **);
232 char *splitnick(char **);
233 void stridx(char *, char *, int);
234 void dumplots(int, const char *, const char *);
235 void daysago(time_t, time_t, char *);
236 void days(time_t, time_t, char *);
237 void daysdur(time_t, time_t, char *);
238 void help_subst(char *, char *, struct flag_record *, int, char *);
239 void sub_lang(int, char *);
240 void show_motd(int);
241 void tellhelp(int, char *, struct flag_record *, int);
242 void tellwildhelp(int, char *, struct flag_record *);
243 void tellallhelp(int, char *, struct flag_record *);
244 void showhelp(char *, char *, struct flag_record *, int);
245 void rem_help_reference(char *);
246 void add_help_reference(char *);
247 void debug_help(int);
248 void reload_help_data(void);
249 char *extracthostname(char *);
250 void show_banner(int i);
251 void make_rand_str(char *, int);
252 int oatoi(const char *);
253 int is_file(const char *);
254 void logsuffix_change(char *);
255 char *str_escape(const char *, const char, const char);
256 char *strchr_unescape(char *, const char, register const char);
257 void str_unescape(char *, register const char);
258 int str_isdigit(const char *);
259 void kill_bot(char *, char *);
260
261 void maskaddr(const char *, char *, int);
262 #define maskhost(a,b) maskaddr((a),(b),3)
263 #define maskban(a,b) maskaddr((a),(b),3)
264
265 /* net.c */
266 IP my_atoul(char *);
267 unsigned long iptolong(IP);
268 void setsock(int, int);
269 int allocsock(int, int);
270 int alloctclsock(int, int, Tcl_FileProc *, ClientData);
271 int getsock(int, int);
272 void killsock(int);
273 void killtclsock(int);
274 inline int open_listen(int *);
275 void getvhost(sockname_t *, int);
276 int setsockname(sockname_t *, char *, int, int);
277 int open_address_listen(sockname_t *);
278 int open_telnet_raw(int, sockname_t *);
279 int open_telnet(char *, int);
280 int answer(int, sockname_t *, unsigned short *, int);
281 int getdccaddr(sockname_t *, char *, size_t);
282 void tputs(int, char *, unsigned int);
283 void dequeue_sockets();
284 int preparefdset(fd_set *, sock_list *, int, int, int);
285 int sockread(char *, int *, sock_list *, int, int);
286 int sockgets(char *, int *);
287 void tell_netdebug(int);
288 int sanitycheck_dcc(char *, char *, char *, char *);
289 int hostsanitycheck_dcc(char *, char *, sockname_t *, char *, char *);
290 char *iptostr(struct sockaddr *);
291 int sock_has_data(int, int);
292 int sockoptions(int sock, int operation, int sock_options);
293 int flush_inbuf(int idx);
294 int findsock(int sock);
295
296 /* tcl.c */
297 struct threaddata *threaddata();
298 int init_threaddata(int);
299 void protect_tcl();
300 void unprotect_tcl();
301 void do_tcl(char *, char *);
302 int readtclprog(char *fname);
303
304 /* tls.c */
305 #ifdef TLS
306 int ssl_handshake(int, int, int, int, char *, IntFunc);
307 char *ssl_fpconv(char *in, char *out);
308 char *ssl_getuid(int sock);
309 char *ssl_getfp(int sock);
310 #endif
311
312 /* userent.c */
313 void list_type_kill(struct list_type *);
314 int list_type_expmem(struct list_type *);
315 int xtra_set();
316
317 /* userrec.c */
318 struct userrec *adduser(struct userrec *, char *, char *, char *, int);
319 void addhost_by_handle(char *, char *);
320 void clear_masks(struct maskrec *);
321 void clear_userlist(struct userrec *);
322 int u_pass_match(struct userrec *, char *);
323 int delhost_by_handle(char *, char *);
324 int ishost_for_handle(char *, char *);
325 int count_users(struct userrec *);
326 int deluser(char *);
327 void freeuser(struct userrec *);
328 int change_handle(struct userrec *, char *);
329 void correct_handle(char *);
330 int write_user(struct userrec *, FILE *, int);
331 int write_ignores(FILE *f, int);
332 void write_userfile(int);
333 struct userrec *check_dcclist_hand(char *);
334 void touch_laston(struct userrec *, char *, time_t);
335 void user_del_chan(char *);
336 char *fixfrom(char *);
337 int check_conflags(struct flag_record *fr, int md);
338
339 /* users.c */
340 void addignore(char *, char *, char *, time_t);
341 int delignore(char *);
342 void tell_ignores(int, char *);
343 int match_ignore(char *);
344 void check_expired_ignores();
345 void autolink_cycle(char *);
346 void tell_file_stats(int, char *);
347 void tell_user_ident(int, char *, int);
348 void tell_users_match(int, char *, int, int, int, char *);
349 int readuserfile(char *, struct userrec **);
350
351 /* rfc1459.c */
352 int _rfc_casecmp(const char *, const char *);
353 int _rfc_ncasecmp(const char *, const char *, int);
354 int _rfc_toupper(int);
355 int _rfc_tolower(int);
356
357 #endif /* _EGG_PROTO_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23