]> git.ipfire.org Git - thirdparty/cups.git/blame - scheduler/conf.h
Merge changes from CUPS 1.4svn-r8492.
[thirdparty/cups.git] / scheduler / conf.h
CommitLineData
ef416fc2 1/*
b19ccc9e 2 * "$Id: conf.h 7935 2008-09-11 01:54:11Z mike $"
ef416fc2 3 *
4 * Configuration file definitions for the Common UNIX Printing System (CUPS)
5 * scheduler.
6 *
dfd5680b 7 * Copyright 2007-2009 by Apple Inc.
7594b224 8 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 9 *
10 * These coded instructions, statements, and computer programs are the
bc44d920 11 * property of Apple Inc. and are protected by Federal copyright
12 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
13 * which should have been included with this file. If this file is
14 * file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 15 */
16
17
18/*
19 * Log levels...
20 */
21
22typedef enum
23{
c9fc04c6
MS
24 CUPSD_LOG_PPD = -4, /* Used internally for PPD keywords */
25 CUPSD_LOG_ATTR, /* Used internally for attributes */
f7deaa1a 26 CUPSD_LOG_STATE, /* Used internally for state-reasons */
27 CUPSD_LOG_PAGE, /* Used internally for page logging */
ef416fc2 28 CUPSD_LOG_NONE,
f7deaa1a 29 CUPSD_LOG_EMERG, /* Emergency issues */
30 CUPSD_LOG_ALERT, /* Something bad happened that needs attention */
31 CUPSD_LOG_CRIT, /* Critical error but server continues */
32 CUPSD_LOG_ERROR, /* Error condition */
33 CUPSD_LOG_WARN, /* Warning */
34 CUPSD_LOG_NOTICE, /* Normal condition that needs logging */
35 CUPSD_LOG_INFO, /* General information */
36 CUPSD_LOG_DEBUG, /* General debugging */
37 CUPSD_LOG_DEBUG2 /* Detailed debugging */
ef416fc2 38} cupsd_loglevel_t;
39
1f0275e3
MS
40typedef enum
41{
42 CUPSD_ACCESSLOG_CONFIG, /* Log config requests */
43 CUPSD_ACCESSLOG_ACTIONS, /* Log config, print, and job management requests */
44 CUPSD_ACCESSLOG_ALL /* Log everything */
45} cupsd_accesslog_t;
46
dfd5680b
MS
47typedef enum
48{
49 CUPSD_TIME_STANDARD, /* "Standard" Apache/CLF format */
50 CUPSD_TIME_USECS /* Standard format with microseconds */
51} cupsd_time_t;
52
ef416fc2 53
49d87452
MS
54/*
55 * FatalErrors flags...
56 */
57
58#define CUPSD_FATAL_NONE 0 /* No errors are fatal */
59#define CUPSD_FATAL_BROWSE 1 /* Browse bind errors are fatal */
60#define CUPSD_FATAL_CONFIG 2 /* Config file syntax errors are fatal */
61#define CUPSD_FATAL_LISTEN 4 /* Listen/Port bind errors are fatal */
62#define CUPSD_FATAL_LOG 8 /* Log file errors are fatal */
63#define CUPSD_FATAL_PERMISSIONS 16 /* File permission errors are fatal */
64#define CUPSD_FATAL_ALL ~0 /* All errors are fatal */
65
66
ef416fc2 67/*
68 * Printcap formats...
69 */
70
f7deaa1a 71#define PRINTCAP_BSD 0 /* Berkeley LPD format */
72#define PRINTCAP_SOLARIS 1 /* Solaris lpsched format */
0af14961 73#define PRINTCAP_PLIST 2 /* Mac OS X plist format */
ef416fc2 74
75
b19ccc9e
MS
76/*
77 * SSL options (bits)...
78 */
79
80#define CUPSD_SSL_NONE 0 /* No special options */
81#define CUPSD_SSL_NOEMPTY 1 /* Do not insert empty fragments */
82
83
ef416fc2 84/*
85 * Globals...
86 */
87
88VAR char *ConfigurationFile VALUE(NULL),
89 /* Configuration file to use */
90 *ServerName VALUE(NULL),
91 /* FQDN for server */
92 *ServerAdmin VALUE(NULL),
93 /* Administrator's email */
94 *ServerRoot VALUE(NULL),
95 /* Root directory for scheduler */
96 *ServerBin VALUE(NULL),
97 /* Root directory for binaries */
98 *StateDir VALUE(NULL),
99 /* Root directory for state data */
100 *RequestRoot VALUE(NULL),
101 /* Directory for request files */
102 *DocumentRoot VALUE(NULL);
103 /* Root directory for documents */
d1c13e16
MS
104VAR int RemoteAccessEnabled VALUE(0),
105 /* Are we listening on non-local addresses? */
106 ServerNameIsIP VALUE(0);
107 /* Is the ServerName an IP address? */
ef416fc2 108VAR int NumSystemGroups VALUE(0);
109 /* Number of system group names */
ac884b6a
MS
110VAR char *SystemGroups[MAX_SYSTEM_GROUPS]
111 VALUE({0});
ef416fc2 112 /* System group names */
ac884b6a
MS
113VAR gid_t SystemGroupIDs[MAX_SYSTEM_GROUPS]
114 VALUE({0});
ef416fc2 115 /* System group IDs */
116VAR char *AccessLog VALUE(NULL),
117 /* Access log filename */
118 *ErrorLog VALUE(NULL),
119 /* Error log filename */
120 *PageLog VALUE(NULL),
121 /* Page log filename */
122 *CacheDir VALUE(NULL),
123 /* Cache file directory */
124 *DataDir VALUE(NULL),
125 /* Data file directory */
126 *DefaultLanguage VALUE(NULL),
127 /* Default language encoding */
128 *DefaultCharset VALUE(NULL),
129 /* Default charset */
130 *DefaultLocale VALUE(NULL),
131 /* Default locale */
c5571a1d
MS
132 *DefaultPaperSize VALUE(NULL),
133 /* Default paper size */
323c5de1 134 *ErrorPolicy VALUE(NULL),
135 /* Default printer-error-policy */
ef416fc2 136 *RIPCache VALUE(NULL),
137 /* Amount of memory for RIPs */
138 *TempDir VALUE(NULL),
139 /* Temporary directory */
140 *Printcap VALUE(NULL),
141 /* Printcap file */
142 *PrintcapGUI VALUE(NULL),
143 /* GUI program to use for IRIX */
144 *FontPath VALUE(NULL),
145 /* Font search path */
146 *RemoteRoot VALUE(NULL),
147 /* Remote root user */
148 *Classification VALUE(NULL);
149 /* Classification of system */
f7deaa1a 150#ifdef HAVE_GSSAPI
151VAR char *GSSServiceName VALUE(NULL);
152 /* GSS service name */
153VAR char *Krb5Keytab VALUE(NULL);
154 /* Kerberos Keytab */
155#endif /* HAVE_GSSAPI */
ef416fc2 156VAR uid_t User VALUE(1);
157 /* User ID for server */
158VAR gid_t Group VALUE(0);
159 /* Group ID for server */
dfd5680b 160VAR cupsd_accesslog_t AccessLogLevel VALUE(CUPSD_ACCESSLOG_ACTIONS);
1f0275e3 161 /* Access log level */
dfd5680b 162VAR int ClassifyOverride VALUE(0),
ef416fc2 163 /* Allow overrides? */
164 ConfigFilePerm VALUE(0640),
165 /* Permissions for config files */
49d87452
MS
166 FatalErrors VALUE(CUPSD_FATAL_CONFIG),
167 /* Which errors are fatal? */
dfd5680b 168 LogFilePerm VALUE(0644);
ef416fc2 169 /* Permissions for log files */
dfd5680b 170VAR cupsd_loglevel_t LogLevel VALUE(CUPSD_LOG_WARN);
1f0275e3 171 /* Error log level */
dfd5680b
MS
172VAR cupsd_time_t LogTimeFormat VALUE(CUPSD_TIME_STANDARD);
173 /* Log file time format */
174VAR int MaxClients VALUE(100),
ef416fc2 175 /* Maximum number of clients */
176 MaxClientsPerHost VALUE(0),
177 /* Maximum number of clients per host */
f7deaa1a 178 MaxCopies VALUE(CUPS_DEFAULT_MAX_COPIES),
ef416fc2 179 /* Maximum number of copies per job */
180 MaxLogSize VALUE(1024 * 1024),
181 /* Maximum size of log files */
182 MaxPrinterHistory VALUE(10),
183 /* Maximum printer state history */
184 MaxRequestSize VALUE(0),
185 /* Maximum size of IPP requests */
186 HostNameLookups VALUE(FALSE),
187 /* Do we do reverse lookups? */
188 Timeout VALUE(DEFAULT_TIMEOUT),
189 /* Timeout during requests */
190 KeepAlive VALUE(TRUE),
191 /* Support the Keep-Alive option? */
192 KeepAliveTimeout VALUE(DEFAULT_KEEPALIVE),
193 /* Timeout between requests */
194 ImplicitClasses VALUE(TRUE),
195 /* Are classes implicitly created? */
196 ImplicitAnyClasses VALUE(FALSE),
197 /* Create AnyPrinter classes? */
198 HideImplicitMembers VALUE(TRUE),
199 /* Hide implicit class members? */
200 FileDevice VALUE(FALSE),
201 /* Allow file: devices? */
202 FilterLimit VALUE(0),
203 /* Max filter cost at any time */
204 FilterLevel VALUE(0),
205 /* Current filter level */
206 FilterNice VALUE(0),
207 /* Nice value for filters */
49d87452 208 ReloadTimeout VALUE(DEFAULT_KEEPALIVE),
ef416fc2 209 /* Timeout before reload from SIGHUP */
210 RootCertDuration VALUE(300),
211 /* Root certificate update interval */
ac884b6a
MS
212 RunUser VALUE(0),
213 /* User to run as, used for files */
fa73b229 214 PrintcapFormat VALUE(PRINTCAP_BSD),
ef416fc2 215 /* Format of printcap file? */
dfd5680b 216 DefaultShared VALUE(TRUE),
fa73b229 217 /* Share printers by default? */
dfd5680b
MS
218 MultipleOperationTimeout VALUE(DEFAULT_TIMEOUT);
219 /* multiple-operation-time-out value */
ef416fc2 220VAR cups_file_t *AccessFile VALUE(NULL),
221 /* Access log file */
222 *ErrorFile VALUE(NULL),
223 /* Error log file */
224 *PageFile VALUE(NULL);
225 /* Page log file */
01ce6322
MS
226VAR char *PageLogFormat VALUE(NULL);
227 /* Page log format */
ef416fc2 228VAR mime_t *MimeDatabase VALUE(NULL);
229 /* MIME type database */
230VAR int NumMimeTypes VALUE(0);
231 /* Number of MIME types */
232VAR const char **MimeTypes VALUE(NULL);
233 /* Array of MIME types */
234
235#ifdef HAVE_SSL
236VAR char *ServerCertificate VALUE(NULL);
237 /* Server certificate file */
238# if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS)
239VAR char *ServerKey VALUE(NULL);
240 /* Server key file */
ef416fc2 241# endif /* HAVE_LIBSSL || HAVE_GNUTLS */
b19ccc9e
MS
242VAR int SSLOptions VALUE(CUPSD_SSL_NONE);
243 /* SSL/TLS options */
ef416fc2 244#endif /* HAVE_SSL */
245
a4d04587 246#ifdef HAVE_LAUNCHD
49d87452 247VAR int LaunchdTimeout VALUE(DEFAULT_KEEPALIVE);
a4d04587 248 /* Time after which an idle cupsd will exit */
249VAR char *LaunchdConf VALUE(NULL);
250 /* launchd(8) configuration file */
251#endif /* HAVE_LAUNCHD */
ef416fc2 252
7594b224 253#ifdef __APPLE__
254VAR int AppleQuotas VALUE(TRUE);
255 /* Use Apple PrintService Quotas instead of CUPS quotas */
256#endif /* __APPLE__ */
257
f7deaa1a 258#ifdef HAVE_AUTHORIZATION_H
259VAR char *SystemGroupAuthKey VALUE(NULL);
260 /* System group auth key */
261#endif /* HAVE_AUTHORIZATION_H */
262
263
ef416fc2 264/*
265 * Prototypes...
266 */
267
b94498cf 268extern int cupsdCheckPermissions(const char *filename,
269 const char *suffix, int mode,
270 int user, int group, int is_dir,
271 int create_dir);
dfd5680b 272extern char *cupsdGetDateTime(struct timeval *t, cupsd_time_t format);
f7deaa1a 273#ifdef HAVE_GSSAPI
274extern int cupsdLogGSSMessage(int level, int major_status,
275 int minor_status,
276 const char *message, ...);
277#endif /* HAVE_GSSAPI */
75bd9771
MS
278extern int cupsdLogJob(cupsd_job_t *job, int level, const char *message, ...)
279#ifdef __GNUC__
280__attribute__ ((__format__ (__printf__, 3, 4)))
281#endif /* __GNUC__ */
282;
ef416fc2 283extern int cupsdLogMessage(int level, const char *message, ...)
284#ifdef __GNUC__
285__attribute__ ((__format__ (__printf__, 2, 3)))
286#endif /* __GNUC__ */
287;
288extern int cupsdLogPage(cupsd_job_t *job, const char *page);
f7deaa1a 289extern int cupsdLogRequest(cupsd_client_t *con, http_status_t code);
b94498cf 290extern int cupsdReadConfiguration(void);
75bd9771 291extern int cupsdWriteErrorLog(int level, const char *message);
ef416fc2 292
293
294/*
b19ccc9e 295 * End of "$Id: conf.h 7935 2008-09-11 01:54:11Z mike $".
ef416fc2 296 */