r6961: Add RPC-WINREG to list of win2k3 tests
[samba.git] / source / smbd / process_model.h
1 /* 
2    Unix SMB/CIFS implementation.
3
4    process model manager - structures
5
6    Copyright (C) Andrew Tridgell 1992-2005
7    Copyright (C) James J Myers 2003 <myersjj@samba.org>
8    Copyright (C) Stefan (metze) Metzmacher 2004-2005
9    
10    This program is free software; you can redistribute it and/or modify
11    it under the terms of the GNU General Public License as published by
12    the Free Software Foundation; either version 2 of the License, or
13    (at your option) any later version.
14    
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License for more details.
19    
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25 #include "lib/socket/socket.h"
26
27 /* modules can use the following to determine if the interface has changed
28  * please increment the version number after each interface change
29  * with a comment and maybe update struct process_model_critical_sizes.
30  */
31 /* version 1 - initial version - metze */
32 #define PROCESS_MODEL_VERSION 1
33
34 /* the process model operations structure - contains function pointers to 
35    the model-specific implementations of each operation */
36 struct model_ops {
37         /* the name of the process_model */
38         const char *name;
39
40         /* called at startup when the model is selected */
41         void (*model_init)(struct event_context *);
42
43         /* function to accept new connection */
44         void (*accept_connection)(struct event_context *, struct socket_context *, 
45                                   void (*)(struct event_context *, struct socket_context *, 
46                                            uint32_t , void *), 
47                                   void *);
48
49         /* function to create a task */
50         void (*new_task)(struct event_context *, 
51                          void (*)(struct event_context *, uint32_t, void *),
52                          void *);
53
54         /* function to terminate a task */
55         void (*terminate)(struct event_context *, const char *reason);
56
57 };
58
59 /* this structure is used by modules to determine the size of some critical types */
60 struct process_model_critical_sizes {
61         int interface_version;
62         int sizeof_model_ops;
63 };