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