tevent: expose tevent_context_init_ops
[Samba/gebeck_regimport.git] / source3 / param / loadparm_ctx.c
blob437ce435060399fa8e9f72dac796245537fec9f9
1 /*
2 Unix SMB/CIFS implementation.
3 Parameter loading functions
4 Copyright (C) Andrew Bartlett 2011
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.
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.
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/>.
20 #include "includes.h"
21 #include "lib/param/s3_param.h"
23 static struct loadparm_service *lp_service_for_s4_ctx(const char *servicename)
25 TALLOC_CTX *mem_ctx;
26 struct loadparm_service *service;
28 mem_ctx = talloc_stackframe();
29 service = lp_service(servicename);
30 talloc_free(mem_ctx);
32 return service;
35 static struct loadparm_service *lp_servicebynum_for_s4_ctx(int servicenum)
37 TALLOC_CTX *mem_ctx;
38 struct loadparm_service *service;
40 mem_ctx = talloc_stackframe();
41 service = lp_servicebynum(servicenum);
42 talloc_free(mem_ctx);
44 return service;
47 static bool lp_load_for_s4_ctx(const char *filename)
49 TALLOC_CTX *mem_ctx;
50 bool status;
52 mem_ctx = talloc_stackframe();
53 status = lp_load(filename, false, false, false, false);
54 talloc_free(mem_ctx);
56 return status;
59 /* These are in the order that they appear in the s4 loadparm file.
60 * All of the s4 loadparm functions should be here eventually, once
61 * they are implemented in the s3 loadparm, have the same format (enum
62 * values in particular) and defaults. */
63 static const struct loadparm_s3_context s3_fns =
65 .get_parametric = lp_parm_const_string_service,
66 .get_parm_struct = lp_get_parameter,
67 .get_parm_ptr = lp_parm_ptr,
68 .get_service = lp_service_for_s4_ctx,
69 .get_servicebynum = lp_servicebynum_for_s4_ctx,
70 .get_default_loadparm_service = lp_default_loadparm_service,
71 .get_numservices = lp_numservices,
72 .load = lp_load_for_s4_ctx,
73 .set_cmdline = lp_set_cmdline,
74 .dump = lp_dump,
76 .server_role = lp_server_role,
77 .security = lp_security,
79 .winbind_separator = lp_winbind_separator,
80 .template_homedir = lp_template_homedir,
81 .template_shell = lp_template_shell,
83 .dos_charset = lp_dos_charset,
84 .unix_charset = lp_unix_charset,
86 .realm = lp_realm,
87 .dnsdomain = lp_dnsdomain,
88 .socket_options = lp_socket_options,
89 .workgroup = lp_workgroup,
91 .netbios_name = lp_netbios_name,
92 .netbios_scope = lp_netbios_scope,
93 .netbios_aliases = lp_netbios_aliases,
95 .lanman_auth = lp_lanman_auth,
96 .ntlm_auth = lp_ntlm_auth,
98 .client_plaintext_auth = lp_client_plaintext_auth,
99 .client_lanman_auth = lp_client_lanman_auth,
100 .client_ntlmv2_auth = lp_client_ntlmv2_auth,
101 .client_use_spnego_principal = lp_client_use_spnego_principal,
103 .private_dir = lp_private_dir,
104 .ncalrpc_dir = lp_ncalrpc_dir,
105 .lockdir = lp_lockdir,
107 .passdb_backend = lp_passdb_backend,
109 .host_msdfs = lp_host_msdfs,
110 .unix_extensions = lp_unix_extensions,
111 .use_spnego = lp_use_spnego,
112 .use_mmap = lp_use_mmap,
114 .srv_minprotocol = lp_srv_minprotocol,
115 .srv_maxprotocol = lp_srv_maxprotocol,
117 .passwordserver = lp_passwordserver
120 const struct loadparm_s3_context *loadparm_s3_context(void)
122 return &s3_fns;