blob: 681ac05820d4563e3681b1978071095f8e6f5895 [file] [log] [blame]
Willy Tarreaubaaee002006-06-26 02:48:02 +02001/*
2 include/types/global.h
3 Global variables.
4
5 Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation, version 2.1
10 exclusively.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20*/
21
22#ifndef _TYPES_GLOBAL_H
23#define _TYPES_GLOBAL_H
24
25#include <netinet/in.h>
26
Willy Tarreaue3ba5f02006-06-29 18:54:54 +020027#include <common/config.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020028#include <types/task.h>
29
30/* modes of operation (global.mode) */
31#define MODE_DEBUG 1
32#define MODE_STATS 2
33#define MODE_LOG 4
34#define MODE_DAEMON 8
35#define MODE_QUIET 16
36#define MODE_CHECK 32
37#define MODE_VERBOSE 64
38#define MODE_STARTING 128
39#define MODE_FOREGROUND 256
40
41
42/* FIXME : this will have to be redefined correctly */
43struct global {
44 int uid;
45 int gid;
46 int nbproc;
47 int maxconn;
48 int maxsock; /* max # of sockets */
49 int rlimit_nofile; /* default ulimit-n value : 0=unset */
50 int rlimit_memmax; /* default ulimit-d in megs value : 0=unset */
51 int mode;
52 char *chroot;
53 char *pidfile;
54 int logfac1, logfac2;
55 int loglev1, loglev2;
56 struct sockaddr_in logsrv1, logsrv2;
57};
58
59extern struct global global;
60extern char *progname; /* program name */
61extern int pid; /* current process id */
62extern int actconn; /* # of active sessions */
63extern int listeners;
64extern char trash[BUFSIZE];
65extern const int zero;
66extern const int one;
67extern int stopping; /* non zero means stopping in progress */
68
69#endif /* _TYPES_GLOBAL_H */
70
71/*
72 * Local variables:
73 * c-indent-level: 8
74 * c-basic-offset: 8
75 * End:
76 */