Revert "Revert "s3-printing: update parent smbd pcap cache""
[samba.git] / source3 / include / local.h
1 /* Copyright (C) 1995-1998 Samba-Team */
2 /* Copyright (C) 1998 John H Terpstra <jht@aquasoft.com.au> */
3
4 /* local definitions for file server */
5 #ifndef _LOCAL_H
6 #define _LOCAL_H
7
8 /* The default workgroup - usually overridden in smb.conf */
9 #ifndef WORKGROUP
10 #define WORKGROUP "WORKGROUP"
11 #endif
12
13 /* the maximum debug level to compile into the code. This assumes a good 
14    optimising compiler that can remove unused code 
15    for embedded or low-memory systems set this to a value like 2 to get
16    only important messages. This gives *much* smaller binaries
17 */
18 #ifndef MAX_DEBUG_LEVEL
19 #define MAX_DEBUG_LEVEL 1000
20 #endif
21
22 /* This defines the section name in the configuration file that will contain */
23 /* global parameters - that is, parameters relating to the whole server, not */
24 /* just services. This name is then reserved, and may not be used as a       */
25 /* a service name. It will default to "global" if not defined here.          */
26 #define GLOBAL_NAME "global"
27 #define GLOBAL_NAME2 "globals"
28
29 /* This defines the section name in the configuration file that will
30    refer to the special "homes" service */
31 #define HOMES_NAME "homes"
32
33 /* This defines the section name in the configuration file that will
34    refer to the special "printers" service */
35 #define PRINTERS_NAME "printers"
36
37 /* Yves Gaige <yvesg@hptnodur.grenoble.hp.com> requested this set this       */
38 /* to a maximum of 8 if old smb clients break because of long printer names. */
39 #define MAXPRINTERLEN 15
40
41 /* max number of directories open at once */
42 /* note that with the new directory code this no longer requires a
43    file handle per directory, but large numbers do use more memory */
44 #define MAX_OPEN_DIRECTORIES 256
45
46 /* max number of directory handles */
47 /* As this now uses the bitmap code this can be
48    quite large. */
49 #define MAX_DIRECTORY_HANDLES 2048
50
51 /* maximum number of file caches per smbd */
52 #define MAX_WRITE_CACHES 10
53
54 /* define what facility to use for syslog */
55 #ifndef SYSLOG_FACILITY
56 #define SYSLOG_FACILITY LOG_DAEMON
57 #endif
58
59 /*
60  * Fudgefactor required for open tdb's, etc.
61  */
62
63 #ifndef MAX_OPEN_FUDGEFACTOR
64 #define MAX_OPEN_FUDGEFACTOR 20
65 #endif
66
67 /*
68  * Minimum number of open files needed for Windows7 to
69  * work correctly. A little conservative but better that
70  * than run out of fd's.
71  */
72
73 #ifndef MIN_OPEN_FILES_WINDOWS
74 #define MIN_OPEN_FILES_WINDOWS 16384
75 #endif
76
77 /*
78  * Default number of maximum open files per smbd. This is
79  * also limited by the maximum available file descriptors
80  * per process and can also be set in smb.conf as "max open files"
81  * in the [global] section.
82  */
83
84 #ifndef MAX_OPEN_FILES
85 #define MAX_OPEN_FILES (MIN_OPEN_FILES_WINDOWS + MAX_OPEN_FUDGEFACTOR)
86 #endif
87
88 #define WORDMAX 0xFFFF
89
90 /* the maximum password length before we declare a likely attack */
91 #define MAX_PASS_LEN 200
92
93 /* separators for lists */
94 #define LIST_SEP " \t,;\n\r"
95
96 /* wchar separators for lists */
97 #define LIST_SEP_W wchar_list_sep
98
99 /* this is where browse lists are kept in the lock dir */
100 #define SERVER_LIST "browse.dat"
101
102 /* shall filenames with illegal chars in them get mangled in long
103    filename listings? */
104 #define MANGLE_LONG_FILENAMES 
105
106 /* define this if you want to stop spoofing with .. and soft links
107    NOTE: This also slows down the server considerably */
108 #define REDUCE_PATHS
109
110 /* the size of the directory cache */
111 #define DIRCACHESIZE 20
112
113 /* what default type of filesystem do we want this to show up as in a
114    NT file manager window? */
115 #define FSTYPE_STRING "NTFS"
116
117 /* the default guest account - normally set in the Makefile or smb.conf */
118 #ifndef GUEST_ACCOUNT
119 #define GUEST_ACCOUNT "nobody"
120 #endif
121
122 /* user to test password server with as invalid in security=server mode. */
123 #ifndef INVALID_USER_PREFIX
124 #define INVALID_USER_PREFIX "sambatest"
125 #endif
126
127 /* the default pager to use for the client "more" command. Users can
128    override this with the PAGER environment variable */
129 #ifndef PAGER
130 #define PAGER "more"
131 #endif
132
133 /* the size of the uid cache used to reduce valid user checks */
134 #define VUID_CACHE_SIZE 32
135
136 /* the following control timings of various actions. Don't change 
137    them unless you know what you are doing. These are all in seconds */
138 #define DEFAULT_SMBD_TIMEOUT (60*60*24*7)
139 #define SMBD_RELOAD_CHECK (180)
140 #define IDLE_CLOSED_TIMEOUT (60)
141 #define DPTR_IDLE_TIMEOUT (120)
142 #define SMBD_SELECT_TIMEOUT (60)
143 #define NMBD_SELECT_LOOP (10)
144 #define BROWSE_INTERVAL (60)
145 #define REGISTRATION_INTERVAL (10*60)
146 #define NMBD_INETD_TIMEOUT (120)
147 #define NMBD_MAX_TTL (24*60*60)
148 #define LPQ_LOCK_TIMEOUT (5)
149 #define NMBD_INTERFACES_RELOAD (120)
150 #define NMBD_UNEXPECTED_TIMEOUT (15)
151 #define SMBD_HOUSEKEEPING_INTERVAL SMBD_SELECT_TIMEOUT
152
153 /* the following are in milliseconds */
154 #define LOCK_RETRY_TIMEOUT (100)
155
156 /* do you want to dump core (carefully!) when an internal error is
157    encountered? Samba will be careful to make the core file only
158    accessible to root */
159 #define DUMP_CORE 1
160
161 /* shall we support browse requests via a FIFO to nmbd? */
162 #define ENABLE_FIFO 1
163
164 /* how long (in miliseconds) to wait for a socket connect to happen */
165 #define LONG_CONNECT_TIMEOUT 30000
166 #define SHORT_CONNECT_TIMEOUT 5000
167
168 /* the default netbios keepalive timeout */
169 #define DEFAULT_KEEPALIVE 300
170
171 /* the directory to sit in when idle */
172 /* #define IDLE_DIR "/" */
173
174 /* Timout (in seconds) to wait for an oplock break
175    message to return from the client. */
176
177 #define OPLOCK_BREAK_TIMEOUT 30
178
179 /* Timout (in seconds) to add to the oplock break timeout
180    to wait for the smbd to smbd message to return. */
181
182 #define OPLOCK_BREAK_TIMEOUT_FUDGEFACTOR 2
183
184 /* the read preciction code has been disabled until some problems with
185    it are worked out */
186 #define USE_READ_PREDICTION 0
187
188 /*
189  * Default passwd chat script.
190  */
191
192 #define DEFAULT_PASSWD_CHAT "*new*password* %n\\n *new*password* %n\\n *changed*"
193
194 /* Minimum length of allowed password when changing UNIX password. */
195 #define MINPASSWDLENGTH 5
196
197 /* maximum ID number used for session control. This cannot be larger
198    than 62*62 for the current code */
199 #define MAX_SESSION_ID 3000
200
201 /* For the benifit of PAM and the 'session exec' scripts, we fake up a terminal
202    name. This can be in one of two forms:  The first for systems not using
203    utmp (and therefore not constrained as to length or the need for a number
204    < 3000 or so) and the second for systems with this 'well behaved terminal
205    like name' constraint.
206 */
207
208 #ifndef SESSION_TEMPLATE
209 /* Paramaters are 'pid' and 'vuid' */
210 #define SESSION_TEMPLATE "smb/%lu/%d"
211 #endif
212
213 #ifndef SESSION_UTMP_TEMPLATE
214 #define SESSION_UTMP_TEMPLATE "smb/%d"
215 #endif
216
217 /* the maximum age in seconds of a password. Should be a lp_ parameter */
218 #define MAX_PASSWORD_AGE (21*24*60*60)
219
220 /* Default allocation roundup. */
221 #define SMB_ROUNDUP_ALLOCATION_SIZE 0x100000
222
223 /* shall we deny oplocks to clients that get timeouts? */
224 #define FASCIST_OPLOCK_BACKOFF 1
225
226 /* this enables the "rabbit pellet" fix for SMBwritebraw */
227 #define RABBIT_PELLET_FIX 1
228
229 /* Max number of jobs per print queue. */
230 #define PRINT_MAX_JOBID 10000
231
232 /* Max number of open RPC pipes. */
233 #define MAX_OPEN_PIPES 2048
234
235 /* Tuning for server auth mutex. */
236 #define CLI_AUTH_TIMEOUT 5000 /* In milli-seconds. */
237 #define NUM_CLI_AUTH_CONNECT_RETRIES 3
238 /* Number in seconds to wait for the mutex. This must be less than 30 seconds. */
239 #define SERVER_MUTEX_WAIT_TIME ( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)
240 /* Number in seconds for winbindd to wait for the mutex. Make this 2 * smbd wait time. */
241 #define WINBIND_SERVER_MUTEX_WAIT_TIME (( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)*2)
242
243 /* Max number of simultaneous winbindd socket connections. */
244 #define WINBINDD_MAX_SIMULTANEOUS_CLIENTS 200
245
246 /* Buffer size to use when printing backtraces */
247 #define BACKTRACE_STACK_SIZE 64
248
249 /* size of listen() backlog in smbd */
250 #define SMBD_LISTEN_BACKLOG 50
251
252 /* Number of microseconds to wait before a sharing violation. */
253 #define SHARING_VIOLATION_USEC_WAIT 950000
254
255 /* Number of microseconds to wait before a updating the write time (2 secs). */
256 #define WRITE_TIME_UPDATE_USEC_DELAY 2000000
257
258 #define MAX_LDAP_REPLICATION_SLEEP_TIME 5000 /* In milliseconds. */
259
260 /* tdb hash size for the open database. */
261 #define SMB_OPEN_DATABASE_TDB_HASH_SIZE 10007
262
263 /* Characters we disallow in sharenames. */
264 #define INVALID_SHARENAME_CHARS "%<>*?|/\\+=;:\","
265
266 /* Seconds between connection attempts to a remote server. */
267 #define FAILED_CONNECTION_CACHE_TIMEOUT 30
268
269 /* Default hash size for the winbindd cache. */
270 #define WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE 5000
271
272 /* Windows minimum lock resolution timeout in ms */
273 #define WINDOWS_MINIMUM_LOCK_TIMEOUT_MS 200
274
275 /* Maximum size of RPC data we will accept for one call. */
276 #define MAX_RPC_DATA_SIZE (15*1024*1024)
277
278 #endif