1 |
adx |
30 |
/* |
2 |
michael |
2865 |
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
3 |
adx |
30 |
* |
4 |
michael |
7006 |
* Copyright (c) 1997-2016 ircd-hybrid development team |
5 |
adx |
30 |
* |
6 |
|
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
|
* it under the terms of the GNU General Public License as published by |
8 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
9 |
|
|
* (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* This program is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with this program; if not, write to the Free Software |
18 |
michael |
4565 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
19 |
adx |
30 |
* USA |
20 |
|
|
*/ |
21 |
|
|
|
22 |
michael |
2865 |
/*! \file s_bsd.h |
23 |
|
|
* \brief A header for the network subsystem. |
24 |
|
|
* \version $Id$ |
25 |
|
|
*/ |
26 |
|
|
|
27 |
adx |
30 |
#ifndef INCLUDED_s_bsd_h |
28 |
|
|
#define INCLUDED_s_bsd_h |
29 |
|
|
|
30 |
|
|
#include "fdlist.h" |
31 |
|
|
|
32 |
|
|
/* Type of IO */ |
33 |
michael |
6323 |
enum |
34 |
|
|
{ |
35 |
|
|
COMM_SELECT_READ = 1, |
36 |
|
|
COMM_SELECT_WRITE = 2 |
37 |
|
|
}; |
38 |
adx |
30 |
|
39 |
|
|
/* How long can comm_select() wait for network events [milliseconds] */ |
40 |
michael |
6323 |
enum { SELECT_DELAY = 500 }; |
41 |
adx |
30 |
|
42 |
|
|
struct Client; |
43 |
|
|
struct Listener; |
44 |
|
|
|
45 |
michael |
549 |
extern void add_connection(struct Listener *, struct irc_ssaddr *, int); |
46 |
adx |
30 |
extern void close_connection(struct Client *); |
47 |
|
|
extern void report_error(int, const char *, const char *, int); |
48 |
|
|
|
49 |
|
|
extern int get_sockerr(int); |
50 |
|
|
extern int ignoreErrno(int); |
51 |
|
|
|
52 |
michael |
4461 |
extern void comm_settimeout(fde_t *, time_t, void (*)(fde_t *, void *), void *); |
53 |
|
|
extern void comm_setflush(fde_t *, time_t, void (*)(fde_t *, void *), void *); |
54 |
adx |
30 |
extern void comm_checktimeouts(void *); |
55 |
michael |
4464 |
extern void comm_connect_tcp(fde_t *, const char *, unsigned short, struct sockaddr *, int, |
56 |
michael |
6951 |
void (struct _fde *, int, void *), void *, int, time_t); |
57 |
michael |
6323 |
extern const char *comm_errstr(int); |
58 |
|
|
extern int comm_open(fde_t *, int, int, int, const char *); |
59 |
|
|
extern int comm_accept(struct Listener *, struct irc_ssaddr *); |
60 |
adx |
30 |
|
61 |
|
|
/* These must be defined in the network IO loop code of your choice */ |
62 |
michael |
950 |
extern void init_netio(void); |
63 |
michael |
4461 |
extern void comm_setselect(fde_t *, unsigned int, void (*)(fde_t *, void *), void *, time_t); |
64 |
adx |
30 |
extern void comm_select(void); |
65 |
|
|
extern void remove_ipv6_mapping(struct irc_ssaddr *); |
66 |
|
|
#endif /* INCLUDED_s_bsd_h */ |