s3-param: Rename loadparm_s3_context -> loadparm_s3_helpers
[kai/samba.git] / source3 / param / loadparm_ctx.c
index 7c59ca709a3b6d9a376953dee233a14c231a4a33..9c78f15879b8c048228142266d3df3c903f7050d 100644 (file)
 */
 
 #include "includes.h"
-#include "../source4/param/s3_param.h"
+#include "lib/param/s3_param.h"
+
+static struct loadparm_service *lp_service_for_s4_ctx(const char *servicename)
+{
+       TALLOC_CTX *mem_ctx;
+       struct loadparm_service *service;
+
+       mem_ctx = talloc_stackframe();
+       service = lp_service(servicename);
+       talloc_free(mem_ctx);
+
+       return service;
+}
+
+static struct loadparm_service *lp_servicebynum_for_s4_ctx(int servicenum)
+{
+       TALLOC_CTX *mem_ctx;
+       struct loadparm_service *service;
+
+       mem_ctx = talloc_stackframe();
+       service = lp_servicebynum(servicenum);
+       talloc_free(mem_ctx);
+
+       return service;
+}
+
+static bool lp_load_for_s4_ctx(const char *filename)
+{
+       TALLOC_CTX *mem_ctx;
+       bool status;
+
+       mem_ctx = talloc_stackframe();
+       status =  lp_load(filename, false, false, false, false);
+       talloc_free(mem_ctx);
+
+       return status;
+}
 
 /* These are in the order that they appear in the s4 loadparm file.
  * All of the s4 loadparm functions should be here eventually, once
  * they are implemented in the s3 loadparm, have the same format (enum
  * values in particular) and defaults. */
-static const struct loadparm_s3_context s3_fns = 
+static const struct loadparm_s3_helpers s3_fns =
 {
        .get_parametric = lp_parm_const_string_service,
        .get_parm_struct = lp_get_parameter,
        .get_parm_ptr = lp_parm_ptr,
-       .get_service = lp_service,
-       .get_servicebynum = lp_servicebynum,
+       .get_service = lp_service_for_s4_ctx,
+       .get_servicebynum = lp_servicebynum_for_s4_ctx,
        .get_default_loadparm_service = lp_default_loadparm_service,
        .get_numservices = lp_numservices,
+       .load = lp_load_for_s4_ctx,
        .set_cmdline = lp_set_cmdline,
+       .dump = lp_dump,
 
        .server_role = lp_server_role,
+       .security = lp_security,
 
        .winbind_separator = lp_winbind_separator,
        .template_homedir = lp_template_homedir,
@@ -59,13 +98,26 @@ static const struct loadparm_s3_context s3_fns =
        .client_plaintext_auth = lp_client_plaintext_auth,
        .client_lanman_auth = lp_client_lanman_auth,
        .client_ntlmv2_auth = lp_client_ntlmv2_auth,
+       .client_use_spnego_principal = lp_client_use_spnego_principal,
 
        .private_dir = lp_private_dir,
        .ncalrpc_dir = lp_ncalrpc_dir,
-       .lockdir = lp_lockdir
+       .lockdir = lp_lockdir,
+
+       .passdb_backend = lp_passdb_backend,
+
+       .host_msdfs = lp_host_msdfs,
+       .unix_extensions = lp_unix_extensions,
+       .use_spnego = lp_use_spnego,
+       .use_mmap = lp_use_mmap,
+
+       .srv_minprotocol = lp_srv_minprotocol,
+       .srv_maxprotocol = lp_srv_maxprotocol,
+
+       .passwordserver = lp_passwordserver
 };
 
-const struct loadparm_s3_context *loadparm_s3_context(void)
+const struct loadparm_s3_helpers *loadparm_s3_helpers(void)
 {
        return &s3_fns;
 }