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