2004-02-02 13:43:03 +00:00
/*
Unix SMB / CIFS implementation .
2005-01-30 00:54:57 +00:00
process model manager - structures
Copyright ( C ) Andrew Tridgell 1992 - 2005
2004-02-02 13:43:03 +00:00
Copyright ( C ) James J Myers 2003 < myersjj @ samba . org >
2005-01-14 01:32:56 +00:00
Copyright ( C ) Stefan ( metze ) Metzmacher 2004 - 2005
2004-02-02 13:43:03 +00: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 02:07:03 +00:00
the Free Software Foundation ; either version 3 of the License , or
2004-02-02 13:43:03 +00: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 02:07:03 +00:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2004-02-02 13:43:03 +00:00
*/
2006-03-14 15:03:25 +00:00
# ifndef __PROCESS_MODEL_H__
# define __PROCESS_MODEL_H__
2005-02-10 06:59:29 +00:00
# include "lib/socket/socket.h"
2008-02-04 17:59:16 +11:00
# include "smbd/service.h"
2005-02-10 06:59:29 +00:00
2004-02-02 13:43:03 +00: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 */
2008-12-29 20:24:57 +01:00
void ( * model_init ) ( struct tevent_context * ) ;
2004-02-02 13:43:03 +00:00
/* function to accept new connection */
2008-12-29 20:24:57 +01:00
void ( * accept_connection ) ( struct tevent_context * ,
2008-01-05 19:03:43 -06:00
struct loadparm_context * ,
struct socket_context * ,
2008-12-29 20:24:57 +01:00
void ( * ) ( struct tevent_context * ,
2008-01-05 19:03:43 -06:00
struct loadparm_context * ,
struct socket_context * ,
2007-01-10 10:52:09 +00:00
struct server_id , void * ) ,
2005-01-30 00:54:57 +00:00
void * ) ;
2004-07-13 21:04:56 +00:00
2005-01-30 02:55:30 +00:00
/* function to create a task */
2008-12-29 20:24:57 +01:00
void ( * new_task ) ( struct tevent_context * ,
2008-01-05 19:03:43 -06:00
struct loadparm_context * lp_ctx ,
2008-02-04 17:59:16 +11:00
const char * service_name ,
2008-12-29 20:24:57 +01:00
void ( * ) ( struct tevent_context * ,
2008-01-05 19:03:43 -06:00
struct loadparm_context * , struct server_id ,
void * ) ,
2005-01-30 02:55:30 +00:00
void * ) ;
2006-03-09 17:48:41 +00:00
/* function to terminate a connection or task */
2008-12-29 20:24:57 +01:00
void ( * terminate ) ( struct tevent_context * , struct loadparm_context * lp_ctx ,
2008-09-30 03:20:46 +02:00
const char * reason ) ;
2005-01-30 02:55:30 +00:00
2006-03-09 17:48:41 +00:00
/* function to set a title for the connection or task */
2008-12-29 20:24:57 +01:00
void ( * set_title ) ( struct tevent_context * , const char * title ) ;
2004-02-02 13:43:03 +00: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 11:07:23 +00:00
2007-09-03 13:13:25 +00:00
extern const struct model_ops single_ops ;
2008-12-29 20:24:57 +01:00
const struct model_ops * process_model_startup ( struct tevent_context * ev , const char * model ) ;
2008-04-02 04:53:27 +02:00
NTSTATUS register_process_model ( const void * _ops ) ;
NTSTATUS process_model_init ( struct loadparm_context * lp_ctx ) ;
2006-03-14 15:03:25 +00:00
# endif /* __PROCESS_MODEL_H__ */