File: ircd.h

package info (click to toggle)
dancer-ircd 1.0.36-8
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 3,204 kB
  • ctags: 2,703
  • sloc: ansic: 36,121; sh: 3,534; perl: 612; makefile: 307
file content (155 lines) | stat: -rw-r--r-- 4,349 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/************************************************************************
 *   IRC - Internet Relay Chat, include/ircd.h
 *   Copyright (C) 1992 Darren Reed
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 1, or (at your option)
 *   any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *
 * "ircd.h". - Headers file.
 *
 * 
 *
 */
#ifndef INCLUDED_ircd_h
#define INCLUDED_ircd_h
#ifndef INCLUDED_config_h
#include "config.h"
#endif
#ifndef INCLUDED_sys_types_h
#include <sys/types.h>
#define INCLUDED_sys_types_h
#endif

struct Client;

struct SetOptions
{
  int maxclients;       /* max clients allowed */
  int autoconn;         /* autoconn enabled for all servers? */
  int noisy_htm;        /* noisy htm or not ? */
  int lifesux;

#ifdef FLUD
  int fludnum;
  int fludtime;
  int fludblock;
  int killnum;
#endif

#ifdef ANTI_DRONE_FLOOD
  int dronetime;
  int dronecount;
#endif

#ifdef NEED_SPLITCODE
  time_t server_split_recovery_time;
  int split_smallnet_size;
  int split_smallnet_users;
#endif

#ifdef ANTI_SPAMBOT
  int spam_num;
  int spam_time;
#endif
};

struct Counter {
  int     server;         /* servers */
  int     myserver;       /* my servers */
  int     oper;           /* Opers */
  int     chan;           /* Channels */
  int     local;          /* Local Clients */
  int     total;          /* total clients */
  int     invisi;         /* invisible clients */
  int     unknown;        /* unknown connections */
  int     max_loc;        /* MAX local clients */
  int     max_tot;        /* MAX global clients */
  unsigned long totalrestartcount;   /* Total clients since restart */
};

extern struct SetOptions GlobalSetOptions;  /* defined in ircd.c */
/*
 * XXX - ACK!!!
 */
/*
 * ZZZ - These can go away slowly as they are rewritten.
 * calm down Tom.
 * heh :) --Bleep
 *
 */
#define AUTOCONN   GlobalSetOptions.autoconn
#define DRONECOUNT GlobalSetOptions.dronecount
#define DRONETIME  GlobalSetOptions.dronetime
#define FLUDBLOCK  GlobalSetOptions.fludblock
#define FLUDNUM    GlobalSetOptions.fludnum
#define FLUDTIME   GlobalSetOptions.fludtime
#define IDLETIME   GlobalSetOptions.idletime
#define LIFESUX    GlobalSetOptions.lifesux
#define MAXCLIENTS GlobalSetOptions.maxclients
#define NOISYHTM   GlobalSetOptions.noisy_htm
#define SPAMNUM    GlobalSetOptions.spam_num
#define SPAMTIME   GlobalSetOptions.spam_time
#define SPLITDELAY GlobalSetOptions.server_split_recovery_time
#define SPLITNUM   GlobalSetOptions.split_smallnet_size
#define SPLITUSERS GlobalSetOptions.split_smallnet_users
#define KILLNUM    GlobalSetOptions.killnum

extern const char*    debugmode;
extern int            debuglevel;
extern int            debugtty;
extern char*          creation;
extern char*          generation;
extern char*          platform;
extern char*          infotext[];
extern char*          serial;
extern char*          version;
extern const char     serveropts[];
extern int            LRV;
extern int            cold_start;
extern int            dline_in_progress;
extern int            dorehash;
extern int            rehashed;
extern float          currlife;
extern struct Client  me;
extern struct Client* GlobalClientList;
extern struct Client* local[];
extern struct Counter Count;
extern time_t         CurrentTime;
extern time_t         LCF;
extern time_t         nextconnect;
extern time_t         nextping;


extern struct Client* local_cptr_list;
/* extern struct Client* oper_cptr_list; */
extern struct Client* serv_cptr_list;

#ifdef REJECT_HOLD
extern int reject_held_fds;
#endif

extern size_t   get_maxrss(void);

/* 1800 == half an hour
 * if clock set back more than this length of time
 * complain
 */
#define MAX_SETBACK_TIME 1800

#ifdef SAVE_MAXCLIENT
extern void write_stats(void);
#endif

#endif