Man pages for ntdb tools missing
[Samba.git] / lib / param / loadparm.h
blobf9624d6ca932fd3a60bc21adfff6ccff45fede30
1 /*
2 Unix SMB/CIFS implementation.
4 type definitions for loadparm
6 Copyright (C) Karl Auer 1993-1998
8 Largely re-written by Andrew Tridgell, September 1994
10 Copyright (C) Simo Sorce 2001
11 Copyright (C) Alexander Bokovoy 2002
12 Copyright (C) Stefan (metze) Metzmacher 2002
13 Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003.
14 Copyright (C) James Myers 2003 <myersjj@samba.org>
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
26 You should have received a copy of the GNU General Public License
27 along with this program. If not, see <http://www.gnu.org/licenses/>.
30 #ifndef _LOADPARM_H
31 #define _LOADPARM_H
33 #include "../lib/util/parmlist.h"
35 /* the following are used by loadparm for option lists */
36 typedef enum {
37 P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL,P_LIST,
38 P_STRING,P_USTRING,P_ENUM,P_BYTES,P_CMDLIST,P_SEP
39 } parm_type;
41 typedef enum {
42 P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE
43 } parm_class;
45 struct enum_list {
46 int value;
47 const char *name;
50 struct loadparm_service;
51 struct loadparm_context;
53 struct parm_struct {
54 const char *label;
55 parm_type type;
56 parm_class p_class;
57 offset_t offset;
58 bool (*special)(struct loadparm_context *lpcfg_ctx,
59 int snum, const char *, char **);
60 const struct enum_list *enum_list;
61 unsigned flags;
62 union {
63 bool bvalue;
64 int ivalue;
65 char *svalue;
66 char cvalue;
67 char **lvalue;
68 } def;
71 /* The following flags are used in SWAT */
72 #define FLAG_BASIC 0x0001 /* Display only in BASIC view */
73 #define FLAG_SHARE 0x0002 /* file sharing options */
74 #define FLAG_PRINT 0x0004 /* printing options */
75 #define FLAG_GLOBAL 0x0008 /* local options that should be globally settable in SWAT */
76 #define FLAG_WIZARD 0x0010 /* Parameters that the wizard will operate on */
77 #define FLAG_ADVANCED 0x0020 /* Parameters that will be visible in advanced view */
78 #define FLAG_DEVELOPER 0x0040 /* No longer used */
79 #define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */
80 #define FLAG_HIDE 0x2000 /* options that should be hidden in SWAT */
81 #define FLAG_META 0x8000 /* A meta directive - not a real parameter */
82 #define FLAG_CMDLINE 0x10000 /* option has been overridden */
83 #define FLAG_DEFAULT 0x20000 /* this option was a default */
85 /* This defines the section name in the configuration file that will
86 refer to the special "printers" service */
87 #ifndef PRINTERS_NAME
88 #define PRINTERS_NAME "printers"
89 #endif
91 /* This defines the section name in the configuration file that will
92 refer to the special "homes" service */
93 #ifndef HOMES_NAME
94 #define HOMES_NAME "homes"
95 #endif
97 /* This defines the section name in the configuration file that will contain */
98 /* global parameters - that is, parameters relating to the whole server, not */
99 /* just services. This name is then reserved, and may not be used as a */
100 /* a service name. It will default to "global" if not defined here. */
101 #ifndef GLOBAL_NAME
102 #define GLOBAL_NAME "global"
103 #define GLOBAL_NAME2 "globals"
104 #endif
106 /* The default workgroup - usually overridden in smb.conf */
107 #ifndef DEFAULT_WORKGROUP
108 #define DEFAULT_WORKGROUP "WORKGROUP"
109 #endif
111 /* types of configuration backends for loadparm */
112 #define CONFIG_BACKEND_FILE 0
113 #define CONFIG_BACKEND_REGISTRY 1
116 Do you want session setups at user level security with a invalid
117 password to be rejected or allowed in as guest? WinNT rejects them
118 but it can be a pain as it means "net view" needs to use a password
120 You have 3 choices in the setting of map_to_guest:
122 "NEVER_MAP_TO_GUEST" means session setups with an invalid password
123 are rejected. This is the default.
125 "MAP_TO_GUEST_ON_BAD_USER" means session setups with an invalid password
126 are rejected, unless the username does not exist, in which case it
127 is treated as a guest login
129 "MAP_TO_GUEST_ON_BAD_PASSWORD" means session setups with an invalid password
130 are treated as a guest login
132 Note that map_to_guest only has an effect in user or server
133 level security.
136 #define NEVER_MAP_TO_GUEST 0
137 #define MAP_TO_GUEST_ON_BAD_USER 1
138 #define MAP_TO_GUEST_ON_BAD_PASSWORD 2
139 #define MAP_TO_GUEST_ON_BAD_UID 3
142 * This should be under the HAVE_KRB5 flag but since they're used
143 * in lp_kerberos_method(), they ned to be always available
144 * If you add any entries to KERBEROS_VERIFY defines, please modify USE.*KEYTAB macros
145 * so they remain accurate.
148 #define KERBEROS_VERIFY_SECRETS 0
149 #define KERBEROS_VERIFY_SYSTEM_KEYTAB 1
150 #define KERBEROS_VERIFY_DEDICATED_KEYTAB 2
151 #define KERBEROS_VERIFY_SECRETS_AND_KEYTAB 3
153 /* ACL compatibility */
154 enum acl_compatibility {ACL_COMPAT_AUTO, ACL_COMPAT_WINNT, ACL_COMPAT_WIN2K};
156 /* printing types */
157 enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX,
158 PRINT_QNX,PRINT_PLP,PRINT_LPRNG,PRINT_SOFTQ,
159 PRINT_CUPS,PRINT_LPRNT,PRINT_LPROS2,PRINT_IPRINT
160 #if defined(DEVELOPER) || defined(ENABLE_SELFTEST)
161 ,PRINT_TEST,PRINT_VLP
162 #endif /* DEVELOPER */
168 /* ads auth control flags */
169 #define ADS_AUTH_DISABLE_KERBEROS 0x0001
170 #define ADS_AUTH_NO_BIND 0x0002
171 #define ADS_AUTH_ANON_BIND 0x0004
172 #define ADS_AUTH_SIMPLE_BIND 0x0008
173 #define ADS_AUTH_ALLOW_NTLMSSP 0x0010
174 #define ADS_AUTH_SASL_SIGN 0x0020
175 #define ADS_AUTH_SASL_SEAL 0x0040
176 #define ADS_AUTH_SASL_FORCE 0x0080
177 #define ADS_AUTH_USER_CREDS 0x0100
179 /* DNS update settings */
180 enum dns_update_settings {DNS_UPDATE_OFF, DNS_UPDATE_ON, DNS_UPDATE_SIGNED};
182 /* LDAP SSL options */
183 enum ldap_ssl_types {LDAP_SSL_OFF, LDAP_SSL_START_TLS};
185 /* LDAP PASSWD SYNC methods */
186 enum ldap_passwd_sync_types {LDAP_PASSWD_SYNC_ON, LDAP_PASSWD_SYNC_OFF, LDAP_PASSWD_SYNC_ONLY};
188 /* map readonly options */
189 enum mapreadonly_options {MAP_READONLY_NO, MAP_READONLY_YES, MAP_READONLY_PERMISSIONS};
191 /* case handling */
192 enum case_handling {CASE_LOWER,CASE_UPPER};
195 * Default passwd chat script.
197 #ifndef DEFAULT_PASSWD_CHAT
198 #define DEFAULT_PASSWD_CHAT "*new*password* %n\\n *new*password* %n\\n *changed*"
199 #endif
201 /* Max number of jobs per print queue. */
202 #ifndef PRINT_MAX_JOBID
203 #define PRINT_MAX_JOBID 10000
204 #endif
206 #define LOADPARM_EXTRA_LOCALS \
207 bool valid; \
208 int usershare; \
209 struct timespec usershare_last_mod; \
210 int iMaxPrintJobs; \
211 char *szCopy; \
212 char *szService; \
213 char *szInclude; \
214 bool bWidelinks; \
215 bool bAvailable; \
216 struct parmlist_entry *param_opt; \
217 struct bitmap *copymap; \
218 char dummy[3]; /* for alignment */
220 #include "lib/param/param_local.h"
222 const char* server_role_str(uint32_t role);
223 int lp_find_server_role(int server_role, int security, int domain_logons, int domain_master);
224 int lp_find_security(int server_role, int security);
225 bool lp_is_security_and_server_role_valid(int server_role, int security);
227 #endif /* _LOADPARM_H */