| 1 |
/* |
| 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 |
* $Id$ |
| 23 |
*/ |
| 24 |
|
| 25 |
#ifndef INCLUDED_s_bsd_h |
| 26 |
#define INCLUDED_s_bsd_h |
| 27 |
|
| 28 |
#include "config.h" |
| 29 |
#include "fdlist.h" |
| 30 |
#include "hook.h" |
| 31 |
|
| 32 |
/* Type of IO */ |
| 33 |
#define COMM_SELECT_READ 1 |
| 34 |
#define COMM_SELECT_WRITE 2 |
| 35 |
|
| 36 |
/* How long can comm_select() wait for network events [milliseconds] */ |
| 37 |
#define SELECT_DELAY 500 |
| 38 |
|
| 39 |
struct Client; |
| 40 |
struct AccessItem; |
| 41 |
struct DNSReply; |
| 42 |
struct Listener; |
| 43 |
|
| 44 |
extern struct Callback *setup_socket_cb; |
| 45 |
|
| 46 |
extern void add_connection(struct Listener *, struct irc_ssaddr *, int); |
| 47 |
extern void close_connection(struct Client *); |
| 48 |
extern int connect_server(struct AccessItem *, struct Client *, |
| 49 |
struct DNSReply *); |
| 50 |
extern void report_error(int, const char *, const char *, int); |
| 51 |
|
| 52 |
extern int get_sockerr(int); |
| 53 |
extern int ignoreErrno(int); |
| 54 |
|
| 55 |
extern void comm_settimeout(fde_t *, time_t, PF *, void *); |
| 56 |
extern void comm_setflush(fde_t *, time_t, PF *, void *); |
| 57 |
extern void comm_checktimeouts(void *); |
| 58 |
extern void comm_connect_tcp(fde_t *, const char *, u_short, |
| 59 |
struct sockaddr *, int, CNCB *, void *, int, int); |
| 60 |
extern const char * comm_errstr(int status); |
| 61 |
extern int comm_open(fde_t *F, int family, int sock_type, int proto, |
| 62 |
const char *note); |
| 63 |
extern int comm_accept(struct Listener *, struct irc_ssaddr *pn); |
| 64 |
|
| 65 |
/* These must be defined in the network IO loop code of your choice */ |
| 66 |
extern void comm_setselect(fde_t *, unsigned int, PF *, void *, time_t); |
| 67 |
extern void init_comm(void); |
| 68 |
extern int read_message (time_t, unsigned char); |
| 69 |
extern void comm_select(void); |
| 70 |
extern void check_can_use_v6(void); |
| 71 |
#ifdef IPV6 |
| 72 |
extern void remove_ipv6_mapping(struct irc_ssaddr *); |
| 73 |
#endif |
| 74 |
|
| 75 |
#endif /* INCLUDED_s_bsd_h */ |