]>
Commit | Line | Data |
---|---|---|
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" | |
31 | ||
32 | /* | |
33 | * The number of seconds between calls to try_connections(). Fiddle with | |
34 | * this ONLY if you KNOW what you're doing! | |
35 | */ | |
36 | #define TRY_CONNECTIONS_TIME 60 | |
37 | ||
38 | /* | |
39 | * number of seconds to wait after server starts up, before | |
40 | * starting try_connections() | |
41 | * TOO SOON and you can nick collide like crazy. | |
42 | */ | |
43 | #define STARTUP_CONNECTIONS_TIME 60 | |
44 | ||
45 | struct Client; | |
46 | struct server_conf; | |
47 | struct Channel; | |
48 | ||
49 | /* Capabilities */ | |
50 | struct Capability | |
51 | { | |
52 | const char *name; /* name of capability */ | |
53 | unsigned int cap; /* mask value */ | |
54 | unsigned int required; /* 1 if required, 0 if not */ | |
55 | }; | |
56 | ||
57 | #define CAP_CAP 0x00001 /* received a CAP to begin with */ | |
58 | #define CAP_QS 0x00002 /* Can handle quit storm removal */ | |
59 | #define CAP_EX 0x00004 /* Can do channel +e exemptions */ | |
60 | #define CAP_CHW 0x00008 /* Can do channel wall @# */ | |
61 | #define CAP_IE 0x00010 /* Can do invite exceptions */ | |
62 | #define CAP_KLN 0x00040 /* Can do KLINE message */ | |
63 | #define CAP_ZIP 0x00100 /* Can do ZIPlinks */ | |
64 | #define CAP_KNOCK 0x00400 /* supports KNOCK */ | |
65 | #define CAP_TB 0x00800 /* supports TBURST */ | |
66 | #define CAP_UNKLN 0x01000 /* supports remote unkline */ | |
67 | #define CAP_CLUSTER 0x02000 /* supports cluster stuff */ | |
68 | #define CAP_ENCAP 0x04000 /* supports ENCAP */ | |
69 | #define CAP_TS6 0x08000 /* supports TS6 or above */ | |
70 | #define CAP_SERVICE 0x10000 | |
71 | #define CAP_RSFNC 0x20000 /* rserv FNC */ | |
72 | #define CAP_SAVE 0x40000 /* supports SAVE (nick collision FNC) */ | |
73 | #define CAP_EUID 0x80000 /* supports EUID (ext UID + nonencap CHGHOST) */ | |
74 | #define CAP_EOPMOD 0x100000 /* supports EOPMOD (ext +z + ext topic) */ | |
75 | #define CAP_BAN 0x200000 /* supports propagated bans */ | |
76 | #define CAP_BAN 0x400000 /* supports MLOCK messages */ | |
77 | ||
78 | #define CAP_MASK (CAP_QS | CAP_EX | CAP_CHW | \ | |
79 | CAP_IE | CAP_KLN | CAP_SERVICE |\ | |
80 | CAP_CLUSTER | CAP_ENCAP | \ | |
81 | CAP_ZIP | CAP_KNOCK | CAP_UNKLN | \ | |
82 | CAP_RSFNC | CAP_SAVE | CAP_EUID | CAP_EOPMOD | \ | |
83 | CAP_BAN | CAP_MLOCK) | |
84 | ||
85 | #ifdef HAVE_LIBZ | |
86 | #define CAP_ZIP_SUPPORTED CAP_ZIP | |
87 | #else | |
88 | #define CAP_ZIP_SUPPORTED 0 | |
89 | #endif | |
90 | ||
91 | /* | |
92 | * Capability macros. | |
93 | */ | |
94 | #define IsCapable(x, cap) (((x)->localClient->caps & (cap)) == cap) | |
95 | #define NotCapable(x, cap) (((x)->localClient->caps & (cap)) == 0) | |
96 | #define ClearCap(x, cap) ((x)->localClient->caps &= ~(cap)) | |
97 | ||
98 | /* | |
99 | * Globals | |
100 | * | |
101 | * | |
102 | * list of recognized server capabilities. "TS" is not on the list | |
103 | * because all servers that we talk to already do TS, and the kludged | |
104 | * extra argument to "PASS" takes care of checking that. -orabidoo | |
105 | */ | |
106 | extern struct Capability captab[]; | |
107 | ||
108 | extern int MaxClientCount; /* GLOBAL - highest number of clients */ | |
109 | extern int MaxConnectionCount; /* GLOBAL - highest number of connections */ | |
110 | ||
111 | extern int refresh_user_links; | |
112 | ||
113 | /* | |
114 | * return values for hunt_server() | |
115 | */ | |
116 | #define HUNTED_NOSUCH (-1) /* if the hunted server is not found */ | |
117 | #define HUNTED_ISME 0 /* if this server should execute the command */ | |
118 | #define HUNTED_PASS 1 /* if message passed onwards successfully */ | |
119 | ||
120 | ||
121 | extern int hunt_server(struct Client *client_pt, | |
122 | struct Client *source_pt, | |
123 | const char *command, int server, int parc, const char **parv); | |
124 | extern void send_capabilities(struct Client *, int); | |
125 | extern const char *show_capabilities(struct Client *client); | |
126 | extern void try_connections(void *unused); | |
127 | ||
128 | extern int check_server(const char *name, struct Client *server); | |
129 | extern int server_estab(struct Client *client_p); | |
130 | ||
131 | extern int serv_connect(struct server_conf *, struct Client *); | |
132 | ||
133 | #endif /* INCLUDED_s_serv_h */ |