1 |
adx |
30 |
/* |
2 |
|
|
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
3 |
|
|
* s_bsd.h: A header for the network subsystem. |
4 |
|
|
* |
5 |
|
|
* Copyright (C) 2002 by the past and present ircd coders, and others. |
6 |
|
|
* |
7 |
|
|
* This program is free software; you can redistribute it and/or modify |
8 |
|
|
* it under the terms of the GNU General Public License as published by |
9 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
10 |
|
|
* (at your option) any later version. |
11 |
|
|
* |
12 |
|
|
* This program is distributed in the hope that it will be useful, |
13 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
|
* GNU General Public License for more details. |
16 |
|
|
* |
17 |
|
|
* You should have received a copy of the GNU General Public License |
18 |
|
|
* along with this program; if not, write to the Free Software |
19 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
20 |
|
|
* USA |
21 |
|
|
* |
22 |
knight |
31 |
* $Id$ |
23 |
adx |
30 |
*/ |
24 |
|
|
|
25 |
|
|
#ifndef INCLUDED_s_bsd_h |
26 |
|
|
#define INCLUDED_s_bsd_h |
27 |
|
|
|
28 |
michael |
912 |
#include "config.h" |
29 |
adx |
30 |
#include "fdlist.h" |
30 |
|
|
|
31 |
|
|
/* Type of IO */ |
32 |
|
|
#define COMM_SELECT_READ 1 |
33 |
|
|
#define COMM_SELECT_WRITE 2 |
34 |
|
|
|
35 |
|
|
/* How long can comm_select() wait for network events [milliseconds] */ |
36 |
|
|
#define SELECT_DELAY 500 |
37 |
|
|
|
38 |
|
|
struct Client; |
39 |
michael |
1632 |
struct MaskItem; |
40 |
adx |
30 |
struct Listener; |
41 |
|
|
|
42 |
|
|
extern struct Callback *setup_socket_cb; |
43 |
|
|
|
44 |
michael |
549 |
extern void add_connection(struct Listener *, struct irc_ssaddr *, int); |
45 |
adx |
30 |
extern void close_connection(struct Client *); |
46 |
|
|
extern void report_error(int, const char *, const char *, int); |
47 |
|
|
|
48 |
|
|
extern int get_sockerr(int); |
49 |
|
|
extern int ignoreErrno(int); |
50 |
|
|
|
51 |
|
|
extern void comm_settimeout(fde_t *, time_t, PF *, void *); |
52 |
|
|
extern void comm_setflush(fde_t *, time_t, PF *, void *); |
53 |
|
|
extern void comm_checktimeouts(void *); |
54 |
|
|
extern void comm_connect_tcp(fde_t *, const char *, u_short, |
55 |
|
|
struct sockaddr *, int, CNCB *, void *, int, int); |
56 |
|
|
extern const char * comm_errstr(int status); |
57 |
|
|
extern int comm_open(fde_t *F, int family, int sock_type, int proto, |
58 |
|
|
const char *note); |
59 |
|
|
extern int comm_accept(struct Listener *, struct irc_ssaddr *pn); |
60 |
|
|
|
61 |
|
|
/* These must be defined in the network IO loop code of your choice */ |
62 |
michael |
950 |
extern void init_netio(void); |
63 |
adx |
30 |
extern void comm_setselect(fde_t *, unsigned int, PF *, void *, time_t); |
64 |
|
|
extern void init_comm(void); |
65 |
|
|
extern int read_message (time_t, unsigned char); |
66 |
|
|
extern void comm_select(void); |
67 |
|
|
extern void check_can_use_v6(void); |
68 |
|
|
#ifdef IPV6 |
69 |
|
|
extern void remove_ipv6_mapping(struct irc_ssaddr *); |
70 |
|
|
#endif |
71 |
|
|
|
72 |
|
|
#endif /* INCLUDED_s_bsd_h */ |