ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/servers.h
Revision: 1.5
Committed: Sun Sep 9 20:05:51 2007 UTC (16 years, 8 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.4: +9 -5 lines
Log Message:
- changed configurations to the c++ stdlib
- more #defines to enum
- removed getopt.h and link.h from the system as they were unused
- reworked logstreams
- added an itoa with old syntax
- made klines objects
- moved some global variables into appropriate classes
- fixed boost.foreach's compiler workaround #if's
- allow other files to add exceptions with ADD_EXCEPTION
- changed mynick_t to c++ object
- moved servers.h out of atheme.h
- corrected PING from inspircd 1.2

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.5 * $Id: servers.h,v 1.4 2007-08-30 19:56:19 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 pippijn 1.5 enum server_flag
47     {
48     SF_HIDE = 1 << 0,
49     SF_EOB = 1 << 1, /* Burst finished (we have all users/channels) -- jilles */
50     SF_EOB2 = 1 << 2, /* Is EOB but an uplink is not (for P10) */
51     SF_JUPE_PENDING = 1 << 3 /* Sent SQUIT request, will introduce jupe when it dies (unconnect semantics) */
52     };
53 pippijn 1.1
54     /* tld list struct */
55 pippijn 1.3 struct tld_t : zero_initialised
56 pippijn 1.1 {
57     char *name;
58     };
59    
60     #define SERVER_NAME(serv) ((serv)->sid[0] ? (serv)->sid : (serv)->name)
61     #define ME (ircd->uses_uid ? me.numeric : me.name)
62    
63     /* servers.c */
64     E list_t tldlist;
65    
66     E void init_servers (void);
67    
68 pippijn 1.3 E tld_t *tld_add (char const * const name);
69     E void tld_delete (char const * const name);
70     E tld_t *tld_find (char const * const name);
71    
72     E server_t *server_add (char const * const name, unsigned int hops, char const * const uplink, char const * const id, char const * const desc);
73     E void server_delete (char const * const name);
74 pippijn 1.5 E void server_delete (server_t *s, bool force = false);
75 pippijn 1.3 E server_t *server_find (char const * const name);
76 pippijn 1.1
77     #endif