| 1 | /*
|
|---|
| 2 | Unix SMB/CIFS implementation.
|
|---|
| 3 | Generic parameter parsing interface
|
|---|
| 4 | Copyright (C) Jelmer Vernooij 2005
|
|---|
| 5 |
|
|---|
| 6 | This program is free software; you can redistribute it and/or modify
|
|---|
| 7 | it under the terms of the GNU General Public License as published by
|
|---|
| 8 | the Free Software Foundation; either version 3 of the License, or
|
|---|
| 9 | (at your option) any later version.
|
|---|
| 10 |
|
|---|
| 11 | This program is distributed in the hope that it will be useful,
|
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | GNU General Public License for more details.
|
|---|
| 15 |
|
|---|
| 16 | You should have received a copy of the GNU General Public License
|
|---|
| 17 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 18 | */
|
|---|
| 19 |
|
|---|
| 20 | #ifndef _PARAM_H /* _PARAM_H */
|
|---|
| 21 | #define _PARAM_H
|
|---|
| 22 |
|
|---|
| 23 | #include "../lib/util/parmlist.h"
|
|---|
| 24 |
|
|---|
| 25 | struct param_context {
|
|---|
| 26 | struct param_section *sections;
|
|---|
| 27 | };
|
|---|
| 28 |
|
|---|
| 29 | struct param_section {
|
|---|
| 30 | const char *name;
|
|---|
| 31 | struct param_section *prev, *next;
|
|---|
| 32 | struct parmlist *parameters;
|
|---|
| 33 | };
|
|---|
| 34 |
|
|---|
| 35 | struct param_context;
|
|---|
| 36 | struct smbsrv_connection;
|
|---|
| 37 |
|
|---|
| 38 | #define Auto (2)
|
|---|
| 39 |
|
|---|
| 40 | typedef NTSTATUS (*init_module_fn) (void);
|
|---|
| 41 |
|
|---|
| 42 | /* this needs to be a string which is not in the C library. We
|
|---|
| 43 | previously used "init_module", but that meant that modules which
|
|---|
| 44 | did not define this function ended up calling the C library
|
|---|
| 45 | function init_module() which makes a system call */
|
|---|
| 46 | #define SAMBA_INIT_MODULE "samba_init_module"
|
|---|
| 47 |
|
|---|
| 48 | enum server_role {
|
|---|
| 49 | ROLE_STANDALONE=0,
|
|---|
| 50 | ROLE_DOMAIN_MEMBER=1,
|
|---|
| 51 | ROLE_DOMAIN_CONTROLLER=2,
|
|---|
| 52 | };
|
|---|
| 53 |
|
|---|
| 54 | enum announce_as {/* Types of machine we can announce as. */
|
|---|
| 55 | ANNOUNCE_AS_NT_SERVER=1,
|
|---|
| 56 | ANNOUNCE_AS_WIN95=2,
|
|---|
| 57 | ANNOUNCE_AS_WFW=3,
|
|---|
| 58 | ANNOUNCE_AS_NT_WORKSTATION=4
|
|---|
| 59 | };
|
|---|
| 60 |
|
|---|
| 61 | struct loadparm_context;
|
|---|
| 62 | struct loadparm_service;
|
|---|
| 63 | struct smbcli_options;
|
|---|
| 64 | struct smbcli_session_options;
|
|---|
| 65 | struct gensec_settings;
|
|---|
| 66 |
|
|---|
| 67 | void reload_charcnv(struct loadparm_context *lp_ctx);
|
|---|
| 68 |
|
|---|
| 69 | struct loadparm_service *lp_default_service(struct loadparm_context *lp_ctx);
|
|---|
| 70 | struct parm_struct *lp_parm_table(void);
|
|---|
| 71 | int lp_server_role(struct loadparm_context *);
|
|---|
| 72 | const char **lp_smb_ports(struct loadparm_context *);
|
|---|
| 73 | int lp_nbt_port(struct loadparm_context *);
|
|---|
| 74 | int lp_dgram_port(struct loadparm_context *);
|
|---|
| 75 | int lp_cldap_port(struct loadparm_context *);
|
|---|
| 76 | int lp_krb5_port(struct loadparm_context *);
|
|---|
| 77 | int lp_kpasswd_port(struct loadparm_context *);
|
|---|
| 78 | int lp_web_port(struct loadparm_context *);
|
|---|
| 79 | const char *lp_swat_directory(struct loadparm_context *);
|
|---|
| 80 | bool lp_tls_enabled(struct loadparm_context *);
|
|---|
| 81 | char *lp_tls_keyfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
|
|---|
| 82 | char *lp_tls_certfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
|
|---|
| 83 | char *lp_tls_cafile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
|
|---|
| 84 | char *lp_tls_crlfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
|
|---|
| 85 | char *lp_tls_dhpfile(TALLOC_CTX *mem_ctx, struct loadparm_context *);
|
|---|
| 86 | const char *lp_share_backend(struct loadparm_context *);
|
|---|
| 87 | const char *lp_sam_url(struct loadparm_context *);
|
|---|
| 88 | const char *lp_idmap_url(struct loadparm_context *);
|
|---|
| 89 | const char *lp_secrets_url(struct loadparm_context *);
|
|---|
| 90 | const char *lp_spoolss_url(struct loadparm_context *);
|
|---|
| 91 | const char *lp_wins_config_url(struct loadparm_context *);
|
|---|
| 92 | const char *lp_wins_url(struct loadparm_context *);
|
|---|
| 93 | const char *lp_winbind_separator(struct loadparm_context *);
|
|---|
| 94 | const char *lp_winbindd_socket_directory(struct loadparm_context *);
|
|---|
| 95 | const char *lp_winbindd_privileged_socket_directory(struct loadparm_context *);
|
|---|
| 96 | const char *lp_template_shell(struct loadparm_context *);
|
|---|
| 97 | const char *lp_template_homedir(struct loadparm_context *);
|
|---|
| 98 | bool lp_winbind_sealed_pipes(struct loadparm_context *);
|
|---|
| 99 | bool lp_idmap_trusted_only(struct loadparm_context *);
|
|---|
| 100 | const char *lp_private_dir(struct loadparm_context *);
|
|---|
| 101 | const char *lp_serverstring(struct loadparm_context *);
|
|---|
| 102 | const char *lp_lockdir(struct loadparm_context *);
|
|---|
| 103 | const char *lp_modulesdir(struct loadparm_context *);
|
|---|
| 104 | const char *lp_setupdir(struct loadparm_context *);
|
|---|
| 105 | const char *lp_ncalrpc_dir(struct loadparm_context *);
|
|---|
| 106 | const char *lp_dos_charset(struct loadparm_context *);
|
|---|
| 107 | const char *lp_unix_charset(struct loadparm_context *);
|
|---|
| 108 | const char *lp_display_charset(struct loadparm_context *);
|
|---|
| 109 | const char *lp_piddir(struct loadparm_context *);
|
|---|
| 110 | const char **lp_dcerpc_endpoint_servers(struct loadparm_context *);
|
|---|
| 111 | const char **lp_server_services(struct loadparm_context *);
|
|---|
| 112 | const char *lp_ntptr_providor(struct loadparm_context *);
|
|---|
| 113 | const char *lp_auto_services(struct loadparm_context *);
|
|---|
| 114 | const char *lp_passwd_chat(struct loadparm_context *);
|
|---|
| 115 | const char **lp_passwordserver(struct loadparm_context *);
|
|---|
| 116 | const char **lp_name_resolve_order(struct loadparm_context *);
|
|---|
| 117 | const char *lp_realm(struct loadparm_context *);
|
|---|
| 118 | const char *lp_socket_options(struct loadparm_context *);
|
|---|
| 119 | const char *lp_workgroup(struct loadparm_context *);
|
|---|
| 120 | const char *lp_netbios_name(struct loadparm_context *);
|
|---|
| 121 | const char *lp_netbios_scope(struct loadparm_context *);
|
|---|
| 122 | const char **lp_wins_server_list(struct loadparm_context *);
|
|---|
| 123 | const char **lp_interfaces(struct loadparm_context *);
|
|---|
| 124 | const char *lp_socket_address(struct loadparm_context *);
|
|---|
| 125 | const char **lp_netbios_aliases(struct loadparm_context *);
|
|---|
| 126 | bool lp_disable_netbios(struct loadparm_context *);
|
|---|
| 127 | bool lp_wins_support(struct loadparm_context *);
|
|---|
| 128 | bool lp_wins_dns_proxy(struct loadparm_context *);
|
|---|
| 129 | const char *lp_wins_hook(struct loadparm_context *);
|
|---|
| 130 | bool lp_local_master(struct loadparm_context *);
|
|---|
| 131 | bool lp_readraw(struct loadparm_context *);
|
|---|
| 132 | bool lp_large_readwrite(struct loadparm_context *);
|
|---|
| 133 | bool lp_writeraw(struct loadparm_context *);
|
|---|
| 134 | bool lp_null_passwords(struct loadparm_context *);
|
|---|
| 135 | bool lp_obey_pam_restrictions(struct loadparm_context *);
|
|---|
| 136 | bool lp_encrypted_passwords(struct loadparm_context *);
|
|---|
| 137 | bool lp_time_server(struct loadparm_context *);
|
|---|
| 138 | bool lp_bind_interfaces_only(struct loadparm_context *);
|
|---|
| 139 | bool lp_unicode(struct loadparm_context *);
|
|---|
| 140 | bool lp_nt_status_support(struct loadparm_context *);
|
|---|
| 141 | bool lp_lanman_auth(struct loadparm_context *);
|
|---|
| 142 | bool lp_ntlm_auth(struct loadparm_context *);
|
|---|
| 143 | bool lp_client_plaintext_auth(struct loadparm_context *);
|
|---|
| 144 | bool lp_client_lanman_auth(struct loadparm_context *);
|
|---|
| 145 | bool lp_client_ntlmv2_auth(struct loadparm_context *);
|
|---|
| 146 | bool lp_client_use_spnego_principal(struct loadparm_context *);
|
|---|
| 147 | bool lp_host_msdfs(struct loadparm_context *);
|
|---|
| 148 | bool lp_unix_extensions(struct loadparm_context *);
|
|---|
| 149 | bool lp_use_spnego(struct loadparm_context *);
|
|---|
| 150 | bool lp_rpc_big_endian(struct loadparm_context *);
|
|---|
| 151 | int lp_max_wins_ttl(struct loadparm_context *);
|
|---|
| 152 | int lp_min_wins_ttl(struct loadparm_context *);
|
|---|
| 153 | int lp_maxmux(struct loadparm_context *);
|
|---|
| 154 | int lp_max_xmit(struct loadparm_context *);
|
|---|
| 155 | int lp_passwordlevel(struct loadparm_context *);
|
|---|
| 156 | int lp_srv_maxprotocol(struct loadparm_context *);
|
|---|
| 157 | int lp_srv_minprotocol(struct loadparm_context *);
|
|---|
| 158 | int lp_cli_maxprotocol(struct loadparm_context *);
|
|---|
| 159 | int lp_cli_minprotocol(struct loadparm_context *);
|
|---|
| 160 | int lp_security(struct loadparm_context *);
|
|---|
| 161 | bool lp_paranoid_server_security(struct loadparm_context *);
|
|---|
| 162 | int lp_announce_as(struct loadparm_context *);
|
|---|
| 163 |
|
|---|
| 164 | const char *lp_servicename(const struct loadparm_service *service);
|
|---|
| 165 | const char *lp_pathname(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 166 | const char **lp_hostsallow(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 167 | const char **lp_hostsdeny(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 168 | const char *lp_comment(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 169 | const char *lp_fstype(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 170 | const char **lp_ntvfs_handler(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 171 | bool lp_msdfs_root(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 172 | bool lp_browseable(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 173 | bool lp_readonly(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 174 | bool lp_print_ok(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 175 | bool lp_map_hidden(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 176 | bool lp_map_archive(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 177 | bool lp_strict_locking(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 178 | bool lp_oplocks(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 179 | bool lp_strict_sync(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 180 | bool lp_ci_filesystem(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 181 | bool lp_map_system(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 182 | int lp_max_connections(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 183 | int lp_csc_policy(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 184 | int lp_create_mask(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 185 | int lp_force_create_mode(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 186 | int lp_dir_mask(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 187 | int lp_force_dir_mode(struct loadparm_service *, struct loadparm_service *);
|
|---|
| 188 | int lp_server_signing(struct loadparm_context *);
|
|---|
| 189 | int lp_client_signing(struct loadparm_context *);
|
|---|
| 190 | const char *lp_ntp_signd_socket_directory(struct loadparm_context *);
|
|---|
| 191 |
|
|---|
| 192 |
|
|---|
| 193 | const char *lp_get_parametric(struct loadparm_context *lp_ctx,
|
|---|
| 194 | struct loadparm_service *service,
|
|---|
| 195 | const char *type, const char *option);
|
|---|
| 196 |
|
|---|
| 197 | const char *lp_parm_string(struct loadparm_context *lp_ctx,
|
|---|
| 198 | struct loadparm_service *service, const char *type,
|
|---|
| 199 | const char *option);
|
|---|
| 200 | const char **lp_parm_string_list(TALLOC_CTX *mem_ctx,
|
|---|
| 201 | struct loadparm_context *lp_ctx,
|
|---|
| 202 | struct loadparm_service *service,
|
|---|
| 203 | const char *type,
|
|---|
| 204 | const char *option, const char *separator);
|
|---|
| 205 | int lp_parm_int(struct loadparm_context *lp_ctx,
|
|---|
| 206 | struct loadparm_service *service, const char *type,
|
|---|
| 207 | const char *option, int default_v);
|
|---|
| 208 | int lp_parm_bytes(struct loadparm_context *lp_ctx,
|
|---|
| 209 | struct loadparm_service *service, const char *type,
|
|---|
| 210 | const char *option, int default_v);
|
|---|
| 211 | unsigned long lp_parm_ulong(struct loadparm_context *lp_ctx,
|
|---|
| 212 | struct loadparm_service *service, const char *type,
|
|---|
| 213 | const char *option, unsigned long default_v);
|
|---|
| 214 | double lp_parm_double(struct loadparm_context *lp_ctx,
|
|---|
| 215 | struct loadparm_service *service, const char *type,
|
|---|
| 216 | const char *option, double default_v);
|
|---|
| 217 | bool lp_parm_bool(struct loadparm_context *lp_ctx,
|
|---|
| 218 | struct loadparm_service *service, const char *type,
|
|---|
| 219 | const char *option, bool default_v);
|
|---|
| 220 | struct loadparm_service *lp_add_service(struct loadparm_context *lp_ctx,
|
|---|
| 221 | const struct loadparm_service *pservice,
|
|---|
| 222 | const char *name);
|
|---|
| 223 | bool lp_add_home(struct loadparm_context *lp_ctx,
|
|---|
| 224 | const char *pszHomename,
|
|---|
| 225 | struct loadparm_service *default_service,
|
|---|
| 226 | const char *user, const char *pszHomedir);
|
|---|
| 227 | bool lp_add_printer(struct loadparm_context *lp_ctx,
|
|---|
| 228 | const char *pszPrintername,
|
|---|
| 229 | struct loadparm_service *default_service);
|
|---|
| 230 | struct parm_struct *lp_parm_struct(const char *name);
|
|---|
| 231 | void *lp_parm_ptr(struct loadparm_context *lp_ctx,
|
|---|
| 232 | struct loadparm_service *service, struct parm_struct *parm);
|
|---|
| 233 | bool lp_file_list_changed(struct loadparm_context *lp_ctx);
|
|---|
| 234 |
|
|---|
| 235 | bool lp_do_global_parameter(struct loadparm_context *lp_ctx,
|
|---|
| 236 | const char *pszParmName, const char *pszParmValue);
|
|---|
| 237 | bool lp_do_service_parameter(struct loadparm_context *lp_ctx,
|
|---|
| 238 | struct loadparm_service *service,
|
|---|
| 239 | const char *pszParmName, const char *pszParmValue);
|
|---|
| 240 |
|
|---|
| 241 | /**
|
|---|
| 242 | * Process a parameter.
|
|---|
| 243 | */
|
|---|
| 244 | bool lp_do_global_parameter_var(struct loadparm_context *lp_ctx,
|
|---|
| 245 | const char *pszParmName, const char *fmt, ...);
|
|---|
| 246 | bool lp_set_cmdline(struct loadparm_context *lp_ctx, const char *pszParmName,
|
|---|
| 247 | const char *pszParmValue);
|
|---|
| 248 | bool lp_set_option(struct loadparm_context *lp_ctx, const char *option);
|
|---|
| 249 |
|
|---|
| 250 | /**
|
|---|
| 251 | * Display the contents of a single services record.
|
|---|
| 252 | */
|
|---|
| 253 | bool lp_dump_a_parameter(struct loadparm_context *lp_ctx,
|
|---|
| 254 | struct loadparm_service *service,
|
|---|
| 255 | const char *parm_name, FILE * f);
|
|---|
| 256 |
|
|---|
| 257 | /**
|
|---|
| 258 | * Return info about the next service in a service. snum==-1 gives the globals.
|
|---|
| 259 | * Return NULL when out of parameters.
|
|---|
| 260 | */
|
|---|
| 261 | struct parm_struct *lp_next_parameter(struct loadparm_context *lp_ctx, int snum, int *i,
|
|---|
| 262 | int allparameters);
|
|---|
| 263 |
|
|---|
| 264 | /**
|
|---|
| 265 | * Unload unused services.
|
|---|
| 266 | */
|
|---|
| 267 | void lp_killunused(struct loadparm_context *lp_ctx,
|
|---|
| 268 | struct smbsrv_connection *smb,
|
|---|
| 269 | bool (*snumused) (struct smbsrv_connection *, int));
|
|---|
| 270 |
|
|---|
| 271 | /**
|
|---|
| 272 | * Initialise the global parameter structure.
|
|---|
| 273 | */
|
|---|
| 274 | struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx);
|
|---|
| 275 | const char *lp_configfile(struct loadparm_context *lp_ctx);
|
|---|
| 276 | bool lp_load_default(struct loadparm_context *lp_ctx);
|
|---|
| 277 | const char *lp_default_path(void);
|
|---|
| 278 |
|
|---|
| 279 | /**
|
|---|
| 280 | * Load the services array from the services file.
|
|---|
| 281 | *
|
|---|
| 282 | * Return True on success, False on failure.
|
|---|
| 283 | */
|
|---|
| 284 | bool lp_load(struct loadparm_context *lp_ctx, const char *filename);
|
|---|
| 285 |
|
|---|
| 286 | /**
|
|---|
| 287 | * Return the max number of services.
|
|---|
| 288 | */
|
|---|
| 289 | int lp_numservices(struct loadparm_context *lp_ctx);
|
|---|
| 290 |
|
|---|
| 291 | /**
|
|---|
| 292 | * Display the contents of the services array in human-readable form.
|
|---|
| 293 | */
|
|---|
| 294 | void lp_dump(struct loadparm_context *lp_ctx, FILE *f, bool show_defaults,
|
|---|
| 295 | int maxtoprint);
|
|---|
| 296 |
|
|---|
| 297 | /**
|
|---|
| 298 | * Display the contents of one service in human-readable form.
|
|---|
| 299 | */
|
|---|
| 300 | void lp_dump_one(FILE *f, bool show_defaults, struct loadparm_service *service, struct loadparm_service *sDefault);
|
|---|
| 301 | struct loadparm_service *lp_servicebynum(struct loadparm_context *lp_ctx,
|
|---|
| 302 | int snum);
|
|---|
| 303 | struct loadparm_service *lp_service(struct loadparm_context *lp_ctx,
|
|---|
| 304 | const char *service_name);
|
|---|
| 305 |
|
|---|
| 306 | /**
|
|---|
| 307 | * A useful volume label function.
|
|---|
| 308 | */
|
|---|
| 309 | const char *volume_label(struct loadparm_service *service, struct loadparm_service *sDefault);
|
|---|
| 310 |
|
|---|
| 311 | /**
|
|---|
| 312 | * If we are PDC then prefer us as DMB
|
|---|
| 313 | */
|
|---|
| 314 | const char *lp_printername(struct loadparm_service *service, struct loadparm_service *sDefault);
|
|---|
| 315 |
|
|---|
| 316 | /**
|
|---|
| 317 | * Return the max print jobs per queue.
|
|---|
| 318 | */
|
|---|
| 319 | int lp_maxprintjobs(struct loadparm_service *service, struct loadparm_service *sDefault);
|
|---|
| 320 | struct smb_iconv_convenience *lp_iconv_convenience(struct loadparm_context *lp_ctx);
|
|---|
| 321 | void lp_smbcli_options(struct loadparm_context *lp_ctx,
|
|---|
| 322 | struct smbcli_options *options);
|
|---|
| 323 | void lp_smbcli_session_options(struct loadparm_context *lp_ctx,
|
|---|
| 324 | struct smbcli_session_options *options);
|
|---|
| 325 | struct dcerpc_server_info *lp_dcerpc_server_info(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx);
|
|---|
| 326 | struct gensec_settings *lp_gensec_settings(TALLOC_CTX *, struct loadparm_context *);
|
|---|
| 327 |
|
|---|
| 328 |
|
|---|
| 329 | /* The following definitions come from param/generic.c */
|
|---|
| 330 |
|
|---|
| 331 | struct param_section *param_get_section(struct param_context *ctx, const char *name);
|
|---|
| 332 | struct parmlist_entry *param_section_get(struct param_section *section,
|
|---|
| 333 | const char *name);
|
|---|
| 334 | struct parmlist_entry *param_get (struct param_context *ctx, const char *name, const char *section_name);
|
|---|
| 335 | struct param_section *param_add_section(struct param_context *ctx, const char *section_name);
|
|---|
| 336 | struct parmlist_entry *param_get_add(struct param_context *ctx, const char *name, const char *section_name);
|
|---|
| 337 | const char *param_get_string(struct param_context *ctx, const char *param, const char *section);
|
|---|
| 338 | int param_set_string(struct param_context *ctx, const char *param, const char *value, const char *section);
|
|---|
| 339 | const char **param_get_string_list(struct param_context *ctx, const char *param, const char *separator, const char *section);
|
|---|
| 340 | int param_set_string_list(struct param_context *ctx, const char *param, const char **list, const char *section);
|
|---|
| 341 | int param_get_int(struct param_context *ctx, const char *param, int default_v, const char *section);
|
|---|
| 342 | void param_set_int(struct param_context *ctx, const char *param, int value, const char *section);
|
|---|
| 343 | unsigned long param_get_ulong(struct param_context *ctx, const char *param, unsigned long default_v, const char *section);
|
|---|
| 344 | void param_set_ulong(struct param_context *ctx, const char *name, unsigned long value, const char *section);
|
|---|
| 345 | struct param_context *param_init(TALLOC_CTX *mem_ctx);
|
|---|
| 346 | int param_read(struct param_context *ctx, const char *fn);
|
|---|
| 347 | int param_use(struct loadparm_context *lp_ctx, struct param_context *ctx);
|
|---|
| 348 | int param_write(struct param_context *ctx, const char *fn);
|
|---|
| 349 |
|
|---|
| 350 | /* The following definitions come from param/util.c */
|
|---|
| 351 |
|
|---|
| 352 |
|
|---|
| 353 | /**
|
|---|
| 354 | * @file
|
|---|
| 355 | * @brief Misc utility functions
|
|---|
| 356 | */
|
|---|
| 357 | bool lp_is_mydomain(struct loadparm_context *lp_ctx,
|
|---|
| 358 | const char *domain);
|
|---|
| 359 |
|
|---|
| 360 | bool lp_is_my_domain_or_realm(struct loadparm_context *lp_ctx,
|
|---|
| 361 | const char *domain);
|
|---|
| 362 |
|
|---|
| 363 | /**
|
|---|
| 364 | see if a string matches either our primary or one of our secondary
|
|---|
| 365 | netbios aliases. do a case insensitive match
|
|---|
| 366 | */
|
|---|
| 367 | bool lp_is_myname(struct loadparm_context *lp_ctx, const char *name);
|
|---|
| 368 |
|
|---|
| 369 | /**
|
|---|
| 370 | A useful function for returning a path in the Samba lock directory.
|
|---|
| 371 | **/
|
|---|
| 372 | char *lock_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
|
|---|
| 373 | const char *name);
|
|---|
| 374 |
|
|---|
| 375 | /**
|
|---|
| 376 | * @brief Returns an absolute path to a file in the directory containing the current config file
|
|---|
| 377 | *
|
|---|
| 378 | * @param name File to find, relative to the config file directory.
|
|---|
| 379 | *
|
|---|
| 380 | * @retval Pointer to a talloc'ed string containing the full path.
|
|---|
| 381 | **/
|
|---|
| 382 | char *config_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
|
|---|
| 383 | const char *name);
|
|---|
| 384 |
|
|---|
| 385 | /**
|
|---|
| 386 | * @brief Returns an absolute path to a file in the Samba private directory.
|
|---|
| 387 | *
|
|---|
| 388 | * @param name File to find, relative to PRIVATEDIR.
|
|---|
| 389 | * if name is not relative, then use it as-is
|
|---|
| 390 | *
|
|---|
| 391 | * @retval Pointer to a talloc'ed string containing the full path.
|
|---|
| 392 | **/
|
|---|
| 393 | char *private_path(TALLOC_CTX* mem_ctx,
|
|---|
| 394 | struct loadparm_context *lp_ctx,
|
|---|
| 395 | const char *name);
|
|---|
| 396 |
|
|---|
| 397 | /**
|
|---|
| 398 | return a path in the smbd.tmp directory, where all temporary file
|
|---|
| 399 | for smbd go. If NULL is passed for name then return the directory
|
|---|
| 400 | path itself
|
|---|
| 401 | */
|
|---|
| 402 | char *smbd_tmp_path(TALLOC_CTX *mem_ctx,
|
|---|
| 403 | struct loadparm_context *lp_ctx,
|
|---|
| 404 | const char *name);
|
|---|
| 405 |
|
|---|
| 406 | /**
|
|---|
| 407 | * Obtain the init function from a shared library file
|
|---|
| 408 | */
|
|---|
| 409 | init_module_fn load_module(TALLOC_CTX *mem_ctx, const char *path);
|
|---|
| 410 |
|
|---|
| 411 | /**
|
|---|
| 412 | * Obtain list of init functions from the modules in the specified
|
|---|
| 413 | * directory
|
|---|
| 414 | */
|
|---|
| 415 | init_module_fn *load_modules(TALLOC_CTX *mem_ctx, const char *path);
|
|---|
| 416 |
|
|---|
| 417 | /**
|
|---|
| 418 | * Run the specified init functions.
|
|---|
| 419 | *
|
|---|
| 420 | * @return true if all functions ran successfully, false otherwise
|
|---|
| 421 | */
|
|---|
| 422 | bool run_init_functions(init_module_fn *fns);
|
|---|
| 423 |
|
|---|
| 424 | /**
|
|---|
| 425 | * Load the initialization functions from DSO files for a specific subsystem.
|
|---|
| 426 | *
|
|---|
| 427 | * Will return an array of function pointers to initialization functions
|
|---|
| 428 | */
|
|---|
| 429 | init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *subsystem);
|
|---|
| 430 | const char *lp_messaging_path(TALLOC_CTX *mem_ctx,
|
|---|
| 431 | struct loadparm_context *lp_ctx);
|
|---|
| 432 | struct smb_iconv_convenience *smb_iconv_convenience_init_lp(TALLOC_CTX *mem_ctx,
|
|---|
| 433 | struct loadparm_context *lp_ctx);
|
|---|
| 434 |
|
|---|
| 435 | const char *lp_sam_name(struct loadparm_context *lp_ctx);
|
|---|
| 436 |
|
|---|
| 437 | /* The following definitions come from lib/version.c */
|
|---|
| 438 |
|
|---|
| 439 | const char *samba_version_string(void);
|
|---|
| 440 |
|
|---|
| 441 |
|
|---|
| 442 | #endif /* _PARAM_H */
|
|---|