1 |
/* |
2 |
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
3 |
* |
4 |
* Copyright (c) 1997-2015 ircd-hybrid development team |
5 |
* |
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 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
19 |
* USA |
20 |
*/ |
21 |
|
22 |
/*! \file listener.h |
23 |
* \brief A header for the listener code. |
24 |
* \version $Id$ |
25 |
*/ |
26 |
|
27 |
#ifndef INCLUDED_listener_h |
28 |
#define INCLUDED_listener_h |
29 |
|
30 |
#include "ircd_defs.h" |
31 |
#include "fdlist.h" |
32 |
|
33 |
enum |
34 |
{ |
35 |
LISTENER_SSL = 1 << 0, |
36 |
LISTENER_HIDDEN = 1 << 1, |
37 |
LISTENER_SERVER = 1 << 2 |
38 |
}; |
39 |
|
40 |
struct Listener |
41 |
{ |
42 |
dlink_node node; /**< Doubly linked list node */ |
43 |
fde_t fd; /**< Describe socket to event system */ |
44 |
int port; /**< Listener IP port */ |
45 |
int ref_count; /**< Number of connection references */ |
46 |
int active; /**< Current state of listener */ |
47 |
struct irc_ssaddr addr; /**< Holds an IPv6 or IPv4 address */ |
48 |
char name[HOSTIPLEN + 1]; /**< Holds an IPv6 or IPv4 address in string representation*/ |
49 |
unsigned int flags; /**< Listener flags (ssl, hidden, server) */ |
50 |
}; |
51 |
|
52 |
extern const dlink_list *listener_get_list(void); |
53 |
extern void listener_add(int, const char *, unsigned int); |
54 |
extern void listener_release(struct Listener *); |
55 |
extern void listener_close_marked(void); |
56 |
extern const char *listener_get_name(const struct Listener *const); |
57 |
#endif |