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