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