ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/servers.h
Revision: 1.4
Committed: Thu Aug 30 19:56:19 2007 UTC (16 years, 9 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.3: +4 -1 lines
Log Message:
- put faultcodes into their own namespace
- removed old files
- limited header garbage in atheme.h
- macros to inline bools for connection_t::is_*
- put some connection_t functions into the connection_t class

File Contents

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