]>
Commit | Line | Data |
---|---|---|
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 | * | |
1f0275e3 | 7 | * Copyright 2007-2008 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 | ||
22 | typedef 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 |
40 | typedef 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 | ||
ef416fc2 | 47 | |
49d87452 MS |
48 | /* |
49 | * FatalErrors flags... | |
50 | */ | |
51 | ||
52 | #define CUPSD_FATAL_NONE 0 /* No errors are fatal */ | |
53 | #define CUPSD_FATAL_BROWSE 1 /* Browse bind errors are fatal */ | |
54 | #define CUPSD_FATAL_CONFIG 2 /* Config file syntax errors are fatal */ | |
55 | #define CUPSD_FATAL_LISTEN 4 /* Listen/Port bind errors are fatal */ | |
56 | #define CUPSD_FATAL_LOG 8 /* Log file errors are fatal */ | |
57 | #define CUPSD_FATAL_PERMISSIONS 16 /* File permission errors are fatal */ | |
58 | #define CUPSD_FATAL_ALL ~0 /* All errors are fatal */ | |
59 | ||
60 | ||
ef416fc2 | 61 | /* |
62 | * Printcap formats... | |
63 | */ | |
64 | ||
f7deaa1a | 65 | #define PRINTCAP_BSD 0 /* Berkeley LPD format */ |
66 | #define PRINTCAP_SOLARIS 1 /* Solaris lpsched format */ | |
0af14961 | 67 | #define PRINTCAP_PLIST 2 /* Mac OS X plist format */ |
ef416fc2 | 68 | |
69 | ||
b19ccc9e MS |
70 | /* |
71 | * SSL options (bits)... | |
72 | */ | |
73 | ||
74 | #define CUPSD_SSL_NONE 0 /* No special options */ | |
75 | #define CUPSD_SSL_NOEMPTY 1 /* Do not insert empty fragments */ | |
76 | ||
77 | ||
ef416fc2 | 78 | /* |
79 | * Globals... | |
80 | */ | |
81 | ||
82 | VAR char *ConfigurationFile VALUE(NULL), | |
83 | /* Configuration file to use */ | |
84 | *ServerName VALUE(NULL), | |
85 | /* FQDN for server */ | |
86 | *ServerAdmin VALUE(NULL), | |
87 | /* Administrator's email */ | |
88 | *ServerRoot VALUE(NULL), | |
89 | /* Root directory for scheduler */ | |
90 | *ServerBin VALUE(NULL), | |
91 | /* Root directory for binaries */ | |
92 | *StateDir VALUE(NULL), | |
93 | /* Root directory for state data */ | |
94 | *RequestRoot VALUE(NULL), | |
95 | /* Directory for request files */ | |
96 | *DocumentRoot VALUE(NULL); | |
97 | /* Root directory for documents */ | |
d1c13e16 MS |
98 | VAR int RemoteAccessEnabled VALUE(0), |
99 | /* Are we listening on non-local addresses? */ | |
100 | ServerNameIsIP VALUE(0); | |
101 | /* Is the ServerName an IP address? */ | |
ef416fc2 | 102 | VAR int NumSystemGroups VALUE(0); |
103 | /* Number of system group names */ | |
ac884b6a MS |
104 | VAR char *SystemGroups[MAX_SYSTEM_GROUPS] |
105 | VALUE({0}); | |
ef416fc2 | 106 | /* System group names */ |
ac884b6a MS |
107 | VAR gid_t SystemGroupIDs[MAX_SYSTEM_GROUPS] |
108 | VALUE({0}); | |
ef416fc2 | 109 | /* System group IDs */ |
110 | VAR char *AccessLog VALUE(NULL), | |
111 | /* Access log filename */ | |
112 | *ErrorLog VALUE(NULL), | |
113 | /* Error log filename */ | |
114 | *PageLog VALUE(NULL), | |
115 | /* Page log filename */ | |
116 | *CacheDir VALUE(NULL), | |
117 | /* Cache file directory */ | |
118 | *DataDir VALUE(NULL), | |
119 | /* Data file directory */ | |
120 | *DefaultLanguage VALUE(NULL), | |
121 | /* Default language encoding */ | |
122 | *DefaultCharset VALUE(NULL), | |
123 | /* Default charset */ | |
124 | *DefaultLocale VALUE(NULL), | |
125 | /* Default locale */ | |
c5571a1d MS |
126 | *DefaultPaperSize VALUE(NULL), |
127 | /* Default paper size */ | |
323c5de1 | 128 | *ErrorPolicy VALUE(NULL), |
129 | /* Default printer-error-policy */ | |
ef416fc2 | 130 | *RIPCache VALUE(NULL), |
131 | /* Amount of memory for RIPs */ | |
132 | *TempDir VALUE(NULL), | |
133 | /* Temporary directory */ | |
134 | *Printcap VALUE(NULL), | |
135 | /* Printcap file */ | |
136 | *PrintcapGUI VALUE(NULL), | |
137 | /* GUI program to use for IRIX */ | |
138 | *FontPath VALUE(NULL), | |
139 | /* Font search path */ | |
140 | *RemoteRoot VALUE(NULL), | |
141 | /* Remote root user */ | |
142 | *Classification VALUE(NULL); | |
143 | /* Classification of system */ | |
f7deaa1a | 144 | #ifdef HAVE_GSSAPI |
145 | VAR char *GSSServiceName VALUE(NULL); | |
146 | /* GSS service name */ | |
147 | VAR char *Krb5Keytab VALUE(NULL); | |
148 | /* Kerberos Keytab */ | |
149 | #endif /* HAVE_GSSAPI */ | |
ef416fc2 | 150 | VAR uid_t User VALUE(1); |
151 | /* User ID for server */ | |
152 | VAR gid_t Group VALUE(0); | |
153 | /* Group ID for server */ | |
1f0275e3 MS |
154 | VAR int AccessLogLevel VALUE(CUPSD_ACCESSLOG_ACTIONS), |
155 | /* Access log level */ | |
156 | ClassifyOverride VALUE(0), | |
ef416fc2 | 157 | /* Allow overrides? */ |
158 | ConfigFilePerm VALUE(0640), | |
159 | /* Permissions for config files */ | |
49d87452 MS |
160 | FatalErrors VALUE(CUPSD_FATAL_CONFIG), |
161 | /* Which errors are fatal? */ | |
ef416fc2 | 162 | LogFilePerm VALUE(0644), |
163 | /* Permissions for log files */ | |
1f0275e3 MS |
164 | LogLevel VALUE(CUPSD_LOG_WARN), |
165 | /* Error log level */ | |
d1c13e16 | 166 | MaxClients VALUE(100), |
ef416fc2 | 167 | /* Maximum number of clients */ |
168 | MaxClientsPerHost VALUE(0), | |
169 | /* Maximum number of clients per host */ | |
f7deaa1a | 170 | MaxCopies VALUE(CUPS_DEFAULT_MAX_COPIES), |
ef416fc2 | 171 | /* Maximum number of copies per job */ |
172 | MaxLogSize VALUE(1024 * 1024), | |
173 | /* Maximum size of log files */ | |
174 | MaxPrinterHistory VALUE(10), | |
175 | /* Maximum printer state history */ | |
176 | MaxRequestSize VALUE(0), | |
177 | /* Maximum size of IPP requests */ | |
178 | HostNameLookups VALUE(FALSE), | |
179 | /* Do we do reverse lookups? */ | |
180 | Timeout VALUE(DEFAULT_TIMEOUT), | |
181 | /* Timeout during requests */ | |
182 | KeepAlive VALUE(TRUE), | |
183 | /* Support the Keep-Alive option? */ | |
184 | KeepAliveTimeout VALUE(DEFAULT_KEEPALIVE), | |
185 | /* Timeout between requests */ | |
186 | ImplicitClasses VALUE(TRUE), | |
187 | /* Are classes implicitly created? */ | |
188 | ImplicitAnyClasses VALUE(FALSE), | |
189 | /* Create AnyPrinter classes? */ | |
190 | HideImplicitMembers VALUE(TRUE), | |
191 | /* Hide implicit class members? */ | |
192 | FileDevice VALUE(FALSE), | |
193 | /* Allow file: devices? */ | |
194 | FilterLimit VALUE(0), | |
195 | /* Max filter cost at any time */ | |
196 | FilterLevel VALUE(0), | |
197 | /* Current filter level */ | |
198 | FilterNice VALUE(0), | |
199 | /* Nice value for filters */ | |
49d87452 | 200 | ReloadTimeout VALUE(DEFAULT_KEEPALIVE), |
ef416fc2 | 201 | /* Timeout before reload from SIGHUP */ |
202 | RootCertDuration VALUE(300), | |
203 | /* Root certificate update interval */ | |
ac884b6a MS |
204 | RunUser VALUE(0), |
205 | /* User to run as, used for files */ | |
fa73b229 | 206 | PrintcapFormat VALUE(PRINTCAP_BSD), |
ef416fc2 | 207 | /* Format of printcap file? */ |
fa73b229 | 208 | DefaultShared VALUE(TRUE); |
209 | /* Share printers by default? */ | |
ef416fc2 | 210 | VAR cups_file_t *AccessFile VALUE(NULL), |
211 | /* Access log file */ | |
212 | *ErrorFile VALUE(NULL), | |
213 | /* Error log file */ | |
214 | *PageFile VALUE(NULL); | |
215 | /* Page log file */ | |
01ce6322 MS |
216 | VAR char *PageLogFormat VALUE(NULL); |
217 | /* Page log format */ | |
ef416fc2 | 218 | VAR mime_t *MimeDatabase VALUE(NULL); |
219 | /* MIME type database */ | |
220 | VAR int NumMimeTypes VALUE(0); | |
221 | /* Number of MIME types */ | |
222 | VAR const char **MimeTypes VALUE(NULL); | |
223 | /* Array of MIME types */ | |
224 | ||
225 | #ifdef HAVE_SSL | |
226 | VAR char *ServerCertificate VALUE(NULL); | |
227 | /* Server certificate file */ | |
228 | # if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS) | |
229 | VAR char *ServerKey VALUE(NULL); | |
230 | /* Server key file */ | |
ef416fc2 | 231 | # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ |
b19ccc9e MS |
232 | VAR int SSLOptions VALUE(CUPSD_SSL_NONE); |
233 | /* SSL/TLS options */ | |
ef416fc2 | 234 | #endif /* HAVE_SSL */ |
235 | ||
a4d04587 | 236 | #ifdef HAVE_LAUNCHD |
49d87452 | 237 | VAR int LaunchdTimeout VALUE(DEFAULT_KEEPALIVE); |
a4d04587 | 238 | /* Time after which an idle cupsd will exit */ |
239 | VAR char *LaunchdConf VALUE(NULL); | |
240 | /* launchd(8) configuration file */ | |
241 | #endif /* HAVE_LAUNCHD */ | |
ef416fc2 | 242 | |
7594b224 | 243 | #ifdef __APPLE__ |
244 | VAR int AppleQuotas VALUE(TRUE); | |
245 | /* Use Apple PrintService Quotas instead of CUPS quotas */ | |
246 | #endif /* __APPLE__ */ | |
247 | ||
f7deaa1a | 248 | #ifdef HAVE_AUTHORIZATION_H |
249 | VAR char *SystemGroupAuthKey VALUE(NULL); | |
250 | /* System group auth key */ | |
251 | #endif /* HAVE_AUTHORIZATION_H */ | |
252 | ||
253 | ||
ef416fc2 | 254 | /* |
255 | * Prototypes... | |
256 | */ | |
257 | ||
b94498cf | 258 | extern int cupsdCheckPermissions(const char *filename, |
259 | const char *suffix, int mode, | |
260 | int user, int group, int is_dir, | |
261 | int create_dir); | |
ef416fc2 | 262 | extern char *cupsdGetDateTime(time_t t); |
f7deaa1a | 263 | #ifdef HAVE_GSSAPI |
264 | extern int cupsdLogGSSMessage(int level, int major_status, | |
265 | int minor_status, | |
266 | const char *message, ...); | |
267 | #endif /* HAVE_GSSAPI */ | |
75bd9771 MS |
268 | extern int cupsdLogJob(cupsd_job_t *job, int level, const char *message, ...) |
269 | #ifdef __GNUC__ | |
270 | __attribute__ ((__format__ (__printf__, 3, 4))) | |
271 | #endif /* __GNUC__ */ | |
272 | ; | |
ef416fc2 | 273 | extern int cupsdLogMessage(int level, const char *message, ...) |
274 | #ifdef __GNUC__ | |
275 | __attribute__ ((__format__ (__printf__, 2, 3))) | |
276 | #endif /* __GNUC__ */ | |
277 | ; | |
278 | extern int cupsdLogPage(cupsd_job_t *job, const char *page); | |
f7deaa1a | 279 | extern int cupsdLogRequest(cupsd_client_t *con, http_status_t code); |
b94498cf | 280 | extern int cupsdReadConfiguration(void); |
75bd9771 | 281 | extern int cupsdWriteErrorLog(int level, const char *message); |
ef416fc2 | 282 | |
283 | ||
284 | /* | |
b19ccc9e | 285 | * End of "$Id: conf.h 7935 2008-09-11 01:54:11Z mike $". |
ef416fc2 | 286 | */ |