| 1 |
adx |
30 |
/* |
| 2 |
michael |
2865 |
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
| 3 |
adx |
30 |
* |
| 4 |
michael |
2865 |
* Copyright (c) 1997-2014 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 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 19 |
|
|
* USA |
| 20 |
|
|
*/ |
| 21 |
|
|
|
| 22 |
michael |
2865 |
/*! \file s_serv.h |
| 23 |
|
|
* \brief A header for the server functions. |
| 24 |
|
|
* \version $Id$ |
| 25 |
|
|
*/ |
| 26 |
|
|
|
| 27 |
adx |
30 |
#ifndef INCLUDED_serv_h |
| 28 |
|
|
#define INCLUDED_serv_h |
| 29 |
michael |
912 |
#include "config.h" |
| 30 |
adx |
30 |
|
| 31 |
michael |
1632 |
struct MaskItem; |
| 32 |
adx |
30 |
|
| 33 |
|
|
/* |
| 34 |
|
|
* number of seconds to wait after server starts up, before |
| 35 |
|
|
* starting try_connections() |
| 36 |
michael |
2865 |
* TOO SOON and you can nick collide like crazy. |
| 37 |
adx |
30 |
*/ |
| 38 |
|
|
#define STARTUP_CONNECTIONS_TIME 60 |
| 39 |
|
|
|
| 40 |
|
|
struct Client; |
| 41 |
michael |
1632 |
struct MaskItem; |
| 42 |
adx |
30 |
struct Channel; |
| 43 |
|
|
|
| 44 |
|
|
/* Capabilities */ |
| 45 |
|
|
struct Capability |
| 46 |
|
|
{ |
| 47 |
|
|
dlink_node node; |
| 48 |
michael |
1320 |
char *name; /* name of capability */ |
| 49 |
adx |
30 |
unsigned int cap; /* mask value */ |
| 50 |
|
|
}; |
| 51 |
|
|
|
| 52 |
michael |
1320 |
#define CAP_CAP 0x00000001 /* received a CAP to begin with */ |
| 53 |
|
|
#define CAP_QS 0x00000002 /* Can handle quit storm removal */ |
| 54 |
|
|
#define CAP_EX 0x00000004 /* Can do channel +e exemptions */ |
| 55 |
|
|
#define CAP_CHW 0x00000008 /* Can do channel wall @# */ |
| 56 |
|
|
#define CAP_IE 0x00000010 /* Can do invite exceptions */ |
| 57 |
|
|
#define CAP_EOB 0x00000020 /* Can do EOB message */ |
| 58 |
|
|
#define CAP_KLN 0x00000040 /* Can do KLINE message */ |
| 59 |
|
|
#define CAP_GLN 0x00000080 /* Can do GLINE message */ |
| 60 |
|
|
#define CAP_TS6 0x00000100 /* Can do TS6 */ |
| 61 |
|
|
#define CAP_KNOCK 0x00000200 /* supports KNOCK */ |
| 62 |
michael |
1472 |
#define CAP_UNKLN 0x00000400 /* Can do UNKLINE message */ |
| 63 |
|
|
#define CAP_CLUSTER 0x00000800 /* supports server clustering */ |
| 64 |
|
|
#define CAP_ENCAP 0x00001000 /* supports ENCAP message */ |
| 65 |
|
|
#define CAP_HOPS 0x00002000 /* supports HALFOPS */ |
| 66 |
|
|
#define CAP_TBURST 0x00004000 /* supports TBURST */ |
| 67 |
|
|
#define CAP_SVS 0x00008000 /* supports services */ |
| 68 |
|
|
#define CAP_DLN 0x00010000 /* Can do DLINE message */ |
| 69 |
|
|
#define CAP_UNDLN 0x00020000 /* Can do UNDLINE message */ |
| 70 |
michael |
2293 |
#define CAP_FAKEHOST 0x00040000 /* supports fake hosts */ |
| 71 |
adx |
30 |
|
| 72 |
|
|
/* |
| 73 |
|
|
* Capability macros. |
| 74 |
|
|
*/ |
| 75 |
|
|
#define IsCapable(x, cap) ((x)->localClient->caps & (cap)) |
| 76 |
|
|
#define SetCapable(x, cap) ((x)->localClient->caps |= (cap)) |
| 77 |
|
|
#define ClearCap(x, cap) ((x)->localClient->caps &= ~(cap)) |
| 78 |
|
|
|
| 79 |
|
|
|
| 80 |
|
|
/* |
| 81 |
michael |
2865 |
* return values for hunt_server() |
| 82 |
adx |
30 |
*/ |
| 83 |
|
|
#define HUNTED_NOSUCH (-1) /* if the hunted server is not found */ |
| 84 |
|
|
#define HUNTED_ISME 0 /* if this server should execute the command */ |
| 85 |
|
|
#define HUNTED_PASS 1 /* if message passed onwards successfully */ |
| 86 |
|
|
|
| 87 |
michael |
1115 |
extern int valid_servname(const char *); |
| 88 |
michael |
1302 |
extern int check_server(const char *, struct Client *); |
| 89 |
adx |
30 |
extern int hunt_server(struct Client *, struct Client *, |
| 90 |
michael |
1857 |
const char *, const int, const int, char *[]); |
| 91 |
adx |
30 |
extern void add_capability(const char *, int, int); |
| 92 |
|
|
extern int delete_capability(const char *); |
| 93 |
michael |
1877 |
extern int unsigned find_capability(const char *); |
| 94 |
michael |
1632 |
extern void send_capabilities(struct Client *, int); |
| 95 |
adx |
30 |
extern void write_links_file(void *); |
| 96 |
michael |
2216 |
extern void read_links_file(void); |
| 97 |
adx |
30 |
extern void server_estab(struct Client *); |
| 98 |
michael |
2282 |
extern const char *show_capabilities(const struct Client *); |
| 99 |
adx |
30 |
extern void try_connections(void *); |
| 100 |
|
|
extern void burst_channel(struct Client *client_p, struct Channel *); |
| 101 |
|
|
extern void sendnick_TS(struct Client *, struct Client *); |
| 102 |
michael |
1632 |
extern int serv_connect(struct MaskItem *, struct Client *); |
| 103 |
adx |
30 |
extern struct Client *find_servconn_in_progress(const char *); |
| 104 |
|
|
extern struct Server *make_server(struct Client *); |
| 105 |
|
|
#endif /* INCLUDED_s_serv_h */ |