2004-02-02 16:43:03 +03:00
/*
Unix SMB / CIFS implementation .
2005-01-30 03:54:57 +03:00
process model manager - structures
Copyright ( C ) Andrew Tridgell 1992 - 2005
2004-02-02 16:43:03 +03:00
Copyright ( C ) James J Myers 2003 < myersjj @ samba . org >
2005-01-14 04:32:56 +03:00
Copyright ( C ) Stefan ( metze ) Metzmacher 2004 - 2005
2004-02-02 16:43:03 +03:00
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
2007-07-10 06:07:03 +04:00
the Free Software Foundation ; either version 3 of the License , or
2004-02-02 16:43:03 +03:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 06:07:03 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2004-02-02 16:43:03 +03:00
*/
2006-03-14 18:03:25 +03:00
# ifndef __PROCESS_MODEL_H__
# define __PROCESS_MODEL_H__
2005-02-10 09:59:29 +03:00
# include "lib/socket/socket.h"
2020-11-20 17:27:17 +03:00
# include "samba/service.h"
# include "samba/process_model_proto.h"
2005-02-10 09:59:29 +03:00
2004-02-02 16:43:03 +03:00
/* modules can use the following to determine if the interface has changed
* please increment the version number after each interface change
* with a comment and maybe update struct process_model_critical_sizes .
*/
/* version 1 - initial version - metze */
# define PROCESS_MODEL_VERSION 1
/* the process model operations structure - contains function pointers to
the model - specific implementations of each operation */
struct model_ops {
/* the name of the process_model */
const char * name ;
/* called at startup when the model is selected */
2010-10-30 04:24:15 +04:00
void ( * model_init ) ( void ) ;
2004-02-02 16:43:03 +03:00
/* function to accept new connection */
2008-12-29 22:24:57 +03:00
void ( * accept_connection ) ( struct tevent_context * ,
2008-01-06 04:03:43 +03:00
struct loadparm_context * ,
struct socket_context * ,
2008-12-29 22:24:57 +03:00
void ( * ) ( struct tevent_context * ,
2008-01-06 04:03:43 +03:00
struct loadparm_context * ,
struct socket_context * ,
2017-09-14 22:09:23 +03:00
struct server_id , void * , void * ) ,
void * , void * ) ;
2004-07-14 01:04:56 +04:00
2005-01-30 05:55:30 +03:00
/* function to create a task */
2008-12-29 22:24:57 +03:00
void ( * new_task ) ( struct tevent_context * ,
2010-07-16 08:32:42 +04:00
struct loadparm_context * lp_ctx ,
2008-02-04 09:59:16 +03:00
const char * service_name ,
2018-08-23 00:35:52 +03:00
struct task_server * ( * ) ( struct tevent_context * ,
2008-01-06 04:03:43 +03:00
struct loadparm_context * , struct server_id ,
2017-09-14 22:09:23 +03:00
void * , void * ) ,
2017-08-21 22:58:14 +03:00
void * ,
2017-09-14 22:09:23 +03:00
const struct service_details * ,
const int ) ;
2005-01-30 05:55:30 +03:00
2018-09-04 03:12:49 +03:00
/* 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 ) ;
2005-01-30 05:55:30 +03:00
2006-03-09 20:48:41 +03:00
/* function to set a title for the connection or task */
2008-12-29 22:24:57 +03:00
void ( * set_title ) ( struct tevent_context * , const char * title ) ;
2004-02-02 16:43:03 +03:00
} ;
/* 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 ;
} ;
2006-03-07 14:07:23 +03:00
2007-09-03 17:13:25 +04:00
extern const struct model_ops single_ops ;
2010-10-30 04:24:15 +04:00
const struct model_ops * process_model_startup ( const char * model ) ;
2010-11-03 12:57:38 +03:00
NTSTATUS register_process_model ( const struct model_ops * ops ) ;
2008-04-02 06:53:27 +04:00
NTSTATUS process_model_init ( struct loadparm_context * lp_ctx ) ;
2006-03-14 18:03:25 +03:00
# endif /* __PROCESS_MODEL_H__ */