ctdb-tests: Update statd-callout tests to handle both modes
[samba4-gss.git] / source3 / param / loadparm.h
bloba33f1ae9a3b815ea998a8099d91448854be74de2
1 /*
3 * Unix SMB/CIFS implementation.
5 * Type definitions for loadparm
7 * Copyright (c) 2020 Andreas Schneider <asn@samba.org>
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef _S3_LOADPARM_H
23 #define _S3_LOADPARM_H
25 #include <talloc.h>
26 #include <regex.h>
28 /* Forward declarations */
29 typedef struct stat_ex SMB_STRUCT_STAT;
30 typedef struct files_struct files_struct;
31 struct smbd_server_connection;
32 struct security_descriptor;
33 struct loadparm_context;
35 /* The following definitions come from param/loadparm.c */
37 void loadparm_s3_init_globals(struct loadparm_context *lp_ctx,
38 bool reinit_globals);
40 const struct loadparm_substitution *loadparm_s3_global_substitution(void);
42 char *lp_parm_substituted_string(TALLOC_CTX *mem_ctx,
43 const struct loadparm_substitution *lp_sub,
44 int snum,
45 const char *type,
46 const char *option,
47 const char *def);
49 char *lp_servicename(TALLOC_CTX *ctx, const struct loadparm_substitution *, int);
50 const char *lp_const_servicename(int);
51 bool lp_autoloaded(int);
52 const char *lp_dnsdomain(void);
53 int lp_winbind_max_domain_connections(void);
54 bool lp_idmap_range(const char *domain_name, uint32_t *low, uint32_t *high);
55 bool lp_idmap_default_range(uint32_t *low, uint32_t *high);
56 const char *lp_idmap_backend(const char *domain_name);
57 const char *lp_idmap_default_backend (void);
58 int lp_security(void);
59 int lp_client_max_protocol(void);
60 int lp_client_ipc_min_protocol(void);
61 int lp_client_ipc_max_protocol(void);
62 int lp_client_ipc_signing(void);
63 enum credentials_use_kerberos lp_client_use_kerberos(void);
64 int lp_smb2_max_credits(void);
65 int lp_cups_encrypt(void);
66 bool lp_widelinks(int );
67 int lp_rpc_low_port(void);
68 int lp_rpc_high_port(void);
69 const char *lp_dns_hostname(void);
70 bool lp_lanman_auth(void);
71 enum samba_weak_crypto lp_weak_crypto(void);
72 bool lp_strict_rename(int snum);
73 int lp_smb3_directory_leases(void);
75 int lp_wi_scan_global_parametrics(
76 const char *regex, size_t max_matches,
77 bool (*cb)(const char *string, regmatch_t matches[],
78 void *private_data),
79 void *private_data);
80 int lp_wi_scan_share_parametrics(int snum,
81 const char *regex_str,
82 size_t max_matches,
83 bool (*cb)(const char *string,
84 regmatch_t matches[],
85 void *private_data),
86 void *private_data);
88 const char *lp_parm_const_string(int snum, const char *type, const char *option, const char *def);
89 struct loadparm_service;
90 const char *lp_parm_const_string_service(struct loadparm_service *service, const char *type,
91 const char *option, const char *def);
92 const char **lp_parm_string_list(int snum, const char *type, const char *option, const char **def);
93 int lp_parm_int(int snum, const char *type, const char *option, int def);
94 unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsigned long def);
95 unsigned long long lp_parm_ulonglong(int snum, const char *type,
96 const char *option,
97 unsigned long long def);
98 bool lp_parm_bool(int snum, const char *type, const char *option, bool def);
99 struct enum_list;
100 int lp_parm_enum(int snum, const char *type, const char *option,
101 const struct enum_list *_enum, int def);
102 char *canonicalize_servicename(TALLOC_CTX *ctx, const char *src);
103 bool lp_add_home(const char *pszHomename, int iDefaultService,
104 const char *user, const char *pszHomedir);
105 int lp_add_service(const char *pszService, int iDefaultService);
106 bool lp_add_printer(const char *pszPrintername, int iDefaultService);
107 bool lp_parameter_is_valid(const char *pszParmName);
108 bool lp_parameter_is_global(const char *pszParmName);
109 bool lp_canonicalize_parameter(const char *parm_name, const char **canon_parm,
110 bool *inverse);
111 bool lp_canonicalize_parameter_with_value(const char *parm_name,
112 const char *val,
113 const char **canon_parm,
114 const char **canon_val);
115 void show_parameter_list(void);
116 bool lp_invert_boolean(const char *str, const char **inverse_str);
117 bool lp_canonicalize_boolean(const char *str, const char**canon_str);
118 bool process_registry_service(const char *service_name);
119 bool process_registry_shares(void);
120 bool lp_config_backend_is_registry(void);
121 bool lp_config_backend_is_file(void);
122 bool lp_file_list_changed(void);
123 const char *lp_ldap_machine_suffix(TALLOC_CTX *ctx);
124 const char *lp_ldap_user_suffix(TALLOC_CTX *ctx);
125 const char *lp_ldap_group_suffix(TALLOC_CTX *ctx);
126 const char *lp_ldap_idmap_suffix(TALLOC_CTX *ctx);
127 struct parm_struct;
128 /* Return a pointer to a service by name. */
129 struct loadparm_service *lp_service(const char *pszServiceName);
130 struct loadparm_service *lp_servicebynum(int snum);
131 struct loadparm_service *lp_default_loadparm_service(void);
132 void *lp_parm_ptr(struct loadparm_service *service, struct parm_struct *parm);
133 void *lp_local_ptr_by_snum(int snum, struct parm_struct *parm);
134 bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue);
135 bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal);
136 bool lp_snum_ok(int iService);
137 void lp_add_one_printer(const char *name, const char *comment,
138 const char *location, void *pdata);
139 bool lp_loaded(void);
140 void lp_killunused(struct smbd_server_connection *sconn,
141 bool (*snumused) (struct smbd_server_connection *, int));
142 void lp_kill_all_services(void);
143 void lp_killservice(int iServiceIn);
144 const char* server_role_str(uint32_t role);
145 enum usershare_err parse_usershare_file(TALLOC_CTX *ctx,
146 SMB_STRUCT_STAT *psbuf,
147 const char *servicename,
148 int snum,
149 char **lines,
150 int numlines,
151 char **pp_sharepath,
152 char **pp_comment,
153 char **pp_cp_share_name,
154 struct security_descriptor **ppsd,
155 bool *pallow_guest);
156 int load_usershare_service(const char *servicename);
157 int load_usershare_shares(struct smbd_server_connection *sconn,
158 bool (*snumused) (struct smbd_server_connection *, int));
159 void gfree_loadparm(void);
160 bool lp_load_initial_only(const char *pszFname);
161 bool lp_load_global(const char *file_name);
162 bool lp_load_with_shares(const char *file_name);
163 bool lp_load_client(const char *file_name);
164 bool lp_load_global_no_reinit(const char *file_name);
165 bool lp_load_no_reinit(const char *file_name);
166 bool lp_load_client_no_reinit(const char *file_name);
167 bool lp_load_with_registry_shares(const char *pszFname);
168 int lp_numservices(void);
169 void lp_dump(FILE *f, bool show_defaults, int maxtoprint);
170 void lp_dump_one(FILE * f, bool show_defaults, int snum);
171 int lp_servicenumber(const char *pszServiceName);
172 const char *volume_label(TALLOC_CTX *ctx, int snum);
173 bool lp_domain_master(void);
174 bool lp_preferred_master(void);
175 void lp_remove_service(int snum);
176 void lp_copy_service(int snum, const char *new_name);
177 int lp_default_server_announce(void);
178 const char *lp_printername(TALLOC_CTX *ctx,
179 const struct loadparm_substitution *lp_sub,
180 int snum);
181 void lp_set_logfile(const char *name);
182 int lp_maxprintjobs(int snum);
183 const char *lp_printcapname(void);
184 bool lp_disable_spoolss( void );
185 void lp_set_spoolss_state( uint32_t state );
186 uint32_t lp_get_spoolss_state( void );
187 struct smb1_signing_state;
188 void set_use_sendfile(int snum, bool val);
189 void lp_set_mangling_method(const char *new_method);
190 bool lp_posix_pathnames(void);
191 void lp_set_posix_pathnames(void);
192 enum brl_flavour lp_posix_cifsu_locktype(files_struct *fsp);
193 void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val);
194 int lp_min_receive_file_size(void);
195 void widelinks_warning(int snum);
196 const char *lp_ncalrpc_dir(void);
197 void _lp_set_server_role(int server_role);
198 uint32_t lp_get_async_dns_timeout(void);
200 /* The following definitions come from param/loadparm_ctx.c */
202 const struct loadparm_s3_helpers *loadparm_s3_helpers(void);
204 /* The following definitions come from param/loadparm_server_role.c */
206 int lp_server_role(void);
207 void set_server_role(void);
209 /* The following definitions come from param/util.c */
211 uint32_t get_int_param( const char* param );
212 char *get_string_param( const char* param );
214 #endif /* _S3_LOADPARM_H */