CVE-2023-42669 s3-rpc_server: Disable rpcecho for consistency with the AD DC
[Samba.git] / source4 / samba / process_model.h
blob446e0f1cf260499c7e03488c7521a7fd681e0733
1 /*
2 Unix SMB/CIFS implementation.
4 process model manager - structures
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
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 3 of the License, or
13 (at your option) any later version.
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.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef __PROCESS_MODEL_H__
25 #define __PROCESS_MODEL_H__
27 #include "lib/socket/socket.h"
28 #include "samba/service.h"
29 #include "samba/process_model_proto.h"
31 /* modules can use the following to determine if the interface has changed
32 * please increment the version number after each interface change
33 * with a comment and maybe update struct process_model_critical_sizes.
35 /* version 1 - initial version - metze */
36 #define PROCESS_MODEL_VERSION 1
38 /* the process model operations structure - contains function pointers to
39 the model-specific implementations of each operation */
40 struct model_ops {
41 /* the name of the process_model */
42 const char *name;
44 /* called at startup when the model is selected */
45 void (*model_init)(void);
47 /* function to accept new connection */
48 void (*accept_connection)(struct tevent_context *,
49 struct loadparm_context *,
50 struct socket_context *,
51 void (*)(struct tevent_context *,
52 struct loadparm_context *,
53 struct socket_context *,
54 struct server_id , void *, void *),
55 void *, void *);
57 /* function to create a task */
58 void (*new_task)(struct tevent_context *,
59 struct loadparm_context *lp_ctx,
60 const char *service_name,
61 struct task_server * (*)(struct tevent_context *,
62 struct loadparm_context *, struct server_id,
63 void *, void *),
64 void *,
65 const struct service_details*,
66 const int);
68 /* function to terminate a task */
69 void (*terminate_task)(struct tevent_context *,
70 struct loadparm_context *lp_ctx,
71 const char *reason,
72 bool fatal,
73 void *process_context);
74 /* function to terminate a connection */
75 void (*terminate_connection)(struct tevent_context *,
76 struct loadparm_context *lp_ctx,
77 const char *reason,
78 void *process_context);
80 /* function to set a title for the connection or task */
81 void (*set_title)(struct tevent_context *, const char *title);
84 /* this structure is used by modules to determine the size of some critical types */
85 struct process_model_critical_sizes {
86 int interface_version;
87 int sizeof_model_ops;
90 extern const struct model_ops single_ops;
92 const struct model_ops *process_model_startup(const char *model);
93 NTSTATUS register_process_model(const struct model_ops *ops);
94 NTSTATUS process_model_init(struct loadparm_context *lp_ctx);
96 #endif /* __PROCESS_MODEL_H__ */