]>
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 | * | |
dfd5680b | 7 | * Copyright 2007-2009 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 | ||
dfd5680b MS |
47 | typedef 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 */ | |
0af14961 | 73 | #define PRINTCAP_PLIST 2 /* Mac OS X plist format */ |
ef416fc2 | 74 | |
75 | ||
b19ccc9e MS |
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 | ||
e07d4801 MS |
84 | /* |
85 | * ServerAlias data... | |
86 | */ | |
87 | ||
88 | typedef struct | |
89 | { | |
90 | size_t namelen; /* Length of alias name */ | |
91 | char name[1]; /* Alias name */ | |
92 | } cupsd_alias_t; | |
93 | ||
94 | ||
ef416fc2 | 95 | /* |
96 | * Globals... | |
97 | */ | |
98 | ||
99 | VAR char *ConfigurationFile VALUE(NULL), | |
100 | /* Configuration file to use */ | |
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 |
115 | VAR cups_array_t *ServerAlias VALUE(NULL); |
116 | /* Alias names for server */ | |
f11a948a | 117 | VAR int ServerNameIsIP VALUE(0); |
d1c13e16 | 118 | /* Is the ServerName an IP address? */ |
ef416fc2 | 119 | VAR int NumSystemGroups VALUE(0); |
120 | /* Number of system group names */ | |
ac884b6a MS |
121 | VAR char *SystemGroups[MAX_SYSTEM_GROUPS] |
122 | VALUE({0}); | |
ef416fc2 | 123 | /* System group names */ |
ac884b6a MS |
124 | VAR gid_t SystemGroupIDs[MAX_SYSTEM_GROUPS] |
125 | VALUE({0}); | |
ef416fc2 | 126 | /* System group IDs */ |
127 | VAR 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 */ | |
139 | *DefaultCharset VALUE(NULL), | |
140 | /* Default charset */ | |
141 | *DefaultLocale VALUE(NULL), | |
142 | /* Default locale */ | |
c5571a1d MS |
143 | *DefaultPaperSize VALUE(NULL), |
144 | /* Default paper size */ | |
323c5de1 | 145 | *ErrorPolicy VALUE(NULL), |
146 | /* Default printer-error-policy */ | |
ef416fc2 | 147 | *RIPCache VALUE(NULL), |
148 | /* Amount of memory for RIPs */ | |
149 | *TempDir VALUE(NULL), | |
150 | /* Temporary directory */ | |
151 | *Printcap VALUE(NULL), | |
152 | /* Printcap file */ | |
153 | *PrintcapGUI VALUE(NULL), | |
154 | /* GUI program to use for IRIX */ | |
155 | *FontPath VALUE(NULL), | |
156 | /* Font search path */ | |
157 | *RemoteRoot VALUE(NULL), | |
158 | /* Remote root user */ | |
159 | *Classification VALUE(NULL); | |
160 | /* Classification of system */ | |
161 | VAR uid_t User VALUE(1); | |
162 | /* User ID for server */ | |
163 | VAR gid_t Group VALUE(0); | |
164 | /* Group ID for server */ | |
dfd5680b | 165 | VAR cupsd_accesslog_t AccessLogLevel VALUE(CUPSD_ACCESSLOG_ACTIONS); |
1f0275e3 | 166 | /* Access log level */ |
dfd5680b | 167 | VAR int ClassifyOverride VALUE(0), |
ef416fc2 | 168 | /* Allow overrides? */ |
169 | ConfigFilePerm VALUE(0640), | |
170 | /* Permissions for config files */ | |
178cb736 MS |
171 | LogDebugHistory VALUE(200), |
172 | /* Amount of automatic debug history */ | |
49d87452 MS |
173 | FatalErrors VALUE(CUPSD_FATAL_CONFIG), |
174 | /* Which errors are fatal? */ | |
dfd5680b | 175 | LogFilePerm VALUE(0644); |
ef416fc2 | 176 | /* Permissions for log files */ |
dfd5680b | 177 | VAR cupsd_loglevel_t LogLevel VALUE(CUPSD_LOG_WARN); |
1f0275e3 | 178 | /* Error log level */ |
dfd5680b MS |
179 | VAR cupsd_time_t LogTimeFormat VALUE(CUPSD_TIME_STANDARD); |
180 | /* Log file time format */ | |
181 | VAR int MaxClients VALUE(100), | |
ef416fc2 | 182 | /* Maximum number of clients */ |
183 | MaxClientsPerHost VALUE(0), | |
184 | /* Maximum number of clients per host */ | |
f7deaa1a | 185 | MaxCopies VALUE(CUPS_DEFAULT_MAX_COPIES), |
ef416fc2 | 186 | /* Maximum number of copies per job */ |
187 | MaxLogSize VALUE(1024 * 1024), | |
188 | /* Maximum size of log files */ | |
189 | MaxPrinterHistory VALUE(10), | |
190 | /* Maximum printer state history */ | |
191 | MaxRequestSize VALUE(0), | |
192 | /* Maximum size of IPP requests */ | |
193 | HostNameLookups VALUE(FALSE), | |
194 | /* Do we do reverse lookups? */ | |
195 | Timeout VALUE(DEFAULT_TIMEOUT), | |
196 | /* Timeout during requests */ | |
197 | KeepAlive VALUE(TRUE), | |
198 | /* Support the Keep-Alive option? */ | |
199 | KeepAliveTimeout VALUE(DEFAULT_KEEPALIVE), | |
200 | /* Timeout between requests */ | |
201 | ImplicitClasses VALUE(TRUE), | |
202 | /* Are classes implicitly created? */ | |
203 | ImplicitAnyClasses VALUE(FALSE), | |
204 | /* Create AnyPrinter classes? */ | |
205 | HideImplicitMembers VALUE(TRUE), | |
206 | /* Hide implicit class members? */ | |
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 */ | |
ac884b6a MS |
219 | RunUser VALUE(0), |
220 | /* User to run as, used for files */ | |
fa73b229 | 221 | PrintcapFormat VALUE(PRINTCAP_BSD), |
ef416fc2 | 222 | /* Format of printcap file? */ |
dfd5680b | 223 | DefaultShared VALUE(TRUE), |
fa73b229 | 224 | /* Share printers by default? */ |
dfd5680b MS |
225 | MultipleOperationTimeout VALUE(DEFAULT_TIMEOUT); |
226 | /* multiple-operation-time-out value */ | |
ef416fc2 | 227 | VAR 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 |
233 | VAR char *PageLogFormat VALUE(NULL); |
234 | /* Page log format */ | |
ef416fc2 | 235 | VAR mime_t *MimeDatabase VALUE(NULL); |
236 | /* MIME type database */ | |
237 | VAR int NumMimeTypes VALUE(0); | |
238 | /* Number of MIME types */ | |
239 | VAR const char **MimeTypes VALUE(NULL); | |
240 | /* Array of MIME types */ | |
241 | ||
242 | #ifdef HAVE_SSL | |
243 | VAR char *ServerCertificate VALUE(NULL); | |
244 | /* Server certificate file */ | |
245 | # if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS) | |
246 | VAR char *ServerKey VALUE(NULL); | |
247 | /* Server key file */ | |
ef416fc2 | 248 | # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ |
b19ccc9e MS |
249 | VAR int SSLOptions VALUE(CUPSD_SSL_NONE); |
250 | /* SSL/TLS options */ | |
ef416fc2 | 251 | #endif /* HAVE_SSL */ |
252 | ||
a4d04587 | 253 | #ifdef HAVE_LAUNCHD |
49d87452 | 254 | VAR int LaunchdTimeout VALUE(DEFAULT_KEEPALIVE); |
a4d04587 | 255 | /* Time after which an idle cupsd will exit */ |
256 | VAR char *LaunchdConf VALUE(NULL); | |
257 | /* launchd(8) configuration file */ | |
258 | #endif /* HAVE_LAUNCHD */ | |
ef416fc2 | 259 | |
7594b224 | 260 | #ifdef __APPLE__ |
261 | VAR int AppleQuotas VALUE(TRUE); | |
262 | /* Use Apple PrintService Quotas instead of CUPS quotas */ | |
263 | #endif /* __APPLE__ */ | |
264 | ||
f7deaa1a | 265 | #ifdef HAVE_AUTHORIZATION_H |
266 | VAR char *SystemGroupAuthKey VALUE(NULL); | |
267 | /* System group auth key */ | |
268 | #endif /* HAVE_AUTHORIZATION_H */ | |
269 | ||
270 | ||
ef416fc2 | 271 | /* |
272 | * Prototypes... | |
273 | */ | |
274 | ||
e07d4801 | 275 | extern void cupsdAddAlias(cups_array_t *aliases, const char *name); |
b94498cf | 276 | extern int cupsdCheckPermissions(const char *filename, |
277 | const char *suffix, int mode, | |
278 | int user, int group, int is_dir, | |
279 | int create_dir); | |
e07d4801 | 280 | extern void cupsdFreeAliases(cups_array_t *aliases); |
dfd5680b | 281 | extern char *cupsdGetDateTime(struct timeval *t, cupsd_time_t format); |
f7deaa1a | 282 | #ifdef HAVE_GSSAPI |
283 | extern int cupsdLogGSSMessage(int level, int major_status, | |
284 | int minor_status, | |
285 | const char *message, ...); | |
286 | #endif /* HAVE_GSSAPI */ | |
75bd9771 MS |
287 | extern int cupsdLogJob(cupsd_job_t *job, int level, const char *message, ...) |
288 | #ifdef __GNUC__ | |
289 | __attribute__ ((__format__ (__printf__, 3, 4))) | |
290 | #endif /* __GNUC__ */ | |
291 | ; | |
ef416fc2 | 292 | extern int cupsdLogMessage(int level, const char *message, ...) |
293 | #ifdef __GNUC__ | |
294 | __attribute__ ((__format__ (__printf__, 2, 3))) | |
295 | #endif /* __GNUC__ */ | |
296 | ; | |
297 | extern int cupsdLogPage(cupsd_job_t *job, const char *page); | |
f7deaa1a | 298 | extern int cupsdLogRequest(cupsd_client_t *con, http_status_t code); |
b94498cf | 299 | extern int cupsdReadConfiguration(void); |
75bd9771 | 300 | extern int cupsdWriteErrorLog(int level, const char *message); |
ef416fc2 | 301 | |
302 | ||
303 | /* | |
b19ccc9e | 304 | * End of "$Id: conf.h 7935 2008-09-11 01:54:11Z mike $". |
ef416fc2 | 305 | */ |