1 |
/* |
2 |
* Copyright © 2005 William Pitcock, et al. |
3 |
* Rights to this code are as documented in doc/LICENSE. |
4 |
* |
5 |
* Data structures related to network servers. |
6 |
* |
7 |
* $Id: servers.h 8027 2007-04-02 10:47:18Z nenolod $ |
8 |
*/ |
9 |
|
10 |
#ifndef SERVERS_H |
11 |
#define SERVERS_H |
12 |
|
13 |
/* servers struct */ |
14 |
struct server_t |
15 |
{ |
16 |
char *name; |
17 |
char *desc; |
18 |
char *sid; |
19 |
|
20 |
unsigned int hops; |
21 |
unsigned int users; |
22 |
unsigned int invis; |
23 |
unsigned int opers; |
24 |
unsigned int away; |
25 |
|
26 |
time_t connected_since; |
27 |
|
28 |
unsigned int flags; |
29 |
|
30 |
server_t *uplink; /* uplink server */ |
31 |
list_t children; /* children linked to me */ |
32 |
list_t userlist; /* users attached to me */ |
33 |
}; |
34 |
|
35 |
#define SF_HIDE 0x00000001 |
36 |
#define SF_EOB 0x00000002 /* Burst finished (we have all users/channels) -- jilles */ |
37 |
#define SF_EOB2 0x00000004 /* Is EOB but an uplink is not (for P10) */ |
38 |
#define SF_JUPE_PENDING 0x00000008 /* Sent SQUIT request, will introduce jupe when it dies (unconnect semantics) */ |
39 |
|
40 |
/* tld list struct */ |
41 |
struct tld_t |
42 |
{ |
43 |
char *name; |
44 |
}; |
45 |
|
46 |
#define SERVER_NAME(serv) ((serv)->sid[0] ? (serv)->sid : (serv)->name) |
47 |
#define ME (ircd->uses_uid ? me.numeric : me.name) |
48 |
|
49 |
/* servers.c */ |
50 |
E dictionary_tree_t *servlist; |
51 |
E list_t tldlist; |
52 |
|
53 |
E void init_servers (void); |
54 |
|
55 |
E tld_t *tld_add (const char *name); |
56 |
E void tld_delete (const char *name); |
57 |
E tld_t *tld_find (const char *name); |
58 |
|
59 |
E server_t *server_add (const char *name, unsigned int hops, const char *uplink, const char *id, const char *desc); |
60 |
E void server_delete (const char *name); |
61 |
E server_t *server_find (const char *name); |
62 |
|
63 |
#endif |