]> jfr.im git - solanum.git/blame - include/s_serv.h
ircd: chase capability API changes
[solanum.git] / include / s_serv.h
CommitLineData
212380e3
AC
1/*
2 * ircd-ratbox: A slightly useful ircd.
3 * s_serv.h: A header for the server functions.
4 *
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2004 ircd-ratbox development team
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 *
24 * $Id: s_serv.h 1863 2006-08-27 13:40:37Z jilles $
25 */
26
27#ifndef INCLUDED_serv_h
28#define INCLUDED_serv_h
29
30#include "config.h"
346fba92 31#include "capability.h"
212380e3
AC
32
33/*
34 * The number of seconds between calls to try_connections(). Fiddle with
35 * this ONLY if you KNOW what you're doing!
36 */
37#define TRY_CONNECTIONS_TIME 60
38
212380e3
AC
39/*
40 * number of seconds to wait after server starts up, before
41 * starting try_connections()
55abcbb2 42 * TOO SOON and you can nick collide like crazy.
212380e3
AC
43 */
44#define STARTUP_CONNECTIONS_TIME 60
45
46struct Client;
47struct server_conf;
48struct Channel;
49
50/* Capabilities */
346fba92 51extern struct CapabilityIndex *serv_capindex;
486cd344 52extern struct CapabilityIndex *cli_capindex;
346fba92
AC
53
54/*
55 * XXX: this is kind of ugly, but this allows us to have backwards
56 * API-compatibility.
57 */
58extern unsigned int CAP_CAP; /* received a CAP to begin with */
59extern unsigned int CAP_QS; /* Can handle quit storm removal */
60extern unsigned int CAP_EX; /* Can do channel +e exemptions */
61extern unsigned int CAP_CHW; /* Can do channel wall @# */
62extern unsigned int CAP_IE; /* Can do invite exceptions */
63extern unsigned int CAP_KLN; /* Can do KLINE message */
64extern unsigned int CAP_ZIP; /* Can do ZIPlinks */
65extern unsigned int CAP_KNOCK; /* supports KNOCK */
66extern unsigned int CAP_TB; /* supports TBURST */
67extern unsigned int CAP_UNKLN; /* supports remote unkline */
68extern unsigned int CAP_CLUSTER; /* supports cluster stuff */
69extern unsigned int CAP_ENCAP; /* supports ENCAP */
70extern unsigned int CAP_TS6; /* supports TS6 or above */
71extern unsigned int CAP_SERVICE; /* supports services */
72extern unsigned int CAP_RSFNC; /* rserv FNC */
73extern unsigned int CAP_SAVE; /* supports SAVE (nick collision FNC) */
74extern unsigned int CAP_EUID; /* supports EUID (ext UID + nonencap CHGHOST) */
75extern unsigned int CAP_EOPMOD; /* supports EOPMOD (ext +z + ext topic) */
76extern unsigned int CAP_BAN; /* supports propagated bans */
77extern unsigned int CAP_MLOCK; /* supports MLOCK messages */
78
79/* XXX: added for backwards compatibility. --nenolod */
80#define CAP_MASK (capability_index_mask(serv_capindex) & ~(CAP_TS6 | CAP_CAP))
212380e3
AC
81
82#ifdef HAVE_LIBZ
83#define CAP_ZIP_SUPPORTED CAP_ZIP
84#else
85#define CAP_ZIP_SUPPORTED 0
86#endif
87
88/*
89 * Capability macros.
90 */
91#define IsCapable(x, cap) (((x)->localClient->caps & (cap)) == cap)
92#define NotCapable(x, cap) (((x)->localClient->caps & (cap)) == 0)
93#define ClearCap(x, cap) ((x)->localClient->caps &= ~(cap))
94
212380e3
AC
95/*
96 * Globals
97 *
98 *
99 * list of recognized server capabilities. "TS" is not on the list
100 * because all servers that we talk to already do TS, and the kludged
101 * extra argument to "PASS" takes care of checking that. -orabidoo
102 */
212380e3
AC
103extern int MaxClientCount; /* GLOBAL - highest number of clients */
104extern int MaxConnectionCount; /* GLOBAL - highest number of connections */
105
106extern int refresh_user_links;
107
108/*
55abcbb2 109 * return values for hunt_server()
212380e3
AC
110 */
111#define HUNTED_NOSUCH (-1) /* if the hunted server is not found */
112#define HUNTED_ISME 0 /* if this server should execute the command */
113#define HUNTED_PASS 1 /* if message passed onwards successfully */
114
346fba92 115extern void init_builtin_capabs(void);
212380e3
AC
116
117extern int hunt_server(struct Client *client_pt,
118 struct Client *source_pt,
119 const char *command, int server, int parc, const char **parv);
346fba92 120extern void send_capabilities(struct Client *, unsigned int);
212380e3
AC
121extern const char *show_capabilities(struct Client *client);
122extern void try_connections(void *unused);
212380e3
AC
123
124extern int check_server(const char *name, struct Client *server);
125extern int server_estab(struct Client *client_p);
126
127extern int serv_connect(struct server_conf *, struct Client *);
128
129#endif /* INCLUDED_s_serv_h */