summaryrefslogtreecommitdiff
path: root/apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/conf.h
blob: ec632f2d84b57724810bef27c2d1cb724d53636e (plain)
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
/*
 * Copyright (c) 1994, 1995.  Netscape Communications Corporation.  All
 * rights reserved.
 * 
 * Use of this software is governed by the terms of the license agreement for
 * the Netscape Communications or Netscape Comemrce Server between the
 * parties.
 */


/* ------------------------------------------------------------------------ */


/*
 * conf.h: Deals with the server configuration file.
 * 
 * Object configuration is an entirely different matter. This deals with
 * things like what port the server runs on, how many children it spawns,
 * and other server-related issues. Information related configuration is
 * handled by the object conf.
 * 
 * Rob McCool
 */


#ifndef CONF_H
#define CONF_H

#ifdef XP_WIN32
#include <nt/ntconf.h>
#else

#include "netsite.h"
#include "frame/objset.h"
#include "base/daemon.h"  /* daemon struct */

#include <pwd.h>      /* struct passwd */

/* ------------------------------ Constants ------------------------------- */


/* The longest line in the configuration file */
#define CONF_MAXLEN 16384

#define LF 10
#define CR 13


#if defined(DAEMON_ANY)
#ifdef MCC_PROXY
#define DEFAULT_PORT 8080
#else
#define DEFAULT_PORT 80
#endif
#endif

#if defined(DAEMON_UNIX_POOL) || defined(DAEMON_UNIX_MOBRULE)
#define DEFAULT_POOL_MAX 50
#endif



/* ------------------------------- Globals -------------------------------- */


#ifndef CONF_C

/*
 * These server parameters are made global because they really don't
 * belong anywhere else. 
 */

#if defined(DAEMON_ANY)

#include <sys/types.h>

/* What port we listen to */
extern int port;

/* What address to bind to */
extern char *addr;

/* User to run as */
extern struct passwd *userpw;

/* Directory to chroot to */
extern char *chr;

/* Where to log our pid to */
extern char *pidfn;

#if defined(DAEMON_UNIX_POOL) || defined(DAEMON_UNIX_MOBRULE)
/* The maximum number of processes to keep in the pool */
extern int pool_max;
/* The minimum number of processes to keep in the pool */
extern int pool_min;
/* The maximum number of requests each process should handle. -1=default */
extern int pool_life;
#endif

#ifdef NET_SSL
extern char *secure_keyfn;
extern char *secure_certfn;
extern char *secure_dongle;
extern int security_active;
extern int secure_auth;
extern int security_session_timeout;
#endif

#endif

/* The server's hostname as should be reported in self-ref URLs */
extern char *server_hostname;

/* The main object from which all are derived */
extern char *root_object;

/* The object set the administrator has asked us to load */
extern httpd_objset *std_os;

/* The main error log, where all errors are logged */
extern char *master_error_log;

/* The e-mail address of someone to mail upon catastrophic error */
extern char *admin_email;

#endif


/* ------------------------------ Prototypes ------------------------------ */


/*
 * conf_init reads the given configuration file and sets any non-default
 * parameters to their given setting.
 */

char *conf_init(char *cfn);

/*
 * conf_terminate frees any data the conf routines may be holding.
 */

void conf_terminate(void);


/*
 * conf_vars2daemon transfers these globals to a daemon structure 
 */
void conf_vars2daemon(daemon_s *d);

#endif
#endif