]> git.ipfire.org Git - thirdparty/cups.git/blame - scheduler/conf.h
Move file, directory, user, and group configuration to a separate file
[thirdparty/cups.git] / scheduler / conf.h
CommitLineData
a129ddbd 1/*
c9d3f842 2 * "$Id$"
a129ddbd 3 *
64252c8e 4 * Configuration file definitions for the CUPS scheduler.
a129ddbd 5 *
c45401bb 6 * Copyright 2007-2012 by Apple Inc.
bb3ff448 7 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
a129ddbd 8 *
9 * These coded instructions, statements, and computer programs are the
4e8d321f 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/".
a129ddbd 14 */
15
dcfcaeac 16
a129ddbd 17/*
fd8b1cf8 18 * Log levels...
19 */
20
f3e786fc 21typedef enum
22{
4ab5ee04 23 CUPSD_LOG_PPD = -5, /* Used internally for PPD keywords */
dab136f6 24 CUPSD_LOG_ATTR, /* Used internally for attributes */
4ab5ee04 25 CUPSD_LOG_STATE, /* Used internally for printer-state-reasons */
26 CUPSD_LOG_JOBSTATE, /* Used internally for job-state-reasons */
2344229d 27 CUPSD_LOG_PAGE, /* Used internally for page logging */
f3e786fc 28 CUPSD_LOG_NONE,
2344229d 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 */
f3e786fc 38} cupsd_loglevel_t;
fd8b1cf8 39
e1606ecf 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
aac31a83 47typedef enum
48{
49 CUPSD_TIME_STANDARD, /* "Standard" Apache/CLF format */
50 CUPSD_TIME_USECS /* Standard format with microseconds */
51} cupsd_time_t;
52
fd8b1cf8 53
32cbd90e 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
7efb04c8 67/*
68 * Printcap formats...
69 */
70
2344229d 71#define PRINTCAP_BSD 0 /* Berkeley LPD format */
72#define PRINTCAP_SOLARIS 1 /* Solaris lpsched format */
c45401bb 73#define PRINTCAP_PLIST 2 /* OS X plist format */
7efb04c8 74
75
1a1622bd 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
96f8a53a 84/*
85 * ServerAlias data...
86 */
87
88typedef struct
89{
90 size_t namelen; /* Length of alias name */
91 char name[1]; /* Alias name */
92} cupsd_alias_t;
93
94
fd8b1cf8 95/*
96 * Globals...
97 */
98
36992080 99VAR char *ConfigurationFile VALUE(NULL),
6b21a4ce 100 /* cupsd.conf file to use */
101 *CupsFilesFile VALUE(NULL),
102 /* cups-files.conf file to use */
36992080 103 *ServerName VALUE(NULL),
fd8b1cf8 104 /* FQDN for server */
36992080 105 *ServerAdmin VALUE(NULL),
fd8b1cf8 106 /* Administrator's email */
36992080 107 *ServerRoot VALUE(NULL),
fd8b1cf8 108 /* Root directory for scheduler */
36992080 109 *ServerBin VALUE(NULL),
bd84e0d1 110 /* Root directory for binaries */
d4102150 111 *StateDir VALUE(NULL),
112 /* Root directory for state data */
36992080 113 *RequestRoot VALUE(NULL),
bd84e0d1 114 /* Directory for request files */
36992080 115 *DocumentRoot VALUE(NULL);
fd8b1cf8 116 /* Root directory for documents */
96f8a53a 117VAR cups_array_t *ServerAlias VALUE(NULL);
118 /* Alias names for server */
588cda83 119VAR int ServerNameIsIP VALUE(0);
975fe9a4 120 /* Is the ServerName an IP address? */
753453e4 121VAR int NumSystemGroups VALUE(0);
122 /* Number of system group names */
40c139b1 123VAR char *SystemGroups[MAX_SYSTEM_GROUPS]
124 VALUE({0});
753453e4 125 /* System group names */
40c139b1 126VAR gid_t SystemGroupIDs[MAX_SYSTEM_GROUPS]
127 VALUE({0});
e9a798a1 128 /* System group IDs */
129VAR char *AccessLog VALUE(NULL),
fd8b1cf8 130 /* Access log filename */
36992080 131 *ErrorLog VALUE(NULL),
fd8b1cf8 132 /* Error log filename */
36992080 133 *PageLog VALUE(NULL),
c7fa9d06 134 /* Page log filename */
9d0c9f28 135 *CacheDir VALUE(NULL),
136 /* Cache file directory */
36992080 137 *DataDir VALUE(NULL),
df3f73ff 138 /* Data file directory */
36992080 139 *DefaultLanguage VALUE(NULL),
fd8b1cf8 140 /* Default language encoding */
08c0ff15 141 *DefaultLocale VALUE(NULL),
142 /* Default locale */
85fe2342 143 *DefaultPaperSize VALUE(NULL),
144 /* Default paper size */
adbfe628 145 *ErrorPolicy VALUE(NULL),
146 /* Default printer-error-policy */
36992080 147 *RIPCache VALUE(NULL),
7f0679f5 148 /* Amount of memory for RIPs */
36992080 149 *TempDir VALUE(NULL),
7f0679f5 150 /* Temporary directory */
36992080 151 *Printcap VALUE(NULL),
03081fd2 152 /* Printcap file */
36992080 153 *FontPath VALUE(NULL),
7517e57e 154 /* Font search path */
36992080 155 *RemoteRoot VALUE(NULL),
d74efa25 156 /* Remote root user */
36992080 157 *Classification VALUE(NULL);
d11458ff 158 /* Classification of system */
4342fddc 159VAR uid_t User VALUE(1);
160 /* User ID for server */
161VAR gid_t Group VALUE(0);
162 /* Group ID for server */
aac31a83 163VAR cupsd_accesslog_t AccessLogLevel VALUE(CUPSD_ACCESSLOG_ACTIONS);
e1606ecf 164 /* Access log level */
aac31a83 165VAR int ClassifyOverride VALUE(0),
753453e4 166 /* Allow overrides? */
e9a798a1 167 ConfigFilePerm VALUE(0640),
415199da 168 /* Permissions for config files */
34e385a0 169 LogDebugHistory VALUE(200),
170 /* Amount of automatic debug history */
32cbd90e 171 FatalErrors VALUE(CUPSD_FATAL_CONFIG),
172 /* Which errors are fatal? */
648baa44 173 StrictConformance VALUE(FALSE),
174 /* Require strict IPP conformance? */
57c2821d 175 LogFilePerm VALUE(0644);
415199da 176 /* Permissions for log files */
57c2821d 177VAR cupsd_loglevel_t LogLevel VALUE(CUPSD_LOG_WARN);
e1606ecf 178 /* Error log level */
aac31a83 179VAR cupsd_time_t LogTimeFormat VALUE(CUPSD_TIME_STANDARD);
180 /* Log file time format */
181VAR int MaxClients VALUE(100),
997edb40 182 /* Maximum number of clients */
1060c9b6 183 MaxClientsPerHost VALUE(0),
184 /* Maximum number of clients per host */
38617900 185 MaxCopies VALUE(CUPS_DEFAULT_MAX_COPIES),
da956953 186 /* Maximum number of copies per job */
bd176c9c 187 MaxLogSize VALUE(1024 * 1024),
188 /* Maximum size of log files */
189 MaxRequestSize VALUE(0),
190 /* Maximum size of IPP requests */
5ff9dbae 191 HostNameLookups VALUE(FALSE),
fd8b1cf8 192 /* Do we do reverse lookups? */
5ff9dbae 193 Timeout VALUE(DEFAULT_TIMEOUT),
fd8b1cf8 194 /* Timeout during requests */
5ff9dbae 195 KeepAlive VALUE(TRUE),
fd8b1cf8 196 /* Support the Keep-Alive option? */
5ff9dbae 197 KeepAliveTimeout VALUE(DEFAULT_KEEPALIVE),
fd8b1cf8 198 /* Timeout between requests */
f63a430f 199 FileDevice VALUE(FALSE),
200 /* Allow file: devices? */
8239f206 201 FilterLimit VALUE(0),
202 /* Max filter cost at any time */
89db771d 203 FilterLevel VALUE(0),
8239f206 204 /* Current filter level */
42ede8a2 205 FilterNice VALUE(0),
206 /* Nice value for filters */
e8b96e56 207 ReloadTimeout VALUE(DEFAULT_KEEPALIVE),
bcd9e019 208 /* Timeout before reload from SIGHUP */
d9e72533 209 RootCertDuration VALUE(300),
210 /* Root certificate update interval */
40c139b1 211 RunUser VALUE(0),
212 /* User to run as, used for files */
d8c5c16f 213 PrintcapFormat VALUE(PRINTCAP_BSD),
7efb04c8 214 /* Format of printcap file? */
8bd13c30 215 DefaultShared VALUE(TRUE),
d8c5c16f 216 /* Share printers by default? */
02a87a41 217 MultipleOperationTimeout VALUE(DEFAULT_TIMEOUT),
8bd13c30 218 /* multiple-operation-time-out value */
388240f9 219 WebInterface VALUE(CUPS_DEFAULT_WEBIF);
02a87a41 220 /* Enable the web interface? */
7b0fde61 221VAR cups_file_t *AccessFile VALUE(NULL),
fd8b1cf8 222 /* Access log file */
c7fa9d06 223 *ErrorFile VALUE(NULL),
fd8b1cf8 224 /* Error log file */
c7fa9d06 225 *PageFile VALUE(NULL);
226 /* Page log file */
e1018101 227VAR char *PageLogFormat VALUE(NULL);
228 /* Page log format */
5ff9dbae 229VAR mime_t *MimeDatabase VALUE(NULL);
c7fa9d06 230 /* MIME type database */
753453e4 231VAR int NumMimeTypes VALUE(0);
232 /* Number of MIME types */
233VAR const char **MimeTypes VALUE(NULL);
234 /* Array of MIME types */
fd8b1cf8 235
bcf61448 236#ifdef HAVE_SSL
1a525eea 237VAR char *ServerCertificate VALUE(NULL);
a75c006a 238 /* Server certificate file */
1a525eea 239# if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS)
240VAR char *ServerKey VALUE(NULL);
a75c006a 241 /* Server key file */
1a525eea 242# endif /* HAVE_LIBSSL || HAVE_GNUTLS */
1a1622bd 243VAR int SSLOptions VALUE(CUPSD_SSL_NONE);
244 /* SSL/TLS options */
1a525eea 245#endif /* HAVE_SSL */
a75c006a 246
5db6985b 247#ifdef HAVE_LAUNCHD
869fdb3c 248VAR int LaunchdTimeout VALUE(10);
5db6985b 249 /* Time after which an idle cupsd will exit */
5db6985b 250#endif /* HAVE_LAUNCHD */
fd8b1cf8 251
753db4fd 252#ifdef HAVE_AUTHORIZATION_H
253VAR char *SystemGroupAuthKey VALUE(NULL);
254 /* System group auth key */
255#endif /* HAVE_AUTHORIZATION_H */
256
f780c436 257#ifdef HAVE_GSSAPI
258VAR char *GSSServiceName VALUE(NULL);
259 /* GSS service name */
260int HaveServerCreds VALUE(0);
261 /* Do we have server credentials? */
262gss_cred_id_t ServerCreds; /* Server's GSS credentials */
263#endif /* HAVE_GSSAPI */
264
753db4fd 265
fd8b1cf8 266/*
267 * Prototypes...
a129ddbd 268 */
269
96f8a53a 270extern void cupsdAddAlias(cups_array_t *aliases, const char *name);
faac60be 271extern int cupsdCheckLogFile(cups_file_t **lf, const char *logname);
df2c601d 272extern int cupsdCheckPermissions(const char *filename,
273 const char *suffix, int mode,
274 int user, int group, int is_dir,
275 int create_dir);
4da94667 276extern int cupsdCheckProgram(const char *filename, cupsd_printer_t *p);
f780c436 277extern int cupsdDefaultAuthType(void);
96f8a53a 278extern void cupsdFreeAliases(cups_array_t *aliases);
aac31a83 279extern char *cupsdGetDateTime(struct timeval *t, cupsd_time_t format);
18b640e4 280extern void cupsdLogFCMessage(void *context, _cups_fc_result_t result,
281 const char *message);
cf94bcb1 282#ifdef HAVE_GSSAPI
283extern int cupsdLogGSSMessage(int level, int major_status,
284 int minor_status,
285 const char *message, ...);
286#endif /* HAVE_GSSAPI */
1cad5897 287extern int cupsdLogJob(cupsd_job_t *job, int level, const char *message,
288 ...) __attribute__((__format__(__printf__, 3, 4)));
589eb420 289extern int cupsdLogMessage(int level, const char *message, ...)
1cad5897 290 __attribute__ ((__format__ (__printf__, 2, 3)));
589eb420 291extern int cupsdLogPage(cupsd_job_t *job, const char *page);
cf94bcb1 292extern int cupsdLogRequest(cupsd_client_t *con, http_status_t code);
df2c601d 293extern int cupsdReadConfiguration(void);
e31a6d57 294extern int cupsdWriteErrorLog(int level, const char *message);
a129ddbd 295
296
297/*
c9d3f842 298 * End of "$Id$".
a129ddbd 299 */