]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * "$Id$" | |
3 | * | |
4 | * Configuration file definitions for the CUPS scheduler. | |
5 | * | |
6 | * Copyright 2007-2014 by Apple Inc. | |
7 | * Copyright 1997-2007 by Easy Software Products, all rights reserved. | |
8 | * | |
9 | * These coded instructions, statements, and computer programs are the | |
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/". | |
14 | */ | |
15 | ||
16 | ||
17 | /* | |
18 | * Log levels... | |
19 | */ | |
20 | ||
21 | typedef enum | |
22 | { | |
23 | CUPSD_LOG_PPD = -5, /* Used internally for PPD keywords */ | |
24 | CUPSD_LOG_ATTR, /* Used internally for attributes */ | |
25 | CUPSD_LOG_STATE, /* Used internally for printer-state-reasons */ | |
26 | CUPSD_LOG_JOBSTATE, /* Used internally for job-state-reasons */ | |
27 | CUPSD_LOG_PAGE, /* Used internally for page logging */ | |
28 | CUPSD_LOG_NONE, | |
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 */ | |
38 | } cupsd_loglevel_t; | |
39 | ||
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 | ||
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 | ||
53 | ||
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 | ||
67 | /* | |
68 | * Printcap formats... | |
69 | */ | |
70 | ||
71 | #define PRINTCAP_BSD 0 /* Berkeley LPD format */ | |
72 | #define PRINTCAP_SOLARIS 1 /* Solaris lpsched format */ | |
73 | #define PRINTCAP_PLIST 2 /* OS X plist format */ | |
74 | ||
75 | ||
76 | /* | |
77 | * ServerAlias data... | |
78 | */ | |
79 | ||
80 | typedef struct | |
81 | { | |
82 | size_t namelen; /* Length of alias name */ | |
83 | char name[1]; /* Alias name */ | |
84 | } cupsd_alias_t; | |
85 | ||
86 | ||
87 | /* | |
88 | * Globals... | |
89 | */ | |
90 | ||
91 | VAR char *ConfigurationFile VALUE(NULL), | |
92 | /* cupsd.conf file to use */ | |
93 | *CupsFilesFile VALUE(NULL), | |
94 | /* cups-files.conf file to use */ | |
95 | *ServerName VALUE(NULL), | |
96 | /* FQDN for server */ | |
97 | *ServerAdmin VALUE(NULL), | |
98 | /* Administrator's email */ | |
99 | *ServerRoot VALUE(NULL), | |
100 | /* Root directory for scheduler */ | |
101 | *ServerBin VALUE(NULL), | |
102 | /* Root directory for binaries */ | |
103 | *StateDir VALUE(NULL), | |
104 | /* Root directory for state data */ | |
105 | *RequestRoot VALUE(NULL), | |
106 | /* Directory for request files */ | |
107 | *DocumentRoot VALUE(NULL); | |
108 | /* Root directory for documents */ | |
109 | VAR cups_array_t *ServerAlias VALUE(NULL); | |
110 | /* Alias names for server */ | |
111 | VAR int ServerNameIsIP VALUE(0); | |
112 | /* Is the ServerName an IP address? */ | |
113 | VAR int NumSystemGroups VALUE(0); | |
114 | /* Number of system group names */ | |
115 | VAR char *SystemGroups[MAX_SYSTEM_GROUPS] | |
116 | VALUE({0}); | |
117 | /* System group names */ | |
118 | VAR gid_t SystemGroupIDs[MAX_SYSTEM_GROUPS] | |
119 | VALUE({0}); | |
120 | /* System group IDs */ | |
121 | VAR char *AccessLog VALUE(NULL), | |
122 | /* Access log filename */ | |
123 | *ErrorLog VALUE(NULL), | |
124 | /* Error log filename */ | |
125 | *PageLog VALUE(NULL), | |
126 | /* Page log filename */ | |
127 | *CacheDir VALUE(NULL), | |
128 | /* Cache file directory */ | |
129 | *DataDir VALUE(NULL), | |
130 | /* Data file directory */ | |
131 | *DefaultLanguage VALUE(NULL), | |
132 | /* Default language encoding */ | |
133 | *DefaultLocale VALUE(NULL), | |
134 | /* Default locale */ | |
135 | *DefaultPaperSize VALUE(NULL), | |
136 | /* Default paper size */ | |
137 | *ErrorPolicy VALUE(NULL), | |
138 | /* Default printer-error-policy */ | |
139 | *RIPCache VALUE(NULL), | |
140 | /* Amount of memory for RIPs */ | |
141 | *TempDir VALUE(NULL), | |
142 | /* Temporary directory */ | |
143 | *Printcap VALUE(NULL), | |
144 | /* Printcap file */ | |
145 | *FontPath VALUE(NULL), | |
146 | /* Font search path */ | |
147 | *RemoteRoot VALUE(NULL), | |
148 | /* Remote root user */ | |
149 | *Classification VALUE(NULL); | |
150 | /* Classification of system */ | |
151 | VAR uid_t User VALUE(1), | |
152 | /* User ID for server */ | |
153 | RunUser VALUE(0); | |
154 | /* User to run as, used for files */ | |
155 | VAR gid_t Group VALUE(0); | |
156 | /* Group ID for server */ | |
157 | VAR cupsd_accesslog_t AccessLogLevel VALUE(CUPSD_ACCESSLOG_ACTIONS); | |
158 | /* Access log level */ | |
159 | VAR int ClassifyOverride VALUE(0), | |
160 | /* Allow overrides? */ | |
161 | LogDebugHistory VALUE(200), | |
162 | /* Amount of automatic debug history */ | |
163 | FatalErrors VALUE(CUPSD_FATAL_CONFIG), | |
164 | /* Which errors are fatal? */ | |
165 | StrictConformance VALUE(FALSE), | |
166 | /* Require strict IPP conformance? */ | |
167 | SyncOnClose VALUE(FALSE); | |
168 | /* Call fsync() when closing files? */ | |
169 | VAR mode_t ConfigFilePerm VALUE(0640U), | |
170 | /* Permissions for config files */ | |
171 | LogFilePerm VALUE(0644U); | |
172 | /* Permissions for log files */ | |
173 | VAR cupsd_loglevel_t LogLevel VALUE(CUPSD_LOG_WARN); | |
174 | /* Error log level */ | |
175 | VAR cupsd_time_t LogTimeFormat VALUE(CUPSD_TIME_STANDARD); | |
176 | /* Log file time format */ | |
177 | VAR int MaxClients VALUE(100), | |
178 | /* Maximum number of clients */ | |
179 | MaxClientsPerHost VALUE(0), | |
180 | /* Maximum number of clients per host */ | |
181 | MaxCopies VALUE(CUPS_DEFAULT_MAX_COPIES), | |
182 | /* Maximum number of copies per job */ | |
183 | MaxLogSize VALUE(1024 * 1024), | |
184 | /* Maximum size of log files */ | |
185 | MaxRequestSize VALUE(0), | |
186 | /* Maximum size of IPP requests */ | |
187 | HostNameLookups VALUE(FALSE), | |
188 | /* Do we do reverse lookups? */ | |
189 | Timeout VALUE(DEFAULT_TIMEOUT), | |
190 | /* Timeout during requests */ | |
191 | KeepAlive VALUE(TRUE), | |
192 | /* Support the Keep-Alive option? */ | |
193 | KeepAliveTimeout VALUE(DEFAULT_KEEPALIVE), | |
194 | /* Timeout between requests */ | |
195 | FileDevice VALUE(FALSE), | |
196 | /* Allow file: devices? */ | |
197 | FilterLimit VALUE(0), | |
198 | /* Max filter cost at any time */ | |
199 | FilterLevel VALUE(0), | |
200 | /* Current filter level */ | |
201 | FilterNice VALUE(0), | |
202 | /* Nice value for filters */ | |
203 | ReloadTimeout VALUE(DEFAULT_KEEPALIVE), | |
204 | /* Timeout before reload from SIGHUP */ | |
205 | RootCertDuration VALUE(300), | |
206 | /* Root certificate update interval */ | |
207 | PrintcapFormat VALUE(PRINTCAP_BSD), | |
208 | /* Format of printcap file? */ | |
209 | DefaultShared VALUE(TRUE), | |
210 | /* Share printers by default? */ | |
211 | MultipleOperationTimeout VALUE(DEFAULT_TIMEOUT), | |
212 | /* multiple-operation-time-out value */ | |
213 | WebInterface VALUE(CUPS_DEFAULT_WEBIF); | |
214 | /* Enable the web interface? */ | |
215 | VAR cups_file_t *AccessFile VALUE(NULL), | |
216 | /* Access log file */ | |
217 | *ErrorFile VALUE(NULL), | |
218 | /* Error log file */ | |
219 | *PageFile VALUE(NULL); | |
220 | /* Page log file */ | |
221 | VAR char *PageLogFormat VALUE(NULL); | |
222 | /* Page log format */ | |
223 | VAR mime_t *MimeDatabase VALUE(NULL); | |
224 | /* MIME type database */ | |
225 | VAR int NumMimeTypes VALUE(0); | |
226 | /* Number of MIME types */ | |
227 | VAR const char **MimeTypes VALUE(NULL); | |
228 | /* Array of MIME types */ | |
229 | ||
230 | #ifdef HAVE_SSL | |
231 | VAR char *ServerKeychain VALUE(NULL); | |
232 | /* Keychain holding cert + key */ | |
233 | #endif /* HAVE_SSL */ | |
234 | ||
235 | #ifdef HAVE_LAUNCHD | |
236 | VAR int LaunchdTimeout VALUE(10); | |
237 | /* Time after which an idle cupsd will exit */ | |
238 | #endif /* HAVE_LAUNCHD */ | |
239 | ||
240 | #ifdef HAVE_AUTHORIZATION_H | |
241 | VAR char *SystemGroupAuthKey VALUE(NULL); | |
242 | /* System group auth key */ | |
243 | #endif /* HAVE_AUTHORIZATION_H */ | |
244 | ||
245 | #ifdef HAVE_GSSAPI | |
246 | VAR char *GSSServiceName VALUE(NULL); | |
247 | /* GSS service name */ | |
248 | int HaveServerCreds VALUE(0); | |
249 | /* Do we have server credentials? */ | |
250 | gss_cred_id_t ServerCreds; /* Server's GSS credentials */ | |
251 | #endif /* HAVE_GSSAPI */ | |
252 | ||
253 | ||
254 | /* | |
255 | * Prototypes... | |
256 | */ | |
257 | ||
258 | extern void cupsdAddAlias(cups_array_t *aliases, const char *name); | |
259 | extern int cupsdCheckLogFile(cups_file_t **lf, const char *logname); | |
260 | extern int cupsdCheckPermissions(const char *filename, | |
261 | const char *suffix, mode_t mode, | |
262 | uid_t user, gid_t group, int is_dir, | |
263 | int create_dir); | |
264 | extern int cupsdCheckProgram(const char *filename, cupsd_printer_t *p); | |
265 | extern int cupsdDefaultAuthType(void); | |
266 | extern void cupsdFreeAliases(cups_array_t *aliases); | |
267 | extern char *cupsdGetDateTime(struct timeval *t, cupsd_time_t format); | |
268 | extern int cupsdLogClient(cupsd_client_t *con, int level, | |
269 | const char *message, ...) | |
270 | __attribute__((__format__(__printf__, 3, 4))); | |
271 | extern void cupsdLogFCMessage(void *context, _cups_fc_result_t result, | |
272 | const char *message); | |
273 | #ifdef HAVE_GSSAPI | |
274 | extern int cupsdLogGSSMessage(int level, OM_uint32 major_status, | |
275 | OM_uint32 minor_status, | |
276 | const char *message, ...); | |
277 | #endif /* HAVE_GSSAPI */ | |
278 | extern int cupsdLogJob(cupsd_job_t *job, int level, const char *message, | |
279 | ...) __attribute__((__format__(__printf__, 3, 4))); | |
280 | extern int cupsdLogMessage(int level, const char *message, ...) | |
281 | __attribute__ ((__format__ (__printf__, 2, 3))); | |
282 | extern int cupsdLogPage(cupsd_job_t *job, const char *page); | |
283 | extern int cupsdLogRequest(cupsd_client_t *con, http_status_t code); | |
284 | extern int cupsdReadConfiguration(void); | |
285 | extern int cupsdWriteErrorLog(int level, const char *message); | |
286 | ||
287 | ||
288 | /* | |
289 | * End of "$Id$". | |
290 | */ |