]>
Commit | Line | Data |
---|---|---|
c86edd1d Q |
1 | /* server.h */ |
2 | ||
3 | #ifndef __SERVER_H | |
4 | #define __SERVER_H | |
5 | ||
6 | #include "../lib/sstring.h" | |
7 | #include "../irc/irc_config.h" | |
4f2ceb49 | 8 | #include "../lib/flags.h" |
c86edd1d Q |
9 | |
10 | #define LS_INVALID 0 /* No server here */ | |
11 | #define LS_LINKED 1 /* Server fully linked */ | |
12 | #define LS_LINKING 2 /* This actual server is bursting */ | |
13 | #define LS_PLINKING 3 /* Some other server between here and there is bursting */ | |
14 | #define LS_SQUIT 4 /* This server is being deleted due to a SQUIT */ | |
15 | ||
4f2ceb49 CP |
16 | #define SMODE_HUB 0x0001 |
17 | #define SMODE_IPV6 0x0002 | |
18 | #define SMODE_SERVICE 0x0004 | |
19 | #define SMODE_OPERNAME 0x0008 | |
20 | ||
21 | #define SMODE_ALL 0x000F | |
22 | ||
565e90f4 CP |
23 | #define SIsHub(x) ((x)->flags & SMODE_HUB) |
24 | #define SIsIPv6(x) ((x)->flags & SMODE_IPV6) | |
25 | #define SIsService(x) ((x)->flags & SMODE_SERVICE) | |
26 | #define SHasOpername(x) ((x)->flags & SMODE_OPERNAME) | |
27 | ||
4f2ceb49 | 28 | extern const flag smodeflags[]; |
843184e3 | 29 | extern long myhub; |
4f2ceb49 | 30 | |
c86edd1d Q |
31 | typedef struct { |
32 | sstring *name; | |
33 | sstring *description; | |
34 | short parent; | |
35 | short linkstate; | |
36 | int maxusernum; | |
4f2ceb49 | 37 | flag_t flags; |
c86edd1d Q |
38 | } server; |
39 | ||
40 | extern server serverlist[MAXSERVERS]; | |
41 | ||
42 | int handleservermsg(void *source, int cargc, char **cargv); | |
43 | int handleeobmsg(void *source, int cargc, char **argv); | |
44 | int handlesquitmsg(void *source, int cargc, char **cargv); | |
45 | void handledisconnect(int hooknum, void *arg); | |
c3db6f7e | 46 | void deleteserver(long servernum); |
c86edd1d Q |
47 | int findserver(const char *name); |
48 | ||
49 | #endif |