r26400: Don't try to do character conversion before smb.conf has been parsed.
[kai/samba-autobuild/.git] / source4 / smbd / process_model.h
index 79373d8a39d7f7a148d252ec7fe1451362e3d35b..19212606c1c1bb47427197b9db9c102c095b14c2 100644 (file)
@@ -1,13 +1,15 @@
 /* 
    Unix SMB/CIFS implementation.
-   process model manager - main loop
-   Copyright (C) Andrew Tridgell 1992-2003
+
+   process model manager - structures
+
+   Copyright (C) Andrew Tridgell 1992-2005
    Copyright (C) James J Myers 2003 <myersjj@samba.org>
-   Copyright (C) Stefan (metze) Metzmacher 2004
+   Copyright (C) Stefan (metze) Metzmacher 2004-2005
    
    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/>.
 */
 
-#ifndef SAMBA_PROCESS_MODEL_H
-#define SAMBA_PROCESS_MODEL_H
+#ifndef __PROCESS_MODEL_H__
+#define __PROCESS_MODEL_H__
+
+#include "lib/socket/socket.h"
+#include "smbd/service_task.h"
 
 /* modules can use the following to determine if the interface has changed
  * please increment the version number after each interface change
@@ -37,28 +41,34 @@ struct model_ops {
        const char *name;
 
        /* called at startup when the model is selected */
-       void (*model_startup)(void);
+       void (*model_init)(struct event_context *);
 
        /* function to accept new connection */
-       void (*accept_connection)(struct event_context *, struct fd_event *, time_t, uint16_t);
-                       
-       /* function to terminate a connection */
-       void (*terminate_connection)(struct server_connection *srv_conn, const char *reason);
+       void (*accept_connection)(struct event_context *, struct socket_context *, 
+                                 void (*)(struct event_context *, struct socket_context *, 
+                                          struct server_id , void *), 
+                                 void *);
 
-       /* function to exit server */
-       void (*exit_server)(struct server_context *srv_ctx, const char *reason);
+       /* function to create a task */
+       void (*new_task)(struct event_context *, 
+                        void (*)(struct event_context *, struct server_id, void *),
+                        void *);
 
-       /* returns process or thread id */
-       int (*get_id)(struct smbsrv_request *req);
+       /* function to terminate a connection or task */
+       void (*terminate)(struct event_context *, const char *reason);
+
+       /* function to set a title for the connection or task */
+       void (*set_title)(struct event_context *, const char *title);
 };
 
 /* this structure is used by modules to determine the size of some critical types */
 struct process_model_critical_sizes {
        int interface_version;
        int sizeof_model_ops;
-       int sizeof_server_context;
-       int sizeof_event_context;
-       int sizeof_fd_event;
 };
 
-#endif /* SAMBA_PROCESS_MODEL_H */
+extern const struct model_ops single_ops;
+
+#include "smbd/process_model_proto.h"
+
+#endif /* __PROCESS_MODEL_H__ */