source4 smbd prefork: restart on non zero exit code
[bbaumbach/samba-autobuild/.git] / source4 / smbd / process_model.h
index 6afb66ff20284c8e92734ed841e99c89e63e6999..2892dd43c04e75e8464a259b30b9f243c234fcea 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "lib/socket/socket.h"
 #include "smbd/service.h"
+#include "smbd/process_model_proto.h"
 
 /* modules can use the following to determine if the interface has changed
  * please increment the version number after each interface change
@@ -41,33 +42,43 @@ struct model_ops {
        const char *name;
 
        /* called at startup when the model is selected */
-       void (*model_init)(struct event_context *);
+       void (*model_init)(void);
 
        /* function to accept new connection */
-       void (*accept_connection)(struct event_context *, 
+       void (*accept_connection)(struct tevent_context *, 
                                  struct loadparm_context *,
                                  struct socket_context *, 
-                                 void (*)(struct event_context *, 
+                                 void (*)(struct tevent_context *, 
                                           struct loadparm_context *,
                                           struct socket_context *, 
-                                          struct server_id , void *), 
-                                 void *);
+                                          struct server_id , void *, void *),
+                                 void *, void *);
 
        /* function to create a task */
-       void (*new_task)(struct event_context *, 
-                        struct loadparm_context *lp_ctx, 
+       void (*new_task)(struct tevent_context *, 
+                        struct loadparm_context *lp_ctx,
                         const char *service_name,
-                        void (*)(struct event_context *, 
+                        struct task_server * (*)(struct tevent_context *,
                                  struct loadparm_context *, struct server_id, 
-                                 void *),
-                        void *);
+                                 void *, void *),
+                        void *,
+                        const struct service_details*,
+                        const int);
 
-       /* function to terminate a connection or task */
-       void (*terminate)(struct event_context *, struct loadparm_context *lp_ctx, 
-                         const char *reason);
+       /* function to terminate a task */
+       void (*terminate_task)(struct tevent_context *,
+                              struct loadparm_context *lp_ctx,
+                              const char *reason,
+                              bool fatal,
+                              void *process_context);
+       /* function to terminate a connection */
+       void (*terminate_connection)(struct tevent_context *,
+                                    struct loadparm_context *lp_ctx,
+                                    const char *reason,
+                                    void *process_context);
 
        /* function to set a title for the connection or task */
-       void (*set_title)(struct event_context *, const char *title);
+       void (*set_title)(struct tevent_context *, const char *title);
 };
 
 /* this structure is used by modules to determine the size of some critical types */
@@ -78,8 +89,8 @@ struct process_model_critical_sizes {
 
 extern const struct model_ops single_ops;
 
-const struct model_ops *process_model_startup(struct event_context *ev, const char *model);
-NTSTATUS register_process_model(const void *_ops);
+const struct model_ops *process_model_startup(const char *model);
+NTSTATUS register_process_model(const struct model_ops *ops);
 NTSTATUS process_model_init(struct loadparm_context *lp_ctx);
 
 #endif /* __PROCESS_MODEL_H__ */