python/ldap: Get further.
[ira/wip.git] / source / smbd / service.c
index 5bced4eae45335b3dc0b9ec1521d3e291e077cad..525b24561616b72bdbecead985e6aadc167cbb62 100644 (file)
@@ -8,7 +8,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
-#include "dlinklist.h"
+#include "lib/util/dlinklist.h"
 #include "smbd/process_model.h"
 
 /*
 static struct registered_server {
        struct registered_server *next, *prev;
        const char *service_name;
-       NTSTATUS (*service_init)(struct event_context *, const struct model_ops *);
+       NTSTATUS (*service_init)(struct event_context *, struct loadparm_context *lp_ctx, const struct model_ops *);
 } *registered_servers;
 
 /*
   register a server service. 
 */
 NTSTATUS register_server_service(const char *name,
-                                NTSTATUS (*service_init)(struct event_context *, const struct model_ops *))
+                                NTSTATUS (*service_init)(struct event_context *, struct loadparm_context *lp_ctx, const struct model_ops *))
 {
        struct registered_server *srv;
        srv = talloc(talloc_autofree_context(), struct registered_server);
@@ -55,12 +54,13 @@ NTSTATUS register_server_service(const char *name,
 */
 static NTSTATUS server_service_init(const char *name,
                                    struct event_context *event_ctx,
+                                   struct loadparm_context *lp_ctx,
                                    const struct model_ops *model_ops)
 {
        struct registered_server *srv;
        for (srv=registered_servers; srv; srv=srv->next) {
                if (strcasecmp(name, srv->service_name) == 0) {
-                       return srv->service_init(event_ctx, model_ops);
+                       return srv->service_init(event_ctx, lp_ctx, model_ops);
                }
        }
        return NT_STATUS_INVALID_SYSTEM_SERVICE;
@@ -71,6 +71,7 @@ static NTSTATUS server_service_init(const char *name,
   startup all of our server services
 */
 NTSTATUS server_service_startup(struct event_context *event_ctx, 
+                               struct loadparm_context *lp_ctx,
                                const char *model, const char **server_services)
 {
        int i;
@@ -90,7 +91,7 @@ NTSTATUS server_service_startup(struct event_context *event_ctx,
        for (i=0;server_services[i];i++) {
                NTSTATUS status;
 
-               status = server_service_init(server_services[i], event_ctx, model_ops);
+               status = server_service_init(server_services[i], event_ctx, lp_ctx, model_ops);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0,("Failed to start service '%s' - %s\n", 
                                 server_services[i], nt_errstr(status)));