Fix some C++ warnings
[Samba.git] / source / include / local.h
blobc125ded37130302ec54531e18846b2fbf74f2249
1 /* Copyright (C) 1995-1998 Samba-Team */
2 /* Copyright (C) 1998 John H Terpstra <jht@aquasoft.com.au> */
4 /* local definitions for file server */
5 #ifndef _LOCAL_H
6 #define _LOCAL_H
8 /* The default workgroup - usually overridden in smb.conf */
9 #ifndef WORKGROUP
10 #define WORKGROUP "WORKGROUP"
11 #endif
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
18 #ifndef MAX_DEBUG_LEVEL
19 #define MAX_DEBUG_LEVEL 1000
20 #endif
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"
29 /* This defines the section name in the configuration file that will
30 refer to the special "homes" service */
31 #define HOMES_NAME "homes"
33 /* This defines the section name in the configuration file that will
34 refer to the special "printers" service */
35 #define PRINTERS_NAME "printers"
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
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
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
51 /* maximum number of file caches per smbd */
52 #define MAX_WRITE_CACHES 10
54 /* define what facility to use for syslog */
55 #ifndef SYSLOG_FACILITY
56 #define SYSLOG_FACILITY LOG_DAEMON
57 #endif
59 /*
60 * Default number of maximum open files per smbd. This is
61 * also limited by the maximum available file descriptors
62 * per process and can also be set in smb.conf as "max open files"
63 * in the [global] section.
66 #ifndef MAX_OPEN_FILES
67 #define MAX_OPEN_FILES 10000
68 #endif
70 #define WORDMAX 0xFFFF
72 /* the maximum password length before we declare a likely attack */
73 #define MAX_PASS_LEN 200
75 /* separators for lists */
76 #define LIST_SEP " \t,;\n\r"
78 /* wchar separators for lists */
79 #define LIST_SEP_W wchar_list_sep
81 /* this is where browse lists are kept in the lock dir */
82 #define SERVER_LIST "browse.dat"
84 /* shall filenames with illegal chars in them get mangled in long
85 filename listings? */
86 #define MANGLE_LONG_FILENAMES
88 /* define this if you want to stop spoofing with .. and soft links
89 NOTE: This also slows down the server considerably */
90 #define REDUCE_PATHS
92 /* the size of the directory cache */
93 #define DIRCACHESIZE 20
95 /* what default type of filesystem do we want this to show up as in a
96 NT file manager window? */
97 #define FSTYPE_STRING "NTFS"
99 /* the default guest account - normally set in the Makefile or smb.conf */
100 #ifndef GUEST_ACCOUNT
101 #define GUEST_ACCOUNT "nobody"
102 #endif
104 /* user to test password server with as invalid in security=server mode. */
105 #ifndef INVALID_USER_PREFIX
106 #define INVALID_USER_PREFIX "sambatest"
107 #endif
109 /* the default pager to use for the client "more" command. Users can
110 override this with the PAGER environment variable */
111 #ifndef PAGER
112 #define PAGER "more"
113 #endif
115 /* the size of the uid cache used to reduce valid user checks */
116 #define VUID_CACHE_SIZE 32
118 /* the following control timings of various actions. Don't change
119 them unless you know what you are doing. These are all in seconds */
120 #define DEFAULT_SMBD_TIMEOUT (60*60*24*7)
121 #define SMBD_RELOAD_CHECK (180)
122 #define IDLE_CLOSED_TIMEOUT (60)
123 #define DPTR_IDLE_TIMEOUT (120)
124 #define SMBD_SELECT_TIMEOUT (60)
125 #define NMBD_SELECT_LOOP (10)
126 #define BROWSE_INTERVAL (60)
127 #define REGISTRATION_INTERVAL (10*60)
128 #define NMBD_INETD_TIMEOUT (120)
129 #define NMBD_MAX_TTL (24*60*60)
130 #define LPQ_LOCK_TIMEOUT (5)
131 #define NMBD_INTERFACES_RELOAD (120)
132 #define NMBD_UNEXPECTED_TIMEOUT (15)
134 /* the following are in milliseconds */
135 #define LOCK_RETRY_TIMEOUT (100)
137 /* do you want to dump core (carefully!) when an internal error is
138 encountered? Samba will be careful to make the core file only
139 accessible to root */
140 #define DUMP_CORE 1
142 /* shall we support browse requests via a FIFO to nmbd? */
143 #define ENABLE_FIFO 1
145 /* how long (in miliseconds) to wait for a socket connect to happen */
146 #define LONG_CONNECT_TIMEOUT 30000
147 #define SHORT_CONNECT_TIMEOUT 5000
149 /* the default netbios keepalive timeout */
150 #define DEFAULT_KEEPALIVE 300
152 /* the directory to sit in when idle */
153 /* #define IDLE_DIR "/" */
155 /* Timout (in seconds) to wait for an oplock break
156 message to return from the client. */
158 #define OPLOCK_BREAK_TIMEOUT 30
160 /* Timout (in seconds) to add to the oplock break timeout
161 to wait for the smbd to smbd message to return. */
163 #define OPLOCK_BREAK_TIMEOUT_FUDGEFACTOR 2
165 /* the read preciction code has been disabled until some problems with
166 it are worked out */
167 #define USE_READ_PREDICTION 0
170 * Default passwd chat script.
173 #define DEFAULT_PASSWD_CHAT "*new*password* %n\\n *new*password* %n\\n *changed*"
175 /* Minimum length of allowed password when changing UNIX password. */
176 #define MINPASSWDLENGTH 5
178 /* maximum ID number used for session control. This cannot be larger
179 than 62*62 for the current code */
180 #define MAX_SESSION_ID 3000
182 /* For the benifit of PAM and the 'session exec' scripts, we fake up a terminal
183 name. This can be in one of two forms: The first for systems not using
184 utmp (and therefore not constrained as to length or the need for a number
185 < 3000 or so) and the second for systems with this 'well behaved terminal
186 like name' constraint.
189 #ifndef SESSION_TEMPLATE
190 /* Paramaters are 'pid' and 'vuid' */
191 #define SESSION_TEMPLATE "smb/%lu/%d"
192 #endif
194 #ifndef SESSION_UTMP_TEMPLATE
195 #define SESSION_UTMP_TEMPLATE "smb/%d"
196 #endif
198 /* the maximum age in seconds of a password. Should be a lp_ parameter */
199 #define MAX_PASSWORD_AGE (21*24*60*60)
201 /* Default allocation roundup. */
202 #define SMB_ROUNDUP_ALLOCATION_SIZE 0x100000
204 /* shall we deny oplocks to clients that get timeouts? */
205 #define FASCIST_OPLOCK_BACKOFF 1
207 /* this enables the "rabbit pellet" fix for SMBwritebraw */
208 #define RABBIT_PELLET_FIX 1
210 /* Max number of jobs per print queue. */
211 #define PRINT_MAX_JOBID 10000
213 /* Max number of open RPC pipes. */
214 #define MAX_OPEN_PIPES 2048
216 /* Tuning for server auth mutex. */
217 #define CLI_AUTH_TIMEOUT 5000 /* In milli-seconds. */
218 #define NUM_CLI_AUTH_CONNECT_RETRIES 3
219 /* Number in seconds to wait for the mutex. This must be less than 30 seconds. */
220 #define SERVER_MUTEX_WAIT_TIME ( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)
221 /* Number in seconds for winbindd to wait for the mutex. Make this 2 * smbd wait time. */
222 #define WINBIND_SERVER_MUTEX_WAIT_TIME (( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)*2)
224 /* Max number of simultaneous winbindd socket connections. */
225 #define WINBINDD_MAX_SIMULTANEOUS_CLIENTS 200
227 /* Buffer size to use when printing backtraces */
228 #define BACKTRACE_STACK_SIZE 64
230 /* size of listen() backlog in smbd */
231 #define SMBD_LISTEN_BACKLOG 50
233 /* Number of microseconds to wait before a sharing violation. */
234 #define SHARING_VIOLATION_USEC_WAIT 950000
236 /* Number of microseconds to wait before a updating the write time (2 secs). */
237 #define WRITE_TIME_UPDATE_USEC_DELAY 2000000
239 #define MAX_LDAP_REPLICATION_SLEEP_TIME 5000 /* In milliseconds. */
241 /* tdb hash size for the open database. */
242 #define SMB_OPEN_DATABASE_TDB_HASH_SIZE 10007
244 /* Characters we disallow in sharenames. */
245 #define INVALID_SHARENAME_CHARS "%<>*?|/\\+=;:\","
247 /* Seconds between connection attempts to a remote server. */
248 #define FAILED_CONNECTION_CACHE_TIMEOUT 30
250 /* Default hash size for the winbindd cache. */
251 #define WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE 5000
253 /* Windows minimum lock resolution timeout in ms */
254 #define WINDOWS_MINIMUM_LOCK_TIMEOUT_MS 200
256 #endif