]> git.ipfire.org Git - thirdparty/cups.git/blame - scheduler/conf.h
Save work.
[thirdparty/cups.git] / scheduler / conf.h
CommitLineData
ef416fc2 1/*
f2d18633 2 * "$Id$"
ef416fc2 3 *
10d09e33 4 * Configuration file definitions for the CUPS scheduler.
ef416fc2 5 *
8a259669 6 * Copyright 2007-2013 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{
a469f8a5 23 CUPSD_LOG_PPD = -5, /* Used internally for PPD keywords */
c9fc04c6 24 CUPSD_LOG_ATTR, /* Used internally for attributes */
a469f8a5
MS
25 CUPSD_LOG_STATE, /* Used internally for printer-state-reasons */
26 CUPSD_LOG_JOBSTATE, /* Used internally for job-state-reasons */
f7deaa1a 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 */
f3c17241 73#define PRINTCAP_PLIST 2 /* OS X plist format */
ef416fc2 74
75
e07d4801
MS
76/*
77 * ServerAlias data...
78 */
79
80typedef struct
81{
82 size_t namelen; /* Length of alias name */
83 char name[1]; /* Alias name */
84} cupsd_alias_t;
85
86
ef416fc2 87/*
88 * Globals...
89 */
90
91VAR char *ConfigurationFile VALUE(NULL),
c41769ff
MS
92 /* cupsd.conf file to use */
93 *CupsFilesFile VALUE(NULL),
94 /* cups-files.conf file to use */
ef416fc2 95 *ServerName VALUE(NULL),
96 /* FQDN for server */
97 *ServerAdmin VALUE(NULL),
98 /* Administrator's email */
99 *ServerRoot VALUE(NULL),
100 /* Root directory for scheduler */
101 *ServerBin VALUE(NULL),
102 /* Root directory for binaries */
103 *StateDir VALUE(NULL),
104 /* Root directory for state data */
105 *RequestRoot VALUE(NULL),
106 /* Directory for request files */
107 *DocumentRoot VALUE(NULL);
108 /* Root directory for documents */
e07d4801
MS
109VAR cups_array_t *ServerAlias VALUE(NULL);
110 /* Alias names for server */
f11a948a 111VAR int ServerNameIsIP VALUE(0);
d1c13e16 112 /* Is the ServerName an IP address? */
ef416fc2 113VAR int NumSystemGroups VALUE(0);
114 /* Number of system group names */
ac884b6a
MS
115VAR char *SystemGroups[MAX_SYSTEM_GROUPS]
116 VALUE({0});
ef416fc2 117 /* System group names */
ac884b6a
MS
118VAR gid_t SystemGroupIDs[MAX_SYSTEM_GROUPS]
119 VALUE({0});
ef416fc2 120 /* System group IDs */
121VAR char *AccessLog VALUE(NULL),
122 /* Access log filename */
123 *ErrorLog VALUE(NULL),
124 /* Error log filename */
125 *PageLog VALUE(NULL),
126 /* Page log filename */
127 *CacheDir VALUE(NULL),
128 /* Cache file directory */
129 *DataDir VALUE(NULL),
130 /* Data file directory */
131 *DefaultLanguage VALUE(NULL),
132 /* Default language encoding */
ef416fc2 133 *DefaultLocale VALUE(NULL),
134 /* Default locale */
c5571a1d
MS
135 *DefaultPaperSize VALUE(NULL),
136 /* Default paper size */
323c5de1 137 *ErrorPolicy VALUE(NULL),
138 /* Default printer-error-policy */
ef416fc2 139 *RIPCache VALUE(NULL),
140 /* Amount of memory for RIPs */
141 *TempDir VALUE(NULL),
142 /* Temporary directory */
143 *Printcap VALUE(NULL),
144 /* Printcap file */
ef416fc2 145 *FontPath VALUE(NULL),
146 /* Font search path */
147 *RemoteRoot VALUE(NULL),
148 /* Remote root user */
149 *Classification VALUE(NULL);
150 /* Classification of system */
151VAR uid_t User VALUE(1);
152 /* User ID for server */
153VAR gid_t Group VALUE(0);
154 /* Group ID for server */
dfd5680b 155VAR cupsd_accesslog_t AccessLogLevel VALUE(CUPSD_ACCESSLOG_ACTIONS);
1f0275e3 156 /* Access log level */
dfd5680b 157VAR int ClassifyOverride VALUE(0),
ef416fc2 158 /* Allow overrides? */
159 ConfigFilePerm VALUE(0640),
160 /* Permissions for config files */
178cb736
MS
161 LogDebugHistory VALUE(200),
162 /* Amount of automatic debug history */
49d87452
MS
163 FatalErrors VALUE(CUPSD_FATAL_CONFIG),
164 /* Which errors are fatal? */
a29fd7dd
MS
165 StrictConformance VALUE(FALSE),
166 /* Require strict IPP conformance? */
f593fc1f 167 SyncOnClose VALUE(FALSE),
8a259669 168 /* Call fsync() when closing files? */
dfd5680b 169 LogFilePerm VALUE(0644);
ef416fc2 170 /* Permissions for log files */
dfd5680b 171VAR cupsd_loglevel_t LogLevel VALUE(CUPSD_LOG_WARN);
1f0275e3 172 /* Error log level */
dfd5680b
MS
173VAR cupsd_time_t LogTimeFormat VALUE(CUPSD_TIME_STANDARD);
174 /* Log file time format */
175VAR int MaxClients VALUE(100),
ef416fc2 176 /* Maximum number of clients */
177 MaxClientsPerHost VALUE(0),
178 /* Maximum number of clients per host */
f7deaa1a 179 MaxCopies VALUE(CUPS_DEFAULT_MAX_COPIES),
ef416fc2 180 /* Maximum number of copies per job */
181 MaxLogSize VALUE(1024 * 1024),
182 /* Maximum size of log files */
ef416fc2 183 MaxRequestSize VALUE(0),
184 /* Maximum size of IPP requests */
185 HostNameLookups VALUE(FALSE),
186 /* Do we do reverse lookups? */
187 Timeout VALUE(DEFAULT_TIMEOUT),
188 /* Timeout during requests */
189 KeepAlive VALUE(TRUE),
190 /* Support the Keep-Alive option? */
191 KeepAliveTimeout VALUE(DEFAULT_KEEPALIVE),
192 /* Timeout between requests */
ef416fc2 193 FileDevice VALUE(FALSE),
194 /* Allow file: devices? */
195 FilterLimit VALUE(0),
196 /* Max filter cost at any time */
197 FilterLevel VALUE(0),
198 /* Current filter level */
199 FilterNice VALUE(0),
200 /* Nice value for filters */
49d87452 201 ReloadTimeout VALUE(DEFAULT_KEEPALIVE),
ef416fc2 202 /* Timeout before reload from SIGHUP */
203 RootCertDuration VALUE(300),
204 /* Root certificate update interval */
ac884b6a
MS
205 RunUser VALUE(0),
206 /* User to run as, used for files */
fa73b229 207 PrintcapFormat VALUE(PRINTCAP_BSD),
ef416fc2 208 /* Format of printcap file? */
dfd5680b 209 DefaultShared VALUE(TRUE),
fa73b229 210 /* Share printers by default? */
229681c1 211 MultipleOperationTimeout VALUE(DEFAULT_TIMEOUT),
dfd5680b 212 /* multiple-operation-time-out value */
229681c1
MS
213 WebInterface VALUE(CUPS_DEFAULT_WEBIF);
214 /* Enable the web interface? */
ef416fc2 215VAR cups_file_t *AccessFile VALUE(NULL),
216 /* Access log file */
217 *ErrorFile VALUE(NULL),
218 /* Error log file */
219 *PageFile VALUE(NULL);
220 /* Page log file */
01ce6322
MS
221VAR char *PageLogFormat VALUE(NULL);
222 /* Page log format */
ef416fc2 223VAR mime_t *MimeDatabase VALUE(NULL);
224 /* MIME type database */
225VAR int NumMimeTypes VALUE(0);
226 /* Number of MIME types */
227VAR const char **MimeTypes VALUE(NULL);
228 /* Array of MIME types */
229
230#ifdef HAVE_SSL
724e1819 231# ifdef HAVE_GNUTLS
72d05bc9
MS
232VAR char *ServerCertificate VALUE(NULL),
233 /* Server certificate file */
234 *ServerKey VALUE(NULL);
ef416fc2 235 /* Server key file */
724e1819 236# endif /* HAVE_GNUTLS */
72d05bc9
MS
237VAR char *ServerKeychain VALUE(NULL);
238 /* Keychain holding cert + key */
ef416fc2 239#endif /* HAVE_SSL */
240
a4d04587 241#ifdef HAVE_LAUNCHD
dcb445bc 242VAR int LaunchdTimeout VALUE(10);
a4d04587 243 /* Time after which an idle cupsd will exit */
a4d04587 244#endif /* HAVE_LAUNCHD */
ef416fc2 245
f7deaa1a 246#ifdef HAVE_AUTHORIZATION_H
247VAR char *SystemGroupAuthKey VALUE(NULL);
248 /* System group auth key */
249#endif /* HAVE_AUTHORIZATION_H */
250
dcb445bc
MS
251#ifdef HAVE_GSSAPI
252VAR char *GSSServiceName VALUE(NULL);
253 /* GSS service name */
254int HaveServerCreds VALUE(0);
255 /* Do we have server credentials? */
256gss_cred_id_t ServerCreds; /* Server's GSS credentials */
257#endif /* HAVE_GSSAPI */
258
f7deaa1a 259
ef416fc2 260/*
261 * Prototypes...
262 */
263
e07d4801 264extern void cupsdAddAlias(cups_array_t *aliases, const char *name);
22c9029b 265extern int cupsdCheckLogFile(cups_file_t **lf, const char *logname);
b94498cf 266extern int cupsdCheckPermissions(const char *filename,
267 const char *suffix, int mode,
268 int user, int group, int is_dir,
269 int create_dir);
22c9029b 270extern int cupsdCheckProgram(const char *filename, cupsd_printer_t *p);
dcb445bc 271extern int cupsdDefaultAuthType(void);
e07d4801 272extern void cupsdFreeAliases(cups_array_t *aliases);
dfd5680b 273extern char *cupsdGetDateTime(struct timeval *t, cupsd_time_t format);
996acce8
MS
274extern int cupsdLogClient(cupsd_client_t *con, int level,
275 const char *message, ...)
276 __attribute__((__format__(__printf__, 3, 4)));
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/*
f2d18633 295 * End of "$Id$".
ef416fc2 296 */